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-4 of 4 results.

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

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

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

A343591 Smoothly undulating alternating primes.

Original entry on oeis.org

2, 3, 5, 7, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 181, 383, 727, 787, 929, 18181, 32323, 72727, 74747, 78787, 94949, 1212121, 1616161, 323232323, 383838383, 727272727, 929292929, 989898989, 12121212121, 14141414141, 32323232323, 383838383838383, 38383838383838383, 72727272727272727
Offset: 1

Views

Author

Bernard Schott, Apr 21 2021

Keywords

Comments

Equivalently, numbers that are primes, smoothly undulating = in which the digits alternate: ababab... with a <> b (A032758) and alternating = in which parity of the digits alternates (A030144).
Charles W. Trigg was the first to use the word 'smoothly' for these integers.
If we note a(ba) the terms where the substring (ba) is repeated in their decimal expansion, there exist only 16 possibilities with a odd <> 5 and b even <> 0 to get such primes. Indeed, there exist primes of the form 1(21), 1(41), 1(61), 1(81), 3(23), 3(83), 7(27), 7(47), 7(87), 9(29), 9(49), 9(89). There do not exist terms of the form 3(63), 7(67), 9(69), as they are always composite.
Now, what about possible terms of the form 3(43)? If (43) is repeated 3k times, 3(43) is divisible by 3; if (43) is repeated 3k+1 times, 3(43) is divisible by 7; so if such a prime exists, then the substring (43) must be repeated 3k+2 times, but it is not known if such smoothly undulating prime 3(43) exists and if it exists, (43) must be repeated at least 9302 times, so k >= 3100 (link).
Some properties:
-> Every term has two digits or an odd number of digits.
-> All terms with an odd number of digits are palindromic (A059758).
-> Only 2 and the nine 2-digit terms begin with an even digit.

Examples

			1616161 is a term as it is prime and the digits 1 and 6 have odd and even parity and alternate.
		

References

  • Charles W. Trigg, Special Palindromic Primes, Journal of Recreational Mathematics, 4 (July 1971) 169-170.

Crossrefs

Intersection of A030144 and A032758.
Subsequence of A343590.

Programs

  • Maple
    f:= proc(n) local i,a,b,c,d;
      c:= add(10^i,i=1..n-1,2);
      d:= add(10^i,i=0..n-1,2);
      if n = 2 then op(select(isprime,[seq(seq(a*c+b*d, b=[1,3,7,9]),a=[2,4,6,8])]))
        else op(select(isprime, [seq(seq(a*c+b*d, a=[0,2,4,6,8]),b=[1,3,7,9])]))
      fi
    end proc:
    f(1):= (2,3,5,7):
    map(f, [1,2,seq(i,i=3..17,2)]); # Robert Israel, Nov 09 2023
  • Mathematica
    f[o_,e_,n_,m_] := FromDigits @ Riffle[ConstantArray[o,n], ConstantArray[e,n-m]]; seq[n_,m_] := Module[{o = Range[1,9,2], e = Range[0,8,2]}, Select[Union[f @@@ Join[Tuples[{o, e, {n}, {m}}], Tuples[{Rest @ e, o, {n}, {m}}]]], PrimeQ]]; s = seq[1, 1]; Do[s = Join[s, seq[m, Boole[m > 1]]], {m, 1, 10}]; s (* Amiram Eldar, Apr 21 2021 *)
  • Python
    from sympy import isprime
    def agenthru(maxdigits):
      if maxdigits >= 1: yield from [2, 3, 5, 7]
      for digits in [2]*(maxdigits >= 2) + list(range(3, maxdigits+1, 2)):
        hlf, odd = (digits+1)//2, digits%2
        d1range = "1379" if digits%2 == 1 else "123456789"
        d2range = "1379" if digits%2 == 0 else "0123456789"
        for d1 in d1range:
          for d2 in d2range:
            if int(d1)%2 == int(d2)%2: continue
            t = int("".join([*sum(zip(d1*hlf, d2*(digits-hlf)), ())]+[d1*odd]))
            if isprime(t): yield t
    print([p for p in agenthru(17)]) # Michael S. Branicky, Apr 21 2021
Showing 1-4 of 4 results.