Skip to content

Instantly share code, notes, and snippets.

@Hermann-SW
Last active February 25, 2026 04:35
Show Gist options
  • Select an option

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

Select an option

Save Hermann-SW/ffc3d818a2867e9e40bdeeedc022bfea to your computer and use it in GitHub Desktop.
3710 decimal digits Carmichael number from 1989 Dubner paper table 1
\\ 3710 decimal digits Carmichael number from 1989 Dubner paper table 1:
\\ https://www.ams.org/journals/mcom/1989-53-187/S0025-5718-1989-0969484-8/S0025-5718-1989-0969484-8.pdf
\\
T=47#/2;A=41;C=141847;M=(T*C-1)^A/4;P=6*M+1;Q=12*M+1;X=123165;R=1+(P*Q-1)/X;
N=P*Q*R;
\\ known partial N-1 factorization: https://www.mersenneforum.org/node/1106127
{F=[2,41;3,1;11,1;13,1;19,1;29,1;31,1;37,1;41,2;43,1;47,1;59,41;79,41;83,1;
1709,1;3527,1;3691,1;16943,1;469793,41;1799411527,1;3463701403,1;
731646295847,1;9957992526379,41;677868618879887,1;278798236535678281,1;
61534897980248555544581,1;9929897004627382451681972907710143,1];}
f=vecprod([f[1]^f[2]|f<-F~]);
print(((N-1)%f)" ",#digits(f)" ",#digits((N-1)/f));
@Hermann-SW
Copy link
Author

@Hermann-SW
Copy link
Author

Hermann-SW commented Feb 23, 2026

Unclear why isprime(R) does take so much longer than factorint(R), which identifies R as squarefree and having single prime factor, so R is prime:
==> factorint does pseudoprime test only

hermann@7950x:~$ gp -q 3710.gp 
? #
   timer = 1 (on)
? F=factorint(R);
cpu time = 128 ms, real time = 128 ms.
? #digits(R)
1853
? isprime(R)
cpu time = 16min, 44,590 ms, real time = 1min, 59,408 ms.
1
? #F~[,1]
1
? #F[1,2]
1
? F[1,1]==R
1
? isprime(Q)
cpu time = 79 ms, real time = 79 ms.
1
? isprime(P)
cpu time = 79 ms, real time = 79 ms.
1
? kronecker(5,N)
-1
? N==P*Q*R
1
? lift(Mod(5,N)^(N-1))
cpu time = 223 ms, real time = 223 ms.
1
? 

@Hermann-SW
Copy link
Author

Hermann-SW commented Feb 23, 2026

Trying to factor N-1 leaves 3283 decimal digits composite number ...

hermann@7950x:~$ gp -q 3710.gp
? forprime(p=2,10^8,if((N-1)%p==0,print1(p"^"valuation((N-1),p)"*")))
2^41*3^1*11^1*13^1*19^1*29^1*31^1*37^1*41^2*43^1*47^1*59^41*79^41*83^1*1709^1*3527^1*3691^1*16943^1*469793^41*
? ##
  ***   last result: cpu time 3,371 ms, real time 3,371 ms.
? D=2^41*3^1*11^1*13^1*19^1*29^1*31^1*37^1*41^2*43^1*47^1*59^41*79^41*83^1*1709^1*3527^1*3691^1*16943^1*469793^41;
? (N-1)%D
0
? M=(N-1)/D;
? #digits(M)
3283
? isprime(M)
0
?

@Hermann-SW
Copy link
Author

From Mersenne forum thread linked to in gist, 1,080 decimal digits partial factorization F is known.
The remainder is product of 836 and 1,795 decimal digit composite numbers.

$ gp -q < 3710.gp 
0 1080 2630
$ 

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