A087594 Define dd(n) = the number formed by concatenating the absolute difference of successive digits. Sequence contains primes p such that dd(p)=q is a prime, dd(q) is also a prime = r and so on until a single-digit prime (2,3,5,7) arises. (Primes in which the number formed by successive digit differences are primes at every step until a single-digit prime is obtained.).
13, 29, 31, 41, 47, 53, 61, 79, 83, 97, 103, 113, 163, 227, 229, 331, 347, 367, 401, 449, 487, 503, 521, 523, 541, 547, 557, 563, 569, 587, 601, 661, 709, 743, 769, 821, 823, 881, 883, 907, 941, 947, 967, 997, 1063, 1069, 1103, 1163, 1481, 1609, 1621, 1663
Offset: 0
Examples
29 is a member as absolute(2-9) = 7 is a prime. 347 is a member as dd(347) = 13, dd(13) = 2.
Links
- Harvey P. Dale, Table of n, a(n) for n = 0..1000
Programs
-
Mathematica
adsd[n_]:=FromDigits[Abs/@Differences[IntegerDigits[n]]]; Select[Prime[ Range[ 300]], And@@PrimeQ[NestWhileList[adsd,adsd[#],IntegerLength[#]>1&]]&] (* Harvey P. Dale, Mar 16 2013 *)
Extensions
More terms from David Wasserman, Jun 15 2005
Comments