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”).

A243294
Least number k > 1 such that a number composed of k consecutive ascending digits starting with n is prime.
0
171, 2, 179, 4, 29, 2, 5, 2, 13
OFFSET
1,1
COMMENTS
After the digit 9 comes 0 and it repeats.
If k could equal 1, the sequence becomes {171, 1, 1, 4, 1, 2, 1, 2, 13}.
It is interesting that when n is prime, a(n) is prime.
EXAMPLE
78 is not prime. 789 is not prime. 7890 is not prime. 78901 is prime. Thus a(7) = 5 since 78901 is a 5-digit number.
PROG
(Python)
import sympy
from sympy import isprime
def a(n):
num = str(n)
for i in range(n+1, 10**3):
num += str(i%10)
if isprime(int(num)):
return len(num)
n=1
while n < 10:
print(a(n), end=', ')
n+=1
(PARI) a(n) = {s = Str(n); i = n+1; while (1, if (i==10, i = 0); s = concat(s, i); i++; if (isprime(eval(s)), return (length(s))); ); } \\ Michel Marcus, Jun 04 2014
CROSSREFS
Cf. A120821.
Sequence in context: A114048 A187704 A263059 * A015975 A292090 A186871
KEYWORD
nonn,base,full,fini
AUTHOR
Derek Orr, Jun 02 2014
STATUS
approved