login
A089316
Prime worms [successive digit differences with absolute value of 2].
2
131, 313, 353, 757, 797, 35353, 35753, 75797, 79757, 97579, 3131353, 3135313, 3531313, 7535797, 313131353, 313135313, 313579753, 353535313, 357531313, 357531353, 357535753, 357575753, 357975353, 753535357, 757975357, 975353579
OFFSET
0,1
LINKS
Carlos Rivera, Puzzle 246. The worm, The Prime Puzzles and Problems Connection.
FORMULA
Select prime numbers having the same first and last digits; if the uniform absolute value of successive digit differences is 2, add to sequence.
EXAMPLE
a(4)=797; first and last digits are 7; abs(7-9)=2; abs(9-7)=2; the worm is 7.
MATHEMATICA
pwQ[n_]:=Module[{idn=IntegerDigits[n]}, First[idn]==Last[idn]&&Union[Abs[ Differences[idn]]]=={2}]; Select[Prime[Range[50000000]], pwQ] (* Harvey P. Dale, Mar 26 2013 *)
CROSSREFS
Cf. A089291.
This is a subset of A048399. Cf. A089291, A089315, A089317, A048398-A048405.
Sequence in context: A132249 A033548 A117477 * A242846 A142129 A068680
KEYWORD
easy,nonn,base
AUTHOR
Enoch Haga, Dec 25 2003
STATUS
approved