OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..140
EXAMPLE
The second term is 3 because 23 is prime [concatenation of the difference (3-1) and 3]. The third term is 7 because 47 is prime [concatenation of the difference (7-3) and 7]. The next term is 9 because 29 is prime [concatenation of the difference (9-7) and 9]. And so on. The next term is always the smallest available.
MAPLE
S2:= proc(n) option remember; local a, d;
if n=1 then 1
else a:= S2(n-1);
for d while not isprime(parse(cat(d, a+d)))
do od; a+d
fi
end:
seq(S2(n), n=1..60);
MATHEMATICA
nxt[n_]:=Module[{k=n+2}, While[!PrimeQ[(k-n)*10^IntegerLength[k]+k], k+=2]; k]; NestList[nxt, 1, 60] (* Harvey P. Dale, Jun 30 2025 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alois P. Heinz and Eric Angelini, Nov 25 2010
STATUS
approved
