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.

A134941 Mountain numbers.

Original entry on oeis.org

1, 121, 131, 141, 151, 161, 171, 181, 191, 1231, 1241, 1251, 1261, 1271, 1281, 1291, 1321, 1341, 1351, 1361, 1371, 1381, 1391, 1421, 1431, 1451, 1461, 1471, 1481, 1491, 1521, 1531, 1541, 1561, 1571, 1581, 1591, 1621, 1631, 1641, 1651, 1671, 1681, 1691, 1721
Offset: 1

Views

Author

Omar E. Pol, Nov 22 2007

Keywords

Comments

For n > 1 the structure of digits represents a mountain. The first digit is 1. The last digit is 1. The first digits are in increasing order. The last digits are in decreasing order. The numbers only have one largest digit. This sequence is finite. The last term is 12345678987654321.
The total number of terms is 21846. - Hans Havermann, Nov 25 2007
A002450(8) + 1 = 21846. - Reinhard Zumkeller, May 17 2010
From Reinhard Zumkeller, May 25 2010: (Start)
A178333 is the characteristic function of mountain numbers: A178333(a(n)) = 1;
A178334(n) is the number of mountain numbers <= n;
A178052 and A178053 give sums of digits and digital roots of mountain numbers;
A178051(n) is the peak value of the n-th mountain number. (End)

Examples

			The A-number of this sequence (A134941) is itself a mountain number:
  . . . 9 . .
  . . . . . .
  . . . . . .
  . . . . . .
  . . . . . .
  . . 4 . 4 .
  . 3 . . . .
  . . . . . .
  1 . . . . 1
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a134941 n = a134941_list !! (n-1)
    a134941_list = elemIndices 1 a178333_list
    -- Reinhard Zumkeller, Oct 28 2001
    
  • Mathematica
    mountainQ[n_] := MatchQ[ IntegerDigits[n], {1, a___, b_, c___, 1} /; OrderedQ[{1, a, b}, Less] && OrderedQ[ Reverse[{b, c, 1}], Less]]; mountainQ[1] = True; Select[Range[2000], mountainQ] (* Jean-François Alcover, Jun 13 2012 *)
    Prepend[Union @@ ((FromDigits@#&/@Flatten[Table[Join[(k=Prepend[#,1]&/@
    Subsets[Range[2,#-1]])[[i]], {#}, (Reverse@# & /@k)[[j]]],
    {i, 2^(# - 2)}, {j, 2^(# - 2)}], 1])&/@Range[9]), 1] (* Hans Rudolf Widmer, Apr 30 2024 *)
  • Python
    from itertools import product
    def ups():
        d = "23456789"
        for b in product([0, 1], repeat=8):
            yield "1" + "".join(d[i]*b[i] for i in range(8))
    def downsfrom(apex):
        if apex < 3: yield "1"*int(apex==2); return
        d = "8765432"[-(apex-2):]
        for b in product([0, 1], repeat=len(d)):
            yield "".join(d[i]*b[i] for i in range(len(d))) + "1"
    def A134941(): # return full sequence as a list
        mountain_strs = (u+d for u in ups() for d in downsfrom(int(u[-1])))
        return sorted(int(ms) for ms in mountain_strs)
    print(A134941()[:45]) # Michael S. Branicky, Dec 31 2021

A134951 Mountain primes.

Original entry on oeis.org

131, 151, 181, 191, 1231, 1291, 1321, 1361, 1381, 1451, 1471, 1481, 1531, 1571, 1621, 1721, 1741, 1831, 1861, 1871, 1931, 1951, 12391, 12421, 12451, 12491, 12541, 12641, 12671, 12721, 12781, 12791, 12821, 12841, 12941, 13421, 13451, 13591, 13681
Offset: 1

Views

Author

Omar E. Pol, Nov 25 2007

Keywords

Comments

Mountain numbers that are prime numbers.
This sequence has 2620 terms. The largest is 134567897654321. - Jud McCranie, Feb 23 2009, Feb 24 2009

Examples

			The A-number of this sequence (A134951) is a mountain prime because 134951 is a mountain number and it is also a prime number.
. . . 9 . .
. . . . . .
. . . . . .
. . . . . .
. . . . 5 .
. . 4 . . .
. 3 . . . .
. . . . . .
1 . . . . 1
		

References

  • Chris K. Caldwell and G. L. Honaker, Jr; Prime Curios!, The Dictionary of Prime Number Trivia, CreateSpace (2009), p. 69, 216, 217.

Crossrefs

Formula

A000040 INTERSECT A134941.
A178333(a(n))*A010051(a(n)) = 1. - Reinhard Zumkeller, May 25 2010

Extensions

Edited by Omar E. Pol, Feb 26 2009
More terms from Max Alekseyev, Feb 06 2010
Minor edit and reference added by Omar E. Pol, Mar 25 2011

A134810 Giza numbers.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 121, 232, 343, 454, 565, 676, 787, 898, 12321, 23432, 34543, 45654, 56765, 67876, 78987, 1234321, 2345432, 3456543, 4567654, 5678765, 6789876, 123454321, 234565432, 345676543, 456787654, 567898765, 12345654321, 23456765432
Offset: 1

Views

Author

Omar E. Pol, Nov 25 2007, Nov 26 2007

Keywords

Comments

For n > 9 the structure of digits represents the pyramids of Giza. Also the top of a mountain. The first digit is equal to the last digit. The first digits are in consecutive increasing order. The last digits are in consecutive decreasing order. The largest digit is the central digit. The number of digits is odd. This sequence has 45 terms. The final term is 12345678987654321. Giza numbers are mountain numbers A134941 and palindromes A002113.
There are 10 - k numbers with 2*k - 1 digits. - Omar E. Pol, Aug 04 2011

Examples

			Illustration using the final term of this sequence:
  . . . . . . . . 9 . . . . . . . .
  . . . . . . . 8 . 8 . . . . . . .
  . . . . . . 7 . . . 7 . . . . . .
  . . . . . 6 . . . . . 6 . . . . .
  . . . . 5 . . . . . . . 5 . . . .
  . . . 4 . . . . . . . . . 4 . . .
  . . 3 . . . . . . . . . . . 3 . .
  . 2 . . . . . . . . . . . . . 2 .
  1 . . . . . . . . . . . . . . . 1
		

Crossrefs

Programs

  • Mathematica
    ups = Flatten[Table[Range[i, j - 1], {i, 1, 9}, {j, i + 1, 10}], 1];afull = Sort[  Map[ToExpression@StringJoin@Map[ToString, #[[;; -2]] ~Join~ Reverse[#]] &, ups]];afull (* James C. McMahon, Apr 11 2025 *)
  • Python
    ups = [tuple(range(i, j)) for i in range(1, 10) for j in range(i+1, 11)]
    afull = sorted(int("".join(map(str, u[:-1] + u[::-1]))) for u in ups)
    print(afull) # Michael S. Branicky, Aug 02 2022

Formula

A178333(a(n))*A136522(a(n)) = 1. - Reinhard Zumkeller, May 25 2010

A178334 Number of mountain numbers <= n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Reinhard Zumkeller, May 25 2010

Keywords

Comments

a(n) = 21846 for n >= 12345678987654321.

Crossrefs

Cf. A135417.

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms; uses code in A134941
        A134941_full = A134941() + [-1]
        c = i = 0
        for j in count(0):
            if j == A134941_full[i]: i, c = i+1, c+1
            yield c
    print(list(islice(agen(), 122))) # Michael S. Branicky, Jan 09 2023

Formula

a(n) = Sum_{k=0..n} A178333(k).
Showing 1-4 of 4 results.