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.

Showing 1-10 of 37 results. Next

A045921 Erroneous version of A032758.

Original entry on oeis.org

13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 131, 151, 191, 313, 353, 373, 757, 797, 919, 35353, 95959, 919191919, 979797979, 91919191919, 151515151515151, 737373737373737, 75757575757575757, 91919191919191919
Offset: 1

Views

Author

Keywords

A059758 Undulating palindromic primes: numbers that are prime, palindromic in base 10, and the digits alternate: ababab... with a != b.

Original entry on oeis.org

101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929, 18181, 32323, 35353, 72727, 74747, 78787, 94949, 95959, 1212121, 1616161, 323232323, 383838383, 727272727, 919191919, 929292929, 979797979, 989898989
Offset: 1

Views

Author

Jeff Heleen, Feb 11 2001

Keywords

References

  • C. A. Pickover, "Wonders of Numbers", Oxford New York 2001, Chapter 52, pp. 123-124, 316-317.
  • C. W. Trigg, Palindromic Octagonal Numbers, Journal of Recreational Mathematics, 15:1, pp. 41-46, 1982-83.

Crossrefs

Cf. A032758.

Programs

  • Maple
    for l from 3 to 31 by 2 do for i from 0 to 9 do for j from 0 to 9 do it1 := sum(i*10^(2*k), k=0..(l-1)/2): it2 := sum(j*10^(2*k+1), k=0..(l-3)/2): if isprime(it1+it2) and i<>j then printf(`%d, `,it1+it2) fi: od: od: od: # James Sellers, Feb 13 2001
  • Mathematica
    t = {}; t1 = {1, 3, 7, 9}; Do[p = 10 a + b; q = 10 b + a; t = Join[t, Select[Table[(p*10^(2 n + 1) - q)/99, {n, 4}], PrimeQ]], {a, t1}, {b, Range[0, 9]}]; Union[t] (* Jayanta Basu, Jun 23 2013 *)
    uppQ[n_]:=Module[{idn=IntegerDigits[n]},OddQ[Length[idn]]&& PalindromeQ[ n] && Length[Union[Partition[idn,2]]]==1]; Select[Prime[Range[ 51*10^6]], uppQ] (* or *) Select[FromDigits/@Flatten[Table[Riffle[Table[n,i],k],{n,{1,3,7,9}},{i,5},{k,0,9}],2],#>9&&PrimeQ[#]&]//Sort (* The second program is significantly faster than the first. *) (* Harvey P. Dale, Feb 24 2018 *)
  • Python
    from sympy import isprime
    A059758_list = []
    for l in range(1,300):
        for a in '1379':
            for b in '0123456789':
                if a != b:
                    p = int((a+b)*l+a)
                    if isprime(p):
                        A059758_list.append(p) # Chai Wah Wu, Dec 21 2014

Extensions

More terms from James Sellers, Feb 13 2001

A062209 Numbers k such that the smoothly undulating palindromic number (4*10^k-7)/33 = 121...21 is a prime (or PRP).

Original entry on oeis.org

7, 11, 43, 139, 627, 1399, 1597, 1979, 7809, 14059, 46499
Offset: 1

Views

Author

Patrick De Geest and Hans Rosenthal (Hans.Rosenthal(AT)t-online.de), Jun 15 2001

Keywords

Comments

Prime versus probable prime status and proofs are given in the author's table.
No further terms < 100000. - Ray Chandler, Aug 17 2011
The corresponding primes, called smoothly undulating palindromic primes (cf. links, A032758 and A059758), are listed in A092696. The number of '12's is given in A056803(n) = (a(n)-1)/2. - M. F. Hasler, Jul 30 2015

Examples

			k=11 --> (12*10^11 - 21)/99 = 12121212121.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 139, p. 48, Ellipses, Paris 2008.

Crossrefs

Programs

  • Mathematica
    d[n_]:=IntegerDigits[n]; Length/@d[Select[NestList[FromDigits[Join[d[#],{2,1}]]&,1,1000],PrimeQ]] (* Jayanta Basu, May 25 2013 *)
  • PARI
    for(n=1,1e5,ispseudoprime(5^n<<(n+2)\33)&&print1(n",")) \\ M. F. Hasler, Jul 30 2015

Extensions

a(11) = 46499 from Ray Chandler, Nov 11 2010
Edited by Ray Chandler, Aug 17 2011
Name and other items edited by M. F. Hasler, Jul 30 2015

A062232 Numbers k such that the smoothly undulating palindromic number (98*10^k - 89)/99 is a prime.

Original entry on oeis.org

9, 161, 219, 4859, 21989, 52931, 88595
Offset: 1

Views

Author

Patrick De Geest and Hans Rosenthal (Hans.Rosenthal(AT)t-online.de), Jun 15 2001

Keywords

Comments

Prime versus probable prime status and proofs are given in the author's table.
No further terms < 100000. - Ray Chandler, Aug 17 2011

Examples

			k=9 -> (98*10^9 - 89)/99 = 989898989.
		

Crossrefs

Extensions

a(6)=52931 from Ray Chandler, Nov 11 2010
a(7)=88595 from Ray Chandler, Jul 23 2011
Edited by Ray Chandler, Aug 17 2011

A059168 Primes in which digits alternately rise and fall (or vice versa); sometimes called undulating primes.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 131, 151, 163, 173, 181, 191, 193, 197, 241, 251, 263, 271, 281, 283, 293, 307, 313, 317, 353, 373, 383, 397, 401, 409, 419, 439, 461, 463, 487, 491
Offset: 1

Views

Author

N. J. A. Sloane, Feb 14 2001

Keywords

References

  • C. A. Pickover, "Wonders of Numbers", Oxford New York 2001, Chapter 52, pp. 123-124, 316-317.

Crossrefs

Programs

  • Maple
    extend:= proc(n) local L,j;
      L:= convert(n,base,10);
      if (L[-1] < L[-2]) xor (nops(L)::odd) then
        seq(10*n+j,j=0..L[1]-1)
      else
        seq(10*n+j,j=L[1]+1..9)
      fi
    end proc:
    und[2]:= [seq(seq(10*i+j,j=subs(i=NULL,[$0..9])),i=1..9)]:
    for i from 3 to 4 do und[i]:= map(extend,und[i-1]) od:
    select(isprime, [2,3,5,7,seq(op(und[i],i=2..4)]); # Robert Israel, Nov 15 2018
  • Mathematica
    d[n_]:=Differences[IntegerDigits[n]]; mQ[n_]:=MemberQ[d[n],0]==False; a[n_]:=DeleteDuplicates[Sign[Take[d[n],{1,-1,2}]]]; b[n_]:=DeleteDuplicates[Sign[Take[d[n],{2,-1,2}]]]; t={}; Do[p=Prime[n]; If[mQ[p],If[Length[IntegerDigits[p]]<=2,AppendTo[t,p],If[Length[a[p]]==Length[b[p]]==1 && a[p][[1]]!=b[p][[1]],AppendTo[t,p]]]],{n,95}]; t (* Jayanta Basu, May 08 2013 *)
    Table[Which[p<10,p,p<100&&Differences[IntegerDigits[p]]!={0},p,p>100&&Union[Total/@ Partition[Sign[Differences[IntegerDigits[p]]],2,1]]=={0},p,True,Nothing],{p,Prime[ Range[ 150]]}] (* Harvey P. Dale, Aug 07 2023 *)
  • Python
    from sympy import isprime
    def f(w,dir):
        if dir == 1:
            for s in w:
                for t in range(int(s[-1])+1,10):
                    yield s+str(t)
        else:
            for s in w:
                for t in range(0,int(s[-1])):
                    yield s+str(t)
    A059168_list = []
    for l in range(5):
        for d in '123456789':
            x = d
            for i in range(1,l+1):
                x = f(x,(-1)**i)
            A059168_list.extend([int(p) for p in x if isprime(int(p))])
            if l > 0:
                y = d
                for i in range(1,l+1):
                    y = f(y,(-1)**(i+1))
                A059168_list.extend([int(p) for p in y if isprime(int(p))]) # Chai Wah Wu, Apr 25 2021

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Feb 15 2001
Offset changed by Robert Israel, Nov 15 2018

A030291 Primes with at most two different digits.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 113, 131, 151, 181, 191, 199, 211, 223, 227, 229, 233, 277, 311, 313, 331, 337, 353, 373, 383, 433, 443, 449, 499, 557, 577, 599, 661, 677, 727, 733
Offset: 1

Views

Author

Keywords

Comments

The one-digit primes (2, 3, 5, 7) followed by the union of A004022 and A235154. - Jeppe Stig Nielsen, Feb 17 2021

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], PrimeQ[#] && Length[Union[RealDigits[#][[1]]]] <= 2 &]
    Select[Prime[Range[200]],Count[DigitCount[#],0]>7&] (* Harvey P. Dale, Jul 14 2017 *)

Extensions

Offset corrected by Arkadiusz Wesolowski, Sep 13 2011

A242541 Undulating primes: prime numbers whose digits follow the pattern A, B, A, B, A, B, A, B, ...

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929, 18181, 32323, 35353, 72727, 74747, 78787, 94949, 95959, 1212121, 1616161, 323232323
Offset: 1

Views

Author

J. Lowell, May 17 2014

Keywords

Comments

All numbers in this sequence with three or more digits must have an odd number of digits. Any number with an even number of digits that follow this pattern is divisible by a number of the form 1010101...1010101 where the number of digits is one less than the number of digits in the original number.
Union of A004022 and A032758. - Arkadiusz Wesolowski, May 17 2014
Because A may equal B, 11 (and other prime repunits) are terms in this sequence (but not of A032758). - Harvey P. Dale, May 26 2015

Examples

			121 = 11*11 is not prime and thus is not a term of this sequence.
		

Crossrefs

Programs

  • Maple
    select(isprime,[$0..99,seq(seq(seq(a*(10^(d+1)-10^(d+1 mod 2))/99 + b*(10^d - 10^(d mod 2))/99, b=0..9),a=1..9,2),d=3..9,2)]); # Robert Israel, Jul 08 2016
  • Mathematica
    Select[Union[Flatten[Table[FromDigits[PadRight[{},n,#]],{n,9}]&/@ Tuples[ Range[0,9],2]]],PrimeQ] (* Harvey P. Dale, May 26 2015 *)
  • Python
    from itertools import count, islice
    from sympy import isprime, primerange
    def agen(): # generator of terms
        yield from primerange(2, 100)
        yield from (t for t in (int((A+B)*d2+A) for d2 in count(1) for A in "1379" for B in "0123456789") if isprime(t))
    print(list(islice(agen(), 51))) # Michael S. Branicky, Jun 09 2022

A057332 a(n) is the number of (2n+1)-digit palindromic primes that undulate.

Original entry on oeis.org

4, 15, 52, 210, 1007, 5156, 25571, 133293, 727082, 3874464, 21072166, 117829671, 654556778
Offset: 0

Views

Author

Patrick De Geest, Sep 15 2000

Keywords

Comments

'Undulate' means that the alternate digits are consistently greater than or less than the digits adjacent to them (e.g., 906343609). Smoothly undulating palindromic primes (e.g., 323232323) are a subset and included in the count.

References

  • C. A. Pickover, "Wonders of Numbers", Oxford New York 2001, Chapter 52, pp. 123-124, 316-317.

Crossrefs

Programs

  • Python
    from sympy import isprime
    from itertools import product
    def sign(n): return (n > 0) - (n < 0)
    def unds(n):
      s = str(n)
      if len(s) == 1: return True
      signs = set(sign(int(s[i-1]) - int(s[i])) for i in range(1, len(s), 2))
      if len(signs) > 1: return False
      if len(s) % 2 == 0: return signs == {1} or signs == {-1}
      return sign(int(s[-1]) - int(s[-2])) in signs - {0}
    def candidate_pals(n): # of length 2n + 1
      if n == 0: yield from [2, 3, 5, 7]; return # one-digit primes
      for rightbutend in product("0123456789", repeat=n-1):
        rightbutend = "".join(rightbutend)
        for end in "1379": # multi-digit primes must end in 1, 3, 7, or 9
          left = end + rightbutend[::-1]
          for mid in "0123456789": yield int(left + mid + rightbutend + end)
    def a(n): return sum(1 for p in candidate_pals(n) if unds(p) and isprime(p))
    print([a(n) for n in range(6)]) # Michael S. Branicky, Apr 15 2021
    
  • Python
    from sympy import isprime
    def f(w,dir):
        if dir == 1:
            for s in w:
                for t in range(int(s[-1])+1,10):
                    yield s+str(t)
        else:
            for s in w:
                for t in range(0,int(s[-1])):
                    yield s+str(t)
    def A057332(n):
        c = 0
        for d in '123456789':
            x = d
            for i in range(1,n+1):
                x = f(x,(-1)**i)
            c += sum(1 for p in x if isprime(int(p+p[-2::-1])))
            if n > 0:
                y = d
                for i in range(1,n+1):
                    y = f(y,(-1)**(i+1))
                c += sum(1 for p in y if isprime(int(p+p[-2::-1])))
        return c # Chai Wah Wu, Apr 25 2021

Extensions

a(5) from Donovan Johnson, Aug 08 2010
a(6)-a(10) from Lars Blomberg, Nov 19 2013
a(11) from Chai Wah Wu, Apr 25 2021
a(12) from Chai Wah Wu, May 02 2021

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

A092696 Smoothly undulating palindromic primes of the form (12*10^n-21)/99.

Original entry on oeis.org

1212121, 12121212121, 1212121212121212121212121212121212121212121
Offset: 1

Views

Author

Rick L. Shepherd, Mar 04 2004

Keywords

Comments

The De Geest link calls these smoothly undulating palindromic primes. Corresponding n are given in A062209. Equivalently, primes of the form 1212...121: Decimal digits "12" repeated k times with 1 appended (or "21" repeated k times with 1 prefixed). Corresponding k are given in A056803. The next term, a(4), has "12" repeating A056803(4) = 69 times and length A062209(4) = 2*A056803(4) + 1 = 139 decimal digits.

Crossrefs

Cf. A056803 (number of 12's (or 21's)), A062209 (corresponding decimal digit lengths).

Formula

a(n) = (4*10^A062209(n)-7)/33. - M. F. Hasler, Jul 30 2015

Extensions

Edited by M. F. Hasler, Jul 30 2015
Showing 1-10 of 37 results. Next