login
Primes arising in A069607.
0

%I #8 Jan 29 2014 13:37:33

%S 5,53,5323,53231,532313,5323139,532313921,5323139219,532313921921,

%T 53231392192123,5323139219212343,53231392192123433,

%U 5323139219212343323,53231392192123433237,5323139219212343323721,532313921921234332372189,53231392192123433237218937,5323139219212343323721893721

%N Primes arising in A069607.

%C a(n+1) is the next smallest prime beginning with a(n). Initial term is 5.

%e a(1) = 5.

%e a(2) is the next smallest prime that begins with 5, so a(2) = 53.

%e a(3) is the next smallest prime that begins with 53, so a(3) = 5323.

%e ...and so on.

%o (Python)

%o import sympy

%o from sympy import isprime

%o def b(x):

%o ..num = str(x)

%o ..n = 1

%o ..while n < 10**3:

%o ....new_num = str(x) + str(n)

%o ....if isprime(int(new_num)):

%o ......print(int(new_num))

%o ......x = new_num

%o ......n = 1

%o ....else:

%o ......n += 1

%o b(5)

%Y Cf. A069607, A110773, A048553.

%K nonn,base

%O 1,1

%A _Derek Orr_, Jan 27 2014