OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
The second term is 2 because 11 is prime [concatenation of 1 and the difference (2-1)]. The third term is 5 because 23 is prime [concatenation of 2 and the difference (5-2)]. The next term is 8 because 53 is prime [concatenation of 5 and the difference (8-5)]. And so on. The next term is always the smallest available.
MAPLE
S1:= proc(n) option remember;
local a, d;
if n=1 then 1
else a:= S1(n-1);
for d while not isprime(parse(cat(a, d)))
do od;
a+d
fi
end:
seq(S1(n), n=1..60); # Alois P. Heinz, Nov 25 2011
MATHEMATICA
con[n_]:=Module[{k=n+1, idn=IntegerDigits[n]}, While[!PrimeQ[FromDigits[Join[idn, IntegerDigits[ k-n]]]], k++]; k]; NestList[con, 1, 60] (* Harvey P. Dale, May 17 2023 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Nov 25 2010
STATUS
approved