login
Define an increasing sequence as follows. Given the first term called the seed (the seed need not have the property of the sequence.). Subsequent terms are defined as obtained by inserting/placing digits (at least one) in the previous term to obtain the smallest number with a given property. This is the growing prime sequence for the seed a(1) = 3.
1

%I #8 Nov 07 2014 17:12:06

%S 3,13,103,1013,10103,100103,1001003,10010023,100010023,1000100239,

%T 10001000239,100010002039,1000100020319,10001000200319,

%U 100001000200319,1000010002000319,10000100002000319,100001000020003109,1000010000200031039,10000100002000310329

%N Define an increasing sequence as follows. Given the first term called the seed (the seed need not have the property of the sequence.). Subsequent terms are defined as obtained by inserting/placing digits (at least one) in the previous term to obtain the smallest number with a given property. This is the growing prime sequence for the seed a(1) = 3.

%C a(5) onwards the sequence is A068166.

%H Alois P. Heinz, <a href="/A068168/b068168.txt">Table of n, a(n) for n = 1..300</a>

%e The primes obtained by inserting/placing a digit in a(2) = 13 are 113,131,313 etc... a(3)= 113 is the smallest.

%p a:= proc(n) option remember; local s, w, m;

%p if n=1 then 3

%p else w:=a(n-1); s:=""||w; m:=length(s);

%p min(select(x->length(x)=m+1 and isprime(x),

%p {seq(seq(parse(cat(seq(s[h], h=1..i), j,

%p seq(s[h], h=i+1..m))), j=0..9), i=0..m)})[])

%p fi

%p end:

%p seq(a(n), n=1..23); # _Alois P. Heinz_, Nov 07 2014

%Y Cf. A068166, A068167.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Feb 25 2002

%E Corrected and extended by _Robert Gerbicz_, Sep 06 2002