login
Consider numbers of the form ...53197531975319753, whose digits read from the right are 3,5,7,9,1,3,5,7,9,1,3,... Sequence gives lengths of these numbers that are primes.
3

%I #21 Apr 04 2019 22:47:54

%S 1,2,5,26,1932,13422,16971

%N Consider numbers of the form ...53197531975319753, whose digits read from the right are 3,5,7,9,1,3,5,7,9,1,3,... Sequence gives lengths of these numbers that are primes.

%C a(5) - Fermat and Lucas PRP! Tested with pfgw64 with switch -tc. - _Marek Hubal_, Mar 04 2019

%C a(6) - Fermat and Lucas PRP! Tested with pfgw64 with switch -tc. a(7) > 32000. - _Marek Hubal_, Mar 06 2019

%e a(1)=1 because 3 is prime and 3 has 1 digit.

%e a(2)=2 because 53 is prime and 53 has 2 digits.

%e a(3)=5 because 19753 is prime and 19753 has 5 digits.

%t s = 0; Do[s = s + 10^n*Switch[ Mod[n, 5], 4, 1, 0, 3, 1, 5, 2, 7, 3, 9]; If[ PrimeQ[s], Print[n + 1]], {n, 0, 3000}] (* _Robert G. Wilson v_, Feb 19 2004 *)

%o (PARI) test3(n)= s=0; for(i=0, n, if(Mod(i,5)==0,s=s+3*10^i, if(Mod(i,5)==1,s=s+5*10^i, if(Mod(i,5)==2,s=s+7*10^i, if(Mod(i,5)==3,s=s+9*10^i, if(Mod(i,5)==4,s=s+1*10^i, )))))); return(s);

%o for(j=0, 1000, if(isprime(test3(j)), print1(j+1, ", ")));

%K hard,nonn,base,more

%O 1,2

%A Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Feb 03 2004

%E a(4) from _Robert G. Wilson v_, Feb 10 2004

%E a(5) from _Marek Hubal_, Mar 04 2019

%E a(6) from _Marek Hubal_, Mar 06 2019