login
Smallest prime with concatenation of first n even numbers as leading digits.
2

%I #26 Mar 19 2024 22:34:40

%S 2,241,2467,24683,2468101,246810121,24681012149,24681012141601,

%T 2468101214161811,246810121416182039,24681012141618202211,

%U 2468101214161820222441,246810121416182022242641,246810121416182022242628043,24681012141618202224262830073

%N Smallest prime with concatenation of first n even numbers as leading digits.

%C a(350) has 1001 digits. - _Michael S. Branicky_, Mar 19 2024

%H Michael S. Branicky, <a href="/A068838/b068838.txt">Table of n, a(n) for n = 1..349</a> (terms 1..300 from _Harvey P. Dale_ with corrections to terms 1..175 by _Sean A. Irvine_ and corrections in 176..300 by _Michael S. Branicky_)

%o (Python)

%o from sympy import isprime

%o from itertools import count

%o def a(n):

%o if n == 1: return 2

%o prefix = int("".join(map(str, (2*i for i in range(1, n+1)))))

%o for extra in count(1):

%o prefix *= 10

%o for i in range(10**extra):

%o t = prefix + i

%o if isprime(t): return t

%o print([a(n) for n in range(1, 16)]) # _Michael S. Branicky_, Mar 19 2024

%K nonn,base

%O 1,1

%A _Amarnath Murthy_, Mar 09 2002

%E More terms from _Benoit Cloitre_, Mar 10 2002

%E Corrected by _T. D. Noe_, Nov 15 2006

%E Corrected and extended by _Jayanta Basu_, Aug 09 2013

%E Data corrected by _Sean A. Irvine_, Mar 19 2024