Goldbach's Conjecture and Crystal Code

This comparison isn’t saying what you think it’s saying, for two reasons.

The first is that you’re conflating people who reject evidence (the people you’re talking about here) with people who are unconvinced because you haven’t shown sufficient evidence (the people you’re talking to).

People would be right to challenge evolution, general relativity, and a round earth without sufficient evidence. I wouldn’t say they’d be right to reject them without evidence to the contrary, but challenging those ideas would be valid.

That brings me to my second point, which is that people aren’t “challenging” evolution, general relativity, and the concept of a round earth. That they’re challenging it implies that they want more evidence. Instead, they’re flat-out rejecting centuries of evidence. They’re not seeking knowledge on these topics. This is an important distinction.

So when I say that it doesn’t say what you think it’s saying, comparing yourself to Darwin, Einstein, Aristotle, and Eratosthenes while comparing people wanting evidence for your claims to right-wing conspiracy theorists is a valid reason to question your credibility.

4 Likes

OK, here’s the paper.
I hope people will actually take the time to study it, and the results presented.
It’s much more than just about Goldbach’s Conjecture.

If there are any questions, please cite the specific page, math, code, data, etc
you have questions about. I will not address ad hominen statements.

Here are links to the paper.
2025/02/01

1 Like

I got help from the D forum to optimize the D version.
It turns out to be a little bit faster than Crystal.

// Compile with ldc2: $ ldc2 --release -O3 -mcpu native prime_pairs_lohi.d
// Run as: echo 100000 | ./prime_pairs_lohi
// Update: 2025/02/02 

module prime_pairs;

import std;
import std.datetime.stopwatch : StopWatch;

void prime_pairs_lohi(uint n) {
  if ((n&1) == 1 || n < 4) { return writeln("Input not even n > 2"); }
  if (n <= 6) { writeln([n, 1]); writeln([n/2, n/2]); writeln([n/2, n/2]); return; }

  // generate the low-half-residues (lhr) r < n/2
  auto ndiv2 = n/2;               // llr:hhr midpoint
  auto rhi   = n-2;               // max residue limit
  uint[] lhr = iota(3, ndiv2, 2).filter!(e => gcd(e, n) == 1).array;

  // store all the powers of the lhr members < n-2
  int[] lhr_mults;                // for lhr values not part of a pcp
  foreach(r; lhr) {               // step thru the lhr members
    auto r_pwr = r;               // set to first power of r
    if (r > rhi/r_pwr) break;     // exit if r^2 > n-2, as all others are too
    while (r < rhi/r_pwr)         // while r^e < n-2
      lhr_mults ~=(r_pwr *= r);   // store its current power of r
  }

  // store all the cross-products of the lhr members < n-2
  foreach(i, r; lhr) {
    auto ri_max = rhi / r;        // ri can't multiply r with values > this
    if (lhr[i+1] > ri_max) break; // exit if product of consecutive r’s > n-2
    foreach(ri; lhr[i+1..$]) {    // for each residue in reduced list
      if (ri > ri_max) break;     // exit for r if cross-product with ri > n-2
      lhr_mults ~= r * ri;        // store value if < n-2
  } }

  // convert lhr_mults vals > n/2 to their lhr complements n-r,
  // store them, those < n/2, in lhr_del; it now holds non-pcp lhr vals
  auto lhr_del = lhr_mults.map!((r_del) => r_del > ndiv2 ? n - r_del : r_del).array;
  lhr_del.sort!("a < b");
  lhr = setDifference(lhr, lhr_del).array;

  writeln([n,     lhr.length]);   // show n and pcp prime pairs count
  writeln([lhr[0],  n-lhr[0]]);   // show first pcp prime pair of n
  writeln([lhr[$-1],n-lhr[$-1]]); // show last  pcp prime pair of n
}

void main() {
  int n;
  readf("%s", &n);                // get input to n from terminal
  auto timer = StopWatch();       // create execution timer
  timer.start();                  // start it
  prime_pairs_lohi(n);            // run routine
  writeln(timer.peek());          // show timer results
}

The D versus Crystal times example.

D (LDC2 1.40)
➜  ~ echo 100000000 |./prime_pairs_lohi                     
[100000000, 291400]
[11, 99999989]
[49999757, 50000243]
7 secs, 422 ms, 641 μs, and 9 hnsecs

Crystal (1.15)
➜  ~ ./prime_pairs_lohi 100_000_000        
[100000000, 291400]
[11, 99999989]
[49999757, 50000243]
00:00:10.454055301

I found one typo for a number (pg 8) so I’ll post an update version at both sites.
It seems no matter how much I checked it something gets past me. :grinning:
If anyone finds more please let me know.

I’ve updated the code to make it shorter and simpler.

def prime_pairs_lohi(n)
  return puts "Input not even n > 2" unless n.even? && n > 2
  return (pp [n, 1]; pp [n//2, n//2]; pp [n//2, n//2]) if n <= 6

  # generate the low-half-residues (lhr) r < n/2
  lhr = 3u64.step(to: n//2, by: 2).select { |r| r if r.gcd(n) == 1 }.to_a
  ndiv2, rhi = n//2, n-2           # lhr:hhr midpoint, max residue limit

  # store all powers and cross-products of the lhr members < n-2
  lhr_mults = [] of typeof(n)      # lhr multiples, not part of a pcp
  lhr_dup = lhr.dup                # make copy of the lhr members list
  while (r = lhr_dup.shift) && !lhr_dup.empty? # do mults of 1st list r w/others
    rmax = rhi // r                # ri can't multiply r with values > this
    lhr_mults << r*r if r < rmax   # for r^2 multiples
    break if lhr_dup[0] > rmax     # exit if product of consecutive r’s > n-2
    lhr_dup.each do |ri|           # for each residue in reduced list
      break if ri > rmax           # exit for r if cross-product with ri > n-2
      lhr_mults << r * ri          # store value if < n-2
    end                            # check cross-products of next lhr member
  end

  # remove from lhr its lhr_mults, convert vals > n/2 to lhr complements first
  lhr -= lhr_mults.map { |r_del| r_del > ndiv2 ? n - r_del : r_del }

  pp [n, lhr.size]                 # show n and pcp prime pairs count
  pp [lhr.first, n-lhr.first]      # show first pcp prime pair of n
  pp [lhr.last,  n-lhr.last]       # show last  pcp prime pair of n
end

def gen_pcp
  n = (ARGV[0].to_u64 underscore: true) # get n input from terminal
  t1 = Time.monotonic             # start execution timing
  prime_pairs_lohi(n)             # execute code
  pp Time.monotonic - t1          # show execution time
end

gen_pcp

I now have versions in the following languages (fastest to slowest):
D
Crystal
Ruby
Julia
Python3

I plan to do Rust next, and probably an obligatory C++.

It’s been a week now since I released the paper and its been…crickets. :scream:

So I assume all this silence means no one can formulate a mathematical argument to refute anything I’ve presented in the paper, which means it’s correct, which means not only has Goldbach’s Conjecture been proved, but a much better bound on p than given by Bertrand’s Postulate has been found.

Wow, not bad work from one 16 page paper! :smile:
This should really shake up the math world, if the pursuit of knowledge is its goal.
We’ll see.

I’ll update the paper today|tomorrow with the shorter|simpler code.

Speaking for myself, I tried to read the underlying Prime Theory thing, and honsestly, i’m 90% sure you lost your marbles by thinking too hard about math.
Don’t feel bad about it, it’s a common thing, and the human brain is very easily tempted to see patterns anywhere.

The main problem though is that you don’t prove anything really.
As far as I can follow you through that paper, you just say "i examined known prime numbers, and then chose arbitrary intervals around them that have some properties and those intervals show other properties, which proves all primes have those properties.

And I really cannot see how anyone even slightly aquainted with math, would consider that prof of anything.

so, no. From what i saw, you didn’t prove anything, except that too much math drives people crazy.

3 Likes

Their code is just a bloated and imperformant form of a Sieve of Eratosthenes. Most of the code doesn’t do anything.

And yes, their “proof” is a classical fallacy of extrapolating a pattern. In my university, we jokingly called this type of proof “Incomplete Induction”, as opposed to “Complete Induction” for an actual proof by induction.

I highly think that this thread should finally be put to rest, because jzakiya is obviously not interested in actual code improvements, but only brags about their alleged proof. I stopped engaging with them a while ago (which they funnily seem to take as further confirmation for their paper).

4 Likes

Someone in the Python forum did a faster version (which i modded a bit).
When run on latest Python 3.13.2 performance is comparable to Ruby 3.4.1
(one is faster depending on values of n).

import sys
import time
from math import gcd

def prime_pairs_lohi(n):
    if (n & 1 == 1) or n < 4: print("Input not even n > 2"); return
    if n <= 6: print([n, 1]); print([n // 2, n // 2]); print([n // 2, n // 2]); return
    ndiv2, rhi = n // 2, n - 2                # lhr:hhr midpoint, max residue limit

    # generate the low-half-residues (lhr) r < n/2
    lhr = [r for r in range(3, ndiv2, 2) if gcd(r, n) == 1]

    # identify and store powers and cross-products of lhr members < n-2
    lhr_mults = []                             # lhr multiples, not part of a pcp
    L = len(lhr)-1                             # last lhr index value
    for i in range(L):                         # iterate thru lhr indexes
        r = lhr[i]                             # current lhr value
        rmax = rhi // r                        # r can't multiply others with values > this.
        if r < rmax: lhr_mults.append(r * r)   # for r^2 multiples
        if lhr[i + 1] > rmax: break            # exit if product of consecutive r’s > n-2
        for j in range(i + 1, L):              # for reduced lhr array indexes
            if lhr[j] > rmax: break            # exit for r if cross-product with ri > n-2
            lhr_mults.append(r * lhr[j])       # otherwise store cross-product

    # remove from lhr its lhr_mults, convert vals > n/2 to lhr complements first
    lhr_del = { (r if r < ndiv2 else n - r) for r in lhr_mults }
    lhr = [r for r in lhr if r not in lhr_del] # remove lhr_mults from lhr, pcp remain

    print([n, len(lhr)])                       # show n and pcp prime pairs count
    print([lhr[0], n - lhr[0]])                # show first pcp prime pair of n
    print([lhr[-1], n - lhr[-1]])              # show last  pcp prime pair of n

if __name__ == '__main__':
    # Allow input from the command line like Ruby.
    # Also allow underscores in numbers (e.g. 1_000_000)
    if len(sys.argv) > 1:
        # Remove any underscores then convert to int.
        try:
            n = int(sys.argv[1].replace('_', ''))
        except ValueError:
            print("Invalid number:", sys.argv[1])
            sys.exit(1)
    else:
        try:
            n = int(input("Enter even number > 2: ").replace('_', ''))
        except ValueError:
            print("Invalid input.")
            sys.exit(1)
    start_time = time.time()
    prime_pairs_lohi(n)
    print(time.time() - start_time)

Here’s the Go version. Go isn’t really designed for intensive numerical computing.
It doesn’t handle the removal of elements in one array from another very fast.
For n > 1,000,000 performance really drops.

// Compile as: $ go build prime_pairs_lohi.go
// Run as: $ ./prime_pairs_lohi 123_456

package main

import (
  "os"
  "fmt"
  "time"
  "slices"
  "strconv"
  "strings"
)

func coprime(m, n uint) bool {
  for m | 1 != 1 { m, n = n % m, m }
  return (m > 0)
}

func prime_pairs_lohi(n uint) {
  if n&1 == 1 || n < 4 {fmt.Printf("Input not even n > 2"); return }
  if n <= 6 { fmt.Printf("[%d, %d]\n[%d, %d]\n[%d, %d]\n",n,1,n/2,n/2,n/2,n/2); return }

  // generate the low-half-residues (lhr) r < n/2
  ndiv2, rhi := n/2, n-2                    // lhr:hhr midpoint, max residue limit
  lhr := []uint{}                           // to store low half residues
  var r uint = 3
  for r < ndiv2 {if coprime(r, n) { lhr = append(lhr, r)}; r += 2 }

  // identify and store all powers and cross-products of the lhr members < n-2
  lhr_mults := []uint{}                     // lhr multiples, not part of a pcp
  for i := 1; i < len(lhr)-1; i++ {         // iterate thru lhr to find prime multiples
    r := lhr[i-1]                           // for current residue
    rmax := rhi / r                         // ri can't multiply r with values > this
    if r < rmax {lhr_mults = append(lhr_mults, r * r)}  // for r^2 multiples
    if lhr[i] > rmax { break }              // exit if product of consecutive r’s > n-2
    for j := i; j < len(lhr)-1; j++ {       // iterate thru lhr to find prime multiples
      if lhr[j] > rmax { break }            // exit for r if cross-product with ri > n-2
      lhr_mults = append(lhr_mults, r * lhr[j]) // store value if < n-2
  } }

  // convert lhr_mults vals > n/2 to their lhr complements n-r,
  // store them, those < n/2, in lhr_del; it now holds non-pcp lhr vals
  lhr_del := []uint{}
  for _, r := range(lhr_mults) {if r > ndiv2 {r = n - r}; lhr_del = append(lhr_del, r)}
  lhr = slices.DeleteFunc(lhr, func(n uint) bool { return slices.Contains(lhr_del, n) })

  lcnt := len(lhr)
  fmt.Printf("[%d, %d]\n", n, lcnt)                    // show n and pcp prime pairs count
  fmt.Printf("[%d, %d]\n", lhr[0],n-lhr[0])            // show first pcp prime pair of n
  fmt.Printf("[%d, %d]\n", lhr[lcnt-1], n-lhr[lcnt-1]) // show last  pcp prime pair of n
}

func main() {
  s := os.Args[1]
  num := strings.Replace(s, "_", "", -1)
  n, err := strconv.ParseUint(num, 10, 64)
  if err != nil {panic(err)}

  ts := time.Now()
  prime_pairs_lohi(uint(n))
  te := time.Now()
  fmt.Printf("%v",te.Sub(ts))
}

Here is the super optimized Rust version, that leaves everything else in its dust.

/*
   Rust 1.84.1
   Can compile as: $ cargo build --release
   or: $ RUSTFLAGS="-C opt-level=3 -C debuginfo=0 -C target-cpu=native" cargo build --release
   Run as: $ ./prime_pairs_lohi 123_456
*/

use std::time::Instant;

struct SetDiff<'a> {
  r1: &'a [u32],
  r2: &'a [u32],
}

impl<'a> SetDiff<'a> {
  fn adjust_pos(&mut self) {
    while !self.r1.is_empty() {
      if self.r2.is_empty() || self.r1[0] < self.r2[0] {
        break;
      } else if self.r2[0] < self.r1 [0] {
        self.r2 = &self.r2[1..];
      } else {
        self.r1 = &self.r1[1..];
        self.r2 = &self.r2[1..];
  } } }

  fn new(r1: &'a [u32], r2: &'a [u32]) -> Self {
    let mut s = SetDiff{ r1, r2 };
    s.adjust_pos();
    s
} }

impl<'a> Iterator for SetDiff<'a> {
  type Item = u32;

  fn next(&mut self) -> Option<Self::Item> {
    let val = self.r1.get(0).copied();
    if val.is_some() {
      self.r1 = &self.r1[1..];
    }
    self.adjust_pos();
    return val
} }

fn coprime(mut m: u32, mut n: u32) -> bool {
  while m|1 != 1 { let t = m; m = n % m; n = t }
  m > 0
}

fn prime_pairs_lohi(n : u32) {               // for u32 input values
  if n&1 == 1 || n < 4 { return println!("Input not even n > 2"); }
  if n <= 6 { return println!("[{}, {}]\n[{}, {}]\n[{}, {}]",n,1,n/2,n/2,n/2,n/2); };

  // generate the low-half-residues (lhr) r < n/2
  let (ndiv2, rhi) = (n/2, n-2);             // lhr:hhr midpoint, max residue limit
  let mut lhr: Vec<u32> = (3..ndiv2).step_by(2).filter(|&r| coprime(r, n)).collect();

  // identify and store all powers and cross-products of the lhr members < n-2
  let mut lhr_del = Vec::with_capacity(lhr.len() as usize); // lhr multiples, not part of a pcp
  for i in 1..lhr.len()-1 {                  // iterate thru lhr to find prime multiples
    let (mut j, r) = (i, lhr[i-1]);          // for current residue
    let rmax = rhi / r;                      // ri can't multiply r with values > this
    if r < rmax { lhr_del.push(if r*r < ndiv2 {r*r} else {n - r*r} ); } // for r^2 multiples
    if lhr[i] > rmax { break }               // exit if product of consecutive r’s > n-2
    while lhr[j] <= rmax {                   // stop for r if cross-product with ri > n-2
      lhr_del.push(if r*lhr[j] < ndiv2 {r*lhr[j]} else {n - r*lhr[j]}); // store value if < n-2
      j += 1;                                // get next lhr value
  } }

  lhr_del.sort_unstable();                   // remove from lhr its lhr mults, pcp remain
  let lhr: Vec<u32> = SetDiff::new(&lhr, &lhr_del).collect();
  let lcnt = lhr.len();                      // number of pcp prime pairs
  println!("[{}, {}]", n, lcnt);             // show n and pcp prime pairs count
  println!("[{}, {}]", lhr[0],n-lhr[0]);     // show first pcp prime pair of n
  println!("[{}, {}]", lhr[lcnt-1], n-lhr[lcnt-1]); // show last  pcp prime pair of n
}

fn main() {
  let n: u32 = std::env::args()
    .nth(1).expect("missing count argument")
    .replace('_', "").parse().expect("one input");

  let start = Instant::now();
  prime_pairs_lohi(n);
  println!("{:?}", start.elapsed());
}

I’ve released the latest|final version of the paper. I replaced all the Ruby code with Crystal versions, for speed and coding flexibility. The paper includes all the Crystal source code to all the routines used to generate the data that anyone can run for themselves. I also included fast|mem efficient versions to extend the numerical range that can be processed.

I’ve expanded it from 16 to 20 pages, and added 3/4 new sections. I also did complete numerical tests for n up to at least 10^12 for the bounds checks in the paper, to confirm their validity as n increases.

I’ve addressed as many issues and questions people asked|raised in other forums, and the paper should now be much clearer.

My paper: Proof of Goldbach’s Conjecture and Bertrand’s Postulate Using Prime Generator Theory (PGT) was just published in the International Journal of Mathematics and Computer Research (IJMCR), with all the Crystal code in it.

3 Likes

You are aware that the IJMCR is generally considered what’s called a predatory journal?

They seem like authentic journals, but they just take the processing fee, skip most of the review process and publish nearly anything that doesn’t look like total nonsense.

I’m truly sorry that you paid money for publishing there.

I am only responding to this so that people reading this in the future will have an objective basis to evaluate this statement.

The International Journal of Mathematics and Computer Research (IJMCR) is a respected open access journal based in India. This is what they say they are on their website.

IJMCR is an international journal which provides a plateform to scientist and researchers all over the world for the dissemination of knowledge in computer science , mathematical sciences and related fields.

I was only charged a nominal processing fee (< $100 USD), which is far, far below the $1000+ fee what so-called “respected” journals like Journal of Number Theory (JNT) wants to charge just to have your paper peer reviewed.

In fact, they send out call for papers on a regular basis requesting authors to submit their research for review, which they did to me for this paper. In fact, this is the second paper I’ve published with them this year (2025), with the other published in Jan 2025.

It is unfortunate @Hadeweka feels a need to smear this journal with ambiguous unsupported claims, but people can now do their own evaluations and research, and make their own assessments, and come to their own conclusions.

I still highly advocate for closing this thread completely, because it has long diverged from being a thread about Crystal.

But until this is done, let’s do another lesson about predatory journals.

There are several criteria on how to identify a predatory journal. A good comprehensive document is here:

jzakiya claims that the journal is a “respected open access journal based in India”, so let’s have a look at some of the points:

The publisher copies “authors guidelines” verbatim (or with minor
editing) from other publishers.

This is already quite interesting. Under “Author Guideline”, the website mysteriously mentions “Clinical papers” and “Case reports”. I though this was supposed to be a journal about mathematics and computer research? Why does it have the author guidelines from the International Journal of Medical Science in clinical Research and Review, for example, down to the name of the example citation? Lazy at best. Somebody clearly didn’t look at this.

Have a “contact us” page that only includes a web form or an email
address, and the publisher hides or does not reveal its location.

Check.

The publisher has poorly maintained websites, including dead links,
prominent misspellings and grammatical errors on the website.

“Origional research papers” right on the FRONT PAGE. Didn’t even take me a full minute to find this. Oh, and just look at the low-res logo. And most of the big buttons on the FRONT PAGE don’t even work either, but this might be from my side only.

Demonstrates a lack of transparency in publishing operations.

The link to “Submission Policy” does virtually nothing.

The publisher does not use standard identifiers such as ISSNs or DOIs
or uses them improperly.

An ISSN exists, but the direct link is dead and using the ISSN portal also leads to a dead link. Very unprofessional, isn’t it?

The publisher copies or egregiously mimics journal titles from other
publishers.

There are several other journals with the same abbreviation.

There is little or no geographical diversity among the editorial board
members, especially for journals that claim to be international in scope
or coverage.

Somewhat true, most editorial board members are from India, although there is some diversity.

None of the members of a particular journal’s editorial board have ever
published an article in the journal.

Feel free to check this for yourself, I couldn’t find any contradicting example yet. Would certainly be interesting to know if the editorial board members are aware of their role.

Evidence exists showing that the editor and/or review board members
do not possess academic expertise to reasonably qualify them to be
publication gatekeepers in the journal’s field.

Two or more journals have duplicate editorial boards (i.e., same
editorial board for more than one journal).

Well, some of the editorial board members are in the editorial boards of other completely unrelated journals. Did you know that many members of their board are also working for the “Engineering and Technology Journal”? Some even from different countries! What a coincidence!

Provide minimal or no copyediting or proofreading of submissions.

Just look at this mess:

Did nobody bother to do some editing on this to at least make it look HALF decent? Very unprofessional, again.

Publish papers that are not academic at all, e.g. essays by laypeople,
polemical editorials, or obvious pseudo-science.

This is no contribution to science at all. Any PhD student of numerical simulations should be able to develop something like this on an afternoon.


Final verdict: Almost certainly a predatory journal. At the VERY least extremely sloppy and unprofessional, but copying whole editorial boards from other journals is pretty convincing evidence for something HIGHLY suspect.

Again, I’m sorry for any person who spent money on this.

3 Likes

All the information has been exposed, it is indeed past the time we proceed to close the thread.

if the people involved or moderators think this is wrong, DM me.

7 Likes