login
A059170
Strictly undulating primes (digits alternate and differ by 1).
2
2, 3, 5, 7, 23, 43, 67, 89, 101, 787, 32323, 78787, 1212121, 323232323, 989898989, 12121212121, 32323232323, 787878787878787878787, 787878787878787878787878787, 1212121212121212121212121212121212121212121
OFFSET
1,1
COMMENTS
The next two terms have 95 and 139 digits respectively. [Jayanta Basu, May 09 2013]
REFERENCES
Of form ababa... with |a-b| = 1.
C. A. Pickover, "Keys to Infinity", Wiley 1995, pp. 159-160.
C. A. Pickover, "Wonders of Numbers", Oxford New York 2001, Chapter 52, pp. 123-124, 316-317.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..25 (* All terms with less than 1000 digits. *)
C. A. Pickover, "Wonders of Numbers, Adventures in Mathematics, Mind and Meaning," Zentralblatt review
MATHEMATICA
a[n_]:=DeleteDuplicates[Take[IntegerDigits[n], {1, -1, 2}]]; b[n_]:=DeleteDuplicates[Take[IntegerDigits[n], {2, -1, 2}]]; t={}; Do[p=Prime[n]; If[p<10, AppendTo[t, p], If[Length[a[p]] == Length[b[p]] == 1 && Abs[a[p][[1]]-b[p][[1]]] == 1, AppendTo[t, p]]], {n, 10^5}]; t (* Jayanta Basu, May 08 2013 *)
t1=Join[{2, 3, 5, 7}, Select[Range[10, 100], PrimeQ[#]&&Abs[Differences[IntegerDigits[#]]]=={1}&]]; Do[a=n*10+(n-1); b=(n-1)*10+n; t1=Join[t1, Select[Table[(a*10^(2*n+1)-b)/99, {n, 25}], PrimeQ]]; If[n<=7, c=n*10+(n+1); d=(n+1)*10+n; t1=Join[t1, Select[Table[(c*10^(2*n+1)-d)/99, {n, 25}], PrimeQ]]], {n, 1, 9, 2}]; Sort[t1] (* Jayanta Basu, May 09 2013 *)
With[{c=Flatten[{#, Reverse[#]}&/@Table[{a, a+1}, {a, 0, 8}], 1]}, Flatten[ Select[ Table[ FromDigits[PadRight[{}, n, #]], {n, 50}], PrimeQ]&/@c]]//Union (* Harvey P. Dale, Aug 20 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Feb 14 2001
EXTENSIONS
Extended by Patrick De Geest, Feb 25 2001
Offset corrected by Arkadiusz Wesolowski, Sep 13 2011
STATUS
approved