OFFSET
1,2
COMMENTS
Numbers n such that 53197 * (10^(5*m)-1)/99999 + (53197 mod 10^(n mod 5))*10^(5*m) is prime, where m = floor(n/5). - Max Alekseyev, Nov 11 2012
EXAMPLE
a(1) = 1 because 7 is prime and 7 has 1 digits.
a(2) = 2 because 97 is prime and 97 has 2 digits.
a(3) = 3 because 197 is prime and 197 has 3 digits.
MATHEMATICA
s = 0; Do[s = s + 10^n*Switch[ Mod[n, 5], 2, 1, 3, 3, 4, 5, 0, 7, 1, 9]; If[ PrimeQ[s], Print[n + 1]], {n, 0, 3000}] (* Robert G. Wilson v, Feb 10 2004 *)
Position[Table[FromDigits[PadLeft[{}, n, {5, 3, 1, 9, 7}]], {n, 1200}], _?PrimeQ]// Flatten (* Harvey P. Dale, Mar 30 2019 *)
PROG
(PARI) test7(n)= s=0; for(i=0, n, if(Mod(i, 5)==0, s=s+7*10^i, if(Mod(i, 5)==1, s=s+9*10^i, if(Mod(i, 5)==2, s=s+1*10^i, if(Mod(i, 5)==3, s=s+3*10^i, if(Mod(i, 5)==4, s=s+5*10^i, )))))); return(s);
for(j=0, 1000, if(isprime(test7(j)), print1(j+1, ", "))) \\ corrected by Michael S. Branicky and Michel Marcus, May 28 2023
CROSSREFS
KEYWORD
hard,nonn,base,more,less
AUTHOR
mohammed bouayoun (bouyao(AT)wanadoo.fr), Feb 03 2004
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Feb 10 2004
Offset changed to 1 and a(14)-a(17) from Michael S. Branicky, May 28 2023
a(18) from Michael S. Branicky, Aug 03 2024
STATUS
approved