%I #17 May 28 2023 11:21:35
%S 2,58,64,81,5671,7234,18999
%N Consider numbers of the form ...31975319753197531, whose digits read from the right are 1,3,5,7,9,1,3,5,7,9,1,... Sequence gives lengths of these numbers which are primes.
%C No further terms below 5456.  _Robert G. Wilson v_, Feb 18 2004
%C Approximately 1/3rd of numbers of the form described in the definition have a digit sum which is a multiple of 3 and therefore they are not prime numbers and do not have to be otherwise tested for prime status. The indices (i.e., integer lengths) of the first few such numbers are 3, 11, 12, 14, 15, 18, 26, 27, 29, 30, 33, 41, 42, 44, 45, 48, 56, 57, . . . Those indices appear to satisfy a linear recurrence having signature (1, 0, 0, 0, 1, 1) and can also be derived from the expansion of g.f. = (3+8*x+x^2+2*x^3+x^4)/((1+x)^2*(1+x+x^2+x^3+x^4)).  _Harvey P. Dale_, Dec 02 2018
%e 1 is not a prime; 31 is a 2digit prime, so 2 is a member.
%e 531 is not prime, 7531 is not prime, 97531 is not prime, 197531 is not prime.
%e a(2)=58 because 5319753197531975319753197531975319753197531975319753197531 is prime and has 58 digits.
%t s = 0; Do[s = s + 10^n*Switch[ Mod[n, 5], 0, 1, 1, 3, 2, 5, 3, 7, 4, 9]; If[ PrimeQ[s], Print[n + 1]], {n, 0, 2500}] (* _Robert G. Wilson v_, Feb 19 2004 *)
%t IntegerLength/@(Select[FromDigits/@Table[PadLeft[{},n,{9,7,5,3,1}],{n,100}],PrimeQ]) (* _Harvey P. Dale_, Nov 30 2018 *)
%o (PARI) test1(n)= s=0;for(i=0,n,\ if(Mod(i,5)==0,s=s+1*10^i,\ if(Mod(i,5)==1,s=s+3*10^i,\ if(Mod(i,5)==2,s=s+5*10^i,\ if(Mod(i,5)==3,s=s+7*10^i,\ if(Mod(i,5)==4,s=s+9*10^i,\ )))))); return(s); for(j=0,2000,if(isprime(test1(j)),print(j+1),print1(".")))
%Y Cf. A090744, A090745, A090746.
%K hard,nonn,base
%O 1,1
%A mohammed bouayoun (bouyao(AT)wanadoo.fr), Feb 03 2004
%E a(5)a(7) from _Michael S. Branicky_, May 27 2023
