[go: up one dir, main page]

login
A173698
a(n+1) is the smallest integer > a(n) such that the concatenation of a(n) and [a(n+1)-a(n)] is a prime number.
1
1, 2, 5, 8, 11, 14, 23, 26, 29, 32, 49, 50, 53, 76, 77, 80, 89, 112, 115, 116, 119, 122, 125, 134, 145, 146, 167, 196, 257, 266, 269, 272, 281, 290, 293, 302, 305, 322, 323, 344, 353, 356, 373, 376, 377, 386, 389, 406, 433, 440, 449, 452, 455, 478, 481, 484, 497, 500, 503, 512
OFFSET
1,2
LINKS
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
Sequence in context: A102795 A275603 A275604 * A162938 A356447 A353985
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Nov 25 2010
STATUS
approved