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 10 results.

A252664 Minimal nontrivial undulant (A046075) divisible by n, or 0 if no undulant is divisible by n.

Original entry on oeis.org

101, 202, 141, 212, 505, 252, 161, 232, 171, 1010, 121, 252, 494, 252, 525, 272, 272, 252, 171, 2020, 252, 242, 161, 696, 525, 494, 2727, 252, 232, 3030, 434, 3232, 363, 272, 525, 252, 3737, 494, 585, 4040, 656, 252, 989, 484, 585, 414, 141, 4848, 343, 5050
Offset: 1

Views

Author

Reiner Moewald, Mar 22 2015

Keywords

Comments

Undulants are numbers are of the form ababab..... with a and b distinct digits (base 10, a nonzero). An undulate is nontrivial if it has at least 3 digits. - Danny Rorabaugh, Apr 22 2015

Examples

			505 is the least entry of A046075 that is divisible by 5, so a(5) = 505. Since an undulant cannot end in 00, a(100)=0. - _Danny Rorabaugh_, Apr 22 2015
		

Crossrefs

Cf. A046075.

Programs

  • Python
    feld = []
    for n in range(3, 500):
       for a in range(1, 10):
          for b in range(10):
             if a != b:
                z_string = ""
                for pos in range(n):
                   if pos % 2 == 0:
                      z_string = z_string + str(a)
                   else:
                      z_string = z_string + str(b)
                z = int(z_string)
                feld.append(z)
    feld_length = len(feld)
    for z in range (1, 150):
       start = 0
       while start < feld_length and feld[start] % z != 0:
          start = start + 1
       if start < feld_length:
          print(z, feld[start])

A033619 Undulating numbers (of form abababab... in base 10).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 111, 121, 131, 141, 151
Offset: 1

Views

Author

Keywords

References

  • C. A. Pickover, "Keys to Infinity", Wiley 1995, p. 159,160.
  • C. A. Pickover, "Wonders of Numbers", Oxford New York 2001, Chapter 52, pp. 123-124, 316-317.

Crossrefs

Programs

  • Haskell
    import Data.Set (fromList, deleteFindMin, insert)
    a033619 n = a033619_list !! (n-1)
    a033619_list = [0..9] ++ (f $ fromList [10..99]) where
       f s = m : f (insert (m * 10 + h) s') where
         h = div (mod m 100) 10
         (m,s') = deleteFindMin s
    -- Reinhard Zumkeller, May 01 2012
    
  • Maple
    $0..9,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),d=2..6); # Robert Israel, Jul 08 2016
  • Mathematica
    wave[1] = Range[0, 9]; wave[2] = Range[10, 99]; wave[n_] := wave[n] = Select[ Union[ Flatten[ {id = IntegerDigits[#]; FromDigits[ Prepend[id, id[[2]]]], FromDigits[ Append[id, id[[-2]]]]} & /@ wave[n-1]]], 10^(n-1) < # < 10^n & ]; Flatten[ Table[ wave[n], {n, 1, 3}]] (* Jean-François Alcover, Jun 19 2012 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        yield from range(10)
        for d in count(2):
            q, r = divmod(d, 2)
            for a in "123456789":
                for b in "0123456789":
                    yield int((a+b)*q + a*r)
    print(list(islice(agen(), 106))) # Michael S. Branicky, Mar 28 2022

A046076 Indices of binary undulants; numbers n such that 2^n contains the alternating sequence of digits 010... or 101...

Original entry on oeis.org

103, 107, 138, 159, 179, 187, 192, 199, 205, 211, 217, 218, 234, 249, 254, 264, 269, 285, 288, 293, 296, 299, 304, 305, 316, 347, 350, 354, 364, 368, 378, 383, 384, 385, 390, 393, 406, 416, 420, 427, 436, 443, 445, 449, 451, 454, 457, 462, 463, 485, 488
Offset: 1

Views

Author

Keywords

References

  • C. A. Pickover, ``The Undulation of the Monks.'' Ch. 20 in Keys to Infinity. New York: W.H.Freeman, pp. 159-161 1995.
  • C. A. Pickover, "Wonders of Numbers", Oxford New York 2001, Chapter 52, pp. 123-124, 316-317.

Crossrefs

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

A355301 Normal undulating numbers where "undulating" means that the alternate digits go up and down (or down and up) and "normal" means that the absolute differences between two adjacent digits may differ.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 101, 102, 103, 104, 105, 106, 107, 108, 109, 120, 121, 130, 131, 132, 140, 141, 142, 143, 150
Offset: 1

Views

Author

Bernard Schott, Jun 27 2022

Keywords

Comments

This definition comes from Patrick De Geest's link.
Other definitions for undulating are present in the OEIS (e.g., A033619, A046075).
When the absolute differences between two adjacent digits are always equal (e.g., 85858), these numbers are called smoothly undulating numbers and form a subsequence (A046075).
The definition includes the trivial 1- and 2-digit undulating numbers.
Subsequence of A043096 where the first different term is A043096(103) = 123 while a(103) = 130.
This sequence first differs from A010784 at a(92) = 101, A010784(92) = 102.
The sequence differs from A160542 (which contains 100). - R. J. Mathar, Aug 05 2022

Examples

			111 is not a term here, but A033619(102) = 111.
a(93) = 102, but 102 is not a term of A046075.
Some terms: 5276, 918230, 1053837, 263915847, 3636363636363636.
Are not terms: 1331, 594571652, 824327182.
		

Crossrefs

Cf. A059168 (subsequence of primes).
Differs from A010784, A241157, A241158.

Programs

  • Maple
    isA355301 := proc(n)
        local dgs,i,back,forw ;
        dgs := convert(n,base,10) ;
        if nops(dgs) < 2 then
            return true;
        end if;
        for i from 2 to nops(dgs)-1 do
            back := op(i,dgs) -op(i-1,dgs) ;
            forw := op(i+1,dgs) -op(i,dgs) ;
            if back*forw >= 0 then
                return false;
            end if ;
        end do:
        back := op(-1,dgs) -op(-2,dgs) ;
        if back = 0 then
            return false;
        end if ;
        return true ;
    end proc:
    A355301 := proc(n)
        option remember ;
        if n = 1 then
            0;
        else
            for a from procname(n-1)+1 do
                if isA355301(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A355301(n),n=1..110) ; # R. J. Mathar, Aug 05 2022
  • Mathematica
    q[n_] := AllTrue[(s = Sign[Differences[IntegerDigits[n]]]), # != 0 &] && AllTrue[Differences[s], # != 0 &]; Select[Range[0, 100], q] (* Amiram Eldar, Jun 28 2022 *)
  • PARI
    isok(m) = if (m<10, return(1)); my(d=digits(m), dd = vector(#d-1, k, sign(d[k+1]-d[k]))); if (#select(x->(x==0), dd), return(0)); my(pdd = vector(#dd-1, k, dd[k+1]*dd[k])); #select(x->(x>0), pdd) == 0; \\ Michel Marcus, Jun 30 2022

A050783 Palindromes containing no pair of consecutive equal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 101, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 454, 464, 474, 484, 494, 505, 515, 525, 535, 545, 565, 575, 585, 595, 606
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[0,610],Reverse[x=IntegerDigits[#]]==x&&FreeQ[Differences[x],0]&] (* Jayanta Basu, Jun 01 2013 *)

A050784 Palindromic primes containing no pair of consecutive equal digits.

Original entry on oeis.org

2, 3, 5, 7, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929, 10301, 10501, 10601, 12421, 12721, 12821, 13831, 13931, 14341, 14741, 15451, 16061, 16361, 16561, 17471, 17971, 18181, 18481, 19391, 19891, 30103, 30203
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Crossrefs

Programs

  • Maple
    nextL:= proc(L) local V,j,n,k;
      n:= LinearAlgebra:-Dimension(L);
      V:= L;
      for j from n to 1 by -1 do
        V[j]:= V[j]+1;
        if j > 1 then if V[j] = V[j-1] then V[j]:= V[j]+1 fi
        elif member(V[j],[2,8]) then V[j]:= V[j]+1
        elif member(V[j],[4,5,6]) then V[j]:= 7
        fi;
        if V[j] <= 9 then
          for k from j+1 to n do if (k-j)::odd then V[k]:= 0 else V[k]:= 1 fi od;
          return V
        fi;
      od;
      Vector(n+1, i -> i mod 2)
    end proc:
    Pali:= proc(L)
      local i,n;
      n:= LinearAlgebra:-Dimension(L);
      add(L[i]*10^(2*n-i-1),i=1..n)+add(L[i]*10^(i-1),i=1..n-1)
    end proc:
    V:= <5>: Res:= 2,3,5: count:= 3:
    while count < 100 do
      V:= nextL(V);
      x:= Pali(V);
      if isprime(x) then count:= count+1; Res:= Res, x fi;
    od:
    Res; # Robert Israel, Feb 07 2019
  • Mathematica
    Select[Prime[Range[3280]],Reverse[x=IntegerDigits[#]]==x&&FreeQ[Differences[x],0]&] (* Jayanta Basu, Jun 01 2013 *)

A057333 Numbers of n-digit primes that undulate.

Original entry on oeis.org

4, 20, 74, 347, 1743, 8385, 44355, 229952, 1235489, 6629026, 37152645, 202017712, 1142393492, 6333190658
Offset: 1

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., 70769). Smoothly undulating palindromic primes (e.g., 95959) 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
    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 A057333(n):
        c = 0
        for d in '123456789':
            x = d
            for i in range(1,n):
                x = f(x,(-1)**i)
            c += sum(1 for p in x if isprime(int(p)))
            if n > 1:
                y = d
                for i in range(1,n):
                    y = f(y,(-1)**(i+1))
                c += sum(1 for p in y if isprime(int(p)))
        return c # Chai Wah Wu, Apr 25 2021

Extensions

Offset corrected and a(10)-a(11) from Donovan Johnson, Aug 08 2010
a(12) from Giovanni Resta, Feb 24 2013
a(2) corrected by Chai Wah Wu, Apr 25 2021
a(13)-a(14) from Chai Wah Wu, May 02 2021

A088882 Nontrivial palindromes in base 10 (i.e., palindromes that are not RepDigits such as 3, 111, 22222, or 888888888).

Original entry on oeis.org

101, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 454, 464, 474, 484, 494, 505, 515, 525, 535, 545, 565, 575, 585, 595, 606, 616, 626, 636, 646, 656, 676
Offset: 1

Views

Author

Chuck Seggelin, Oct 21 2003

Keywords

Comments

The early portion of this sequence appears to be very similar to the early portions of two other sequences. Note that a(n) = A046075(n) for n = 1..81. A046075 deals with nontrivial undulants of 3 digits or more which by definition excludes RepDigits, but which includes non-palindromic terms when 4-digit numbers are reached. For example a(82) = 1001 but A046075(82) = 1010. Note also that a(n) = A050783(n+10) for n = 1..81. A050783 deals with palindromes that contain no consecutive pairs of equal digits, so although A050783 excludes RepDigits, it includes the single-digit palindromes and excludes a large number of the palindromes in this sequence (such as, for example, all the 4-digit nontrivial palindromes and larger nontrivial palindromes such as 22022 or 61116). A050783(92) = 10101. Note that in the first 65534 values of n there are 754 palindromes, 712 nontrivial palindromes and 42 RepDigits.

Examples

			a(4) = 141 because 141 is the fourth term of the sequence of base-10 palindromes (A002113) that does not appear in the sequence of RepDigits (A010785).
		

Crossrefs

Cf. A002113 (base-10 palindromes), A010785 (repdigits), A046075 (nontrivial undulants), A050783 (palindromes with no pair of consecutive equal digits).

Programs

  • Python
    from itertools import count, islice, product
    def agen(): # generator of terms
        digits = "0123456789"
        for d in count(3):
            for p in product(digits, repeat=d//2):
                if d > 1 and p[0] == "0": continue
                left = "".join(p); right = left[::-1]
                for mid in [[""], digits][d%2]:
                    t = left + mid + right
                    if len(set(t)) != 1: yield int(t)
    print(list(islice(agen(), 52))) # Michael S. Branicky, May 17 2022
Showing 1-10 of 10 results.