login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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

%I #35 Aug 04 2024 01:30:55

%S 1,2,3,5,6,7,16,17,18,104,127,213,1143,4654,4897,17046,33424,47407

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

%C 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

%e a(1) = 1 because 7 is prime and 7 has 1 digits.

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

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

%t 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 *)

%t Position[Table[FromDigits[PadLeft[{},n,{5,3,1,9,7}]],{n,1200}],_?PrimeQ]// Flatten (* _Harvey P. Dale_, Mar 30 2019 *)

%o (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);

%o for(j=0,1000,if(isprime(test7(j)),print1(j+1, ", "))) \\ corrected by _Michael S. Branicky_ and _Michel Marcus_, May 28 2023

%Y Cf. A090743, A090744, A090746.

%K hard,nonn,base,more,less

%O 1,2

%A mohammed bouayoun (bouyao(AT)wanadoo.fr), Feb 03 2004

%E Corrected and extended by _Robert G. Wilson v_, Feb 10 2004

%E Offset changed to 1 and a(14)-a(17) from _Michael S. Branicky_, May 28 2023

%E a(18) from _Michael S. Branicky_, Aug 03 2024