OFFSET
1,1
COMMENTS
2-pseudoprimes are also called Poulet numbers. Some Poulet number can be written in more than one way in this form: e.g. 561 = (6*2 - 1)*((6*2 - 2)*5 + 1) = (6*3 - 1)*((6*3 - 2)*2 + 1).
Few examples of how the formula looks like for k and n from 1 to 4:
For k = 1 the formula becomes 20*n + 5 and so generates all the Poulet numbers divisible by 5.
For k = 2 the formula becomes 110*n + 11 and generates the Poulet numbers 341, 561 etc.
For k = 3 the formula becomes 272*n + 17 and generates the Poulet numbers 561, 1105, 2465, 4369 etc.
For k = 4 the formula becomes 506*n + 23 and generates the Poulet numbers 2047, 6601 etc.
For n = 1 the formula generates a perfect square.
For n = 2 the formula becomes 3*(6*k - 1)*(4*k - 1) and were found the following Poulet numbers: 561 etc.
For n = 3 the formula becomes (6*k - 1)*(18*k - 5) and were found the following Poulet numbers: 341, 2465, 8321, 83333 etc.
For n = 4 the formula becomes (6*k - 1)*(24*k - 7) and were found the following Poulet numbers: 1105, 2047, 3277, 6601, 13747, 16705, 19951, 31417, 74665, 88357 etc.
Note: the formula is equivalent to Poulet numbers of the form p*(n*p - n + 1), where p is of the form 6*k - 1. From the first 68 Poulet numbers just 26 of them (1387, 2701, 2821, 4033, 4681, 5461, 7957, 8911, 10261, 13741, 14491, 18721, 23377, 29341, 31609, 31621, 33153, 35333, 42799, 46657, 49141, 49981, 57421, 60787, 63973, 65281) can’t be written as p*(n*p - n + 1), where p is of the form 6*k - 1 and k, n are integers different from 0.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Poulet Number
MATHEMATICA
t = Select[Union[Flatten[Table[(6*k - 1)*((6*k - 2)*n + 1), {k, 100}, {n, 4000}]]], # < 76000 &]; Select[t, PowerMod[2, #, #] == 2 &] (* T. D. Noe, Jul 24 2012 *)
PROG
(PARI) list(lim)=my(v=List()); for(k=1, (sqrtint(lim\1)+1)\6, forstep(m=36*k^2 - 12*k + 1, lim, 36*k^2 - 18*k + 2, if(Mod(2, m)^m==2, listput(v, m)))); Set(v) \\ Charles R Greathouse IV, Jul 05 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Marius Coman, Jul 22 2012
STATUS
approved