A123568 Prime numbers of the form (10^n - 7)/3.
31, 331, 3331, 33331, 333331, 3333331, 33333331, 333333333333333331, 3333333333333333333333333333333333333331, 33333333333333333333333333333333333333333333333331
Offset: 1
Keywords
Examples
a(7) = 33333331 because that is the seventh number of the specified form to be prime. 333333331 is not in the sequence because it is composite, being the product of 17 and 19607843.
References
- Simon Singh, Fermat's Enigma. New York: Walker & Company (1997) p. 159.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..17
Programs
-
Mathematica
Do[If[PrimeQ[(10^n - 7)/3], Print[(10^n - 7)/3]], {n, 1, 100}] (* Jasinski *) Select[(10^Range[50] - 7)/3, PrimeQ[#] &] (* Alonso del Arte, Nov 11 2012 *) Select[Table[FromDigits[PadLeft[{1},n,3]],{n,50}],PrimeQ] (* Harvey P. Dale, Dec 05 2018 *)
-
PARI
select(ispseudoprime, vector(20, n, (10^n-7)/3)) \\ Charles R Greathouse IV, Nov 12 2012
Comments