login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A153332 Numbers k such that (10^k - 1)*150/99 + 1 is prime. 0

%I #23 Dec 14 2021 00:39:47

%S 2,14,62,88,244,582,1790,2122,7232

%N Numbers k such that (10^k - 1)*150/99 + 1 is prime.

%C These numbers are always even. If k is odd, then 10^k - 1 produces a number with an odd number of 9's which 99 does not divide. Also the numbers produced by this formula are palindromic.

%e For the first entry, k=2, the formula produces the prime 151.

%t 2*Floor[IntegerLength[#]/2]&/@Select[Table[FromDigits[Join[{1}, PadRight[ {},2n,{5,1}]]],{n,1000}],PrimeQ] (* _Harvey P. Dale_, Jun 27 2012 *)

%o (PARI) /* n=number of values to test, r=repeat digits, e.g., 14, 121, 177, 1234, etc.

%o d = last digit appended to the end */

%o repr(n,r,d) = ln=length(Str(r));for(x=0,n,y=(10^(ln*x)-1)*10*r/(10^ln-1)+1;if(ispseudoprime(y),print1(ln*x",")))

%o (Python)

%o from sympy import isprime

%o def afind(limit, startk=2):

%o k = startk + (startk%2)

%o t = int("1" + "51"*(k//2))

%o for k in range(startk, limit+1, 2):

%o if isprime(t): print(k, end=", ")

%o t *= 100

%o t += 51

%o afind(600) # _Michael S. Branicky_, Dec 13 2021

%K nonn,base,hard,more

%O 1,1

%A _Cino Hilliard_, Dec 23 2008

%E a(7) provided by _Harvey P. Dale_, Jun 27 2012

%E Offset edited and a(8)-a(9) from _Michael S. Branicky_, Dec 13 2021

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 04:14 EDT 2024. Contains 371918 sequences. (Running on oeis4.)