cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A059170 Strictly undulating primes (digits alternate and differ by 1).

Original entry on oeis.org

2, 3, 5, 7, 23, 43, 67, 89, 101, 787, 32323, 78787, 1212121, 323232323, 989898989, 12121212121, 32323232323, 787878787878787878787, 787878787878787878787878787, 1212121212121212121212121212121212121212121
Offset: 1

Views

Author

N. J. A. Sloane, Feb 14 2001

Keywords

Comments

Of form ababa... with |a-b| = 1.
The next two terms have 95 and 139 digits respectively. - Jayanta Basu, May 09 2013

References

  • 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.

Crossrefs

Programs

  • 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 *)

Extensions

Extended by Patrick De Geest, Feb 25 2001
Offset corrected by Arkadiusz Wesolowski, Sep 13 2011