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!)
A066811 Numbers k such that the concatenation of odd numbers from 1 to k is a prime. 3

%I #19 Mar 19 2021 10:42:48

%S 3,19,31,67,97,5139

%N Numbers k such that the concatenation of odd numbers from 1 to k is a prime.

%F a(n) = 2*A046036(n) - 1. - _Michel Marcus_, Jan 31 2014

%e 19 is a term because 135791113151719 is a prime.

%t p = ""; Do[p = p <> ToString[2*n+1]; If[PrimeQ[ToExpression[p]], Print[2*n+1]], {n, 0, 2569}] (* _Ryan Propper_, Aug 26 2005 *)

%o (Python)

%o from sympy import isprime

%o def agen():

%o k, str1tok = 1, '1'

%o while True:

%o if isprime(int(str1tok)): yield k

%o k, str1tok = k + 2, str1tok + str(k + 2)

%o g = agen()

%o print([next(g) for i in range(5)]) # _Michael S. Branicky_, Mar 19 2021

%Y Cf. A000040, A005408, A048847.

%K base,nonn

%O 1,1

%A _Patrick De Geest_, Jan 20 2002

%E a(6) from _Ryan Propper_, Aug 26 2005

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 25 08:27 EDT 2024. Contains 371964 sequences. (Running on oeis4.)