Skip to content

Instantly share code, notes, and snippets.

@Hermann-SW
Created January 16, 2026 16:54
Show Gist options
  • Select an option

  • Save Hermann-SW/14c7c7c6acd1f69f8dc36e51af1fdb3a to your computer and use it in GitHub Desktop.

Select an option

Save Hermann-SW/14c7c7c6acd1f69f8dc36e51af1fdb3a to your computer and use it in GitHub Desktop.
Compute number of primes of form x^2 + x + A for x <= 10^11 (for Jacobson and Williams A = 3399714628553118047)
export(A=3399714628553118047); a(n)=parsum(k=0, 10^n, isprime(k^2+k+A));
default(threadsizemax,1000*10^6); \\ default 8MB was too small
#
print(a(11));
@Hermann-SW
Copy link
Author

Started on 192C/384T Lenovo x3950-X6 8-socket server with Intel Xeon 8890v4 CPUs with

nohup numactl -C 0-191 gp -q < a11.3399714628553118047.gp 

this was longest such computation for x≤10¹¹ sequences mostly from oeis.org sofar.
a(11)=22066543923 was computed in 27:10h real time, and 215.55 days total time:

hermann@x3950-X6:~$ cat nohup.out
   timer = 1 (on)
22066543923
cpu time = 5215h, 10min, 39,011 ms, real time = 27h, 10min, 3,006 ms.
hermann@x3950-X6:~$ 
hermann@x3950-X6:~$ stat nohup.out
  File: nohup.out
  Size: 122       	Blocks: 8          IO Block: 4096   regular file
Device: 8,2	Inode: 144770244   Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/ hermann)   Gid: ( 1000/ hermann)
Access: 2026-01-17 00:52:24.273924746 +0100
Modify: 2026-01-16 23:14:07.194919374 +0100
Change: 2026-01-16 23:14:07.194919374 +0100
 Birth: 2026-01-15 20:04:03.993695686 +0100
hermann@x3950-X6:~$ 

@Hermann-SW
Copy link
Author

Hermann-SW commented Jan 17, 2026

Michael J. Jacobson, Jr.,
Computational techniques in quadratic fields,
Master’s thesis, University of Manitoba, Winnipeg, Manitoba, 1995.

Michael J. Jacobson Jr. and Hugh C. Williams,
New Quadratic Polynomials With High Densities Of Prime Values,
Math. Comp., 72, 241, 499-519, 2002.

Number of primes of the form x^2 + x + A for x <= 10^n, with A=3399714628553118047 from Jacobson:

 n        a(n)
-- -----------
 0           1
 1           5
 2          24
 3         235
 4        2482
 5       25034
 6      251841
 7     2517022
 8    25153819
 9   251014697
10  2408242218
11 22066543923

a(11) is 1.61412× bigger than a(11) for A=41 (Euler polynomial primes),
and 5.35848× bigger than number of "normal" primes up to 10¹¹.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment