%I #11 Jul 18 2015 17:53:19
%S 1,3,7,9,11,17,21,23,33,47,53,57,61,63,67,69,71,77,83,87,91,93,101,
%T 111,113,131,141,143,1007,1011,1013,1017,1019,1023,1031,1047,1051,
%U 1057,1059,1061,1083,1127,1131,1141,1143,1157,1161,1163,1169,1181,1199,1203,1229,1233,10027,10039,10051,10053,10097,10131
%N a(n+1) is the smallest integer > a(n) such that the concatenation of [a(n+1)-a(n)] and a(n+1) is a prime number.
%e 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.
%p S2:= proc(n) option remember; local a, d;
%p if n=1 then 1
%p else a:= S2(n-1);
%p for d while not isprime(parse(cat(d,a+d)))
%p do od; a+d
%p fi
%p end:
%p seq(S2(n), n=1..60);
%K nonn,base
%O 1,2
%A _Alois P. Heinz_ and _Eric Angelini_, Nov 25 2010
|