A078728 a(n) is the smallest m such that m < 10^n, 10^n + m is prime and if the natural number k is such that 1 < k < 10 and 3 doesn't divide k*10^n + m then k*10^n+m is prime.
3, 57, 297, 177, 237, 25111, 231339, 67419, 273817, 345111, 2001753, 912277, 5236153, 9228627, 10599391, 2835261, 60120003, 14054037, 27923629, 41783347, 24590943, 112161513, 230484021, 11446969, 205242589, 583389307, 873650007
Offset: 1
Keywords
Examples
a(6)=25111 because all the six numbers 1025111, 3025111, 4025111, 6025111, 7025111, 9025111 are primes and 25111 is the smallest number with this property.
Links
- Carlos Rivera, Puzzle 245. As 13
Programs
-
Mathematica
a[n_] := (For[m=1, !PrimeQ[10^n+2m-1]||!PrimeQ[(Mod[2m-1, 3]+2)10^n+2m-1]||! PrimeQ[4*10^n+2m-1]||!PrimeQ[(Mod[2m-1, 3]+5)10^n+2m-1]||!PrimeQ [7*10^n+2m-1]||!PrimeQ[(Mod[2m-1, 3]+8)10^n+2m-1], m++ ];2m-1); Do[Print[a[n]], {n, 32}]
Formula
a[n_] := (For[m=1, !PrimeQ[10^n+2m-1]||!PrimeQ[(Mod[2m-1, 3]+2)10^n+2m-1]||! PrimeQ[4*10^n+2m-1]||!PrimeQ[(Mod[2m-1, 3]+5)10^n+2m-1]||!PrimeQ [7*10^n+2m-1]||!PrimeQ[(Mod[2m-1, 3]+8)10^n+2m-1], m++ ];2m-1)
Comments