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 14 results. Next

A032758 Undulating primes (digits alternate).

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, 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
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

Sometimes called "smoothly undulating primes", to distinguish them from A059168.

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

  • 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 && a[p][[1]] != b[p][[1]], AppendTo[t,p]]], {n,3*10^7}]; t (* Jayanta Basu, May 04 2013 *)
  • Python
    from itertools import count, islice
    from sympy import isprime, primerange
    def agen(): # generator of terms
        yield from (p for p in primerange(2, 100) if p != 11)
        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 A != B) if isprime(t))
    print(list(islice(agen(), 51))) # Michael S. Branicky, Jun 09 2022

Extensions

Sequence corrected by Juri-Stepan Gerasimov, Jan 28 2010
Offset corrected by Arkadiusz Wesolowski, Sep 13 2011

A046075 Nontrivial undulants; base 10 numbers >100 which are of the form aba, abab, ababa, ..., where a != b.

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

Programs

  • Haskell
    import Data.Set (fromList, deleteFindMin, insert)
    a046075 n = a046075_list !! (n-1)
    a046075_list = f $ fromList
                   [100 * a + 10 * b + a | a <- [1..9], b <- [0..9], b /= a]
       where f s = m : f (insert (10 * m + div (mod m 100) 10) s')
                   where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Apr 29 2015, May 01 2012

A016073 Undulating squares.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 121, 484, 676, 69696
Offset: 0

Views

Author

Keywords

Comments

Numbers with decimal expansion ababab... which are squares.
"Most mathematicians believe we will never find a larger one" - this has now been proved by David Moews.

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.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 68.

Crossrefs

Numbers in A033619 that are squares. See A122875 for the square roots.

Programs

  • Maple
    select(issqr,[$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 &]; A016073 = Reap[Do[Do[wk = wave[n][[k]]; If[IntegerQ[Sqrt[wk]], Sow[wk]], {k, 1, Length[wave[n]]}], {n, 1, 5}]][[2, 1]] (* Jean-François Alcover, Dec 28 2012 *)

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

A328142 Elements of cycles for iterations of A329623: n -> |n - concat(sum of adjacent digits of n)|.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 182, 273, 364, 455, 546, 637, 728, 1728, 2637, 3546, 4455, 5364, 6273, 7182, 17182, 26273, 35364, 44455, 53546, 62637, 71728, 171728, 262637, 353546, 444455, 535364, 626273, 717182, 1717182, 2626273, 3535364, 4444455, 5353546, 6262637, 7171728
Offset: 1

Views

Author

M. F. Hasler, Dec 02 2019

Keywords

Comments

Equivalently: range of A328865 \ {-1}.
By a k-cycle (or cycle of length k) of A329623 we mean a vector (x_1, ..., x_k) such that A329623(x_i) = x_{i+1} for i < k, and A329623(x_k) = x_1. We include here the cycles of length k = 1 which are the fixed points of A329623, viz A329623(x_1) = x_1. No cycle with k > 2 is known.
There are 7 infinite subsequences: for initial digit 1 <= d <= 7, alternate digit d and 8-d to form an undulating (A033619) number of arbitrary length L >= 3, then add 11.
The terms with initial digit d > 4 are the larger member of a 2-cycle having a term with d < 4 as smaller member. The terms with d = 4 (and those <= 9) are fixed points. So far no other fixed points or other cycles are known. As far as this remains valid, the terms of this sequence are characterized by A329623(A329623(x)) = x.
Sequence A328279 lists the smallest member of each cycle.

Examples

			The single-digit numbers 1, ..., 9 and the numbers f(k) = 4*(10^k-1)/9 + 11, k >= 3, are fixed points of A329623.
Indeed, for f(k) = 4...455 we have A053392(f(k)) = 8...910 = 2*f(k), so A329623(f(k)) = 2*f(k) - f(k) = f(k).
For a(10) = 182, we have A329623(182) = 728 and A329623(728) = 182, so these are members of the 2-cycle (182, 728).
For a(11) = 273, we have A329623(273) = 637 and A329623(637) = 273, so these are members of the 2-cycle (273, 637).
Similarly for all subsequent terms except the f(k) of the form 4...455.
		

Crossrefs

Cf. A329623, A053392 (concatenate sums of adjacent digits of n), A328865, A329624.
See A328279 for the smallest representative of each cycle.

Programs

  • PARI
    apply( {A328142(n)=if(n>9,fromdigits(vector((n+8)\/7,i,n=if(i>1, 8-n,(n+4)%7+1)))+11,n)}, [1..40]) \\ As far as there are no other terms than those described in COMMENTS. - M. F. Hasler, Dec 06 2019, replacing earlier code.

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

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

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
Showing 1-10 of 14 results. Next