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

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

A134853 Generalized mountain numbers.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 120, 121, 130, 131, 132, 140, 141, 142, 143, 150, 151, 152, 153, 154, 160, 161, 162, 163, 164, 165, 170, 171, 172, 173, 174, 175, 176, 180, 181, 182, 183, 184, 185, 186, 187, 190, 191, 192, 193, 194, 195, 196
Offset: 1

Views

Author

Omar E. Pol, Nov 26 2007, corrected May 15 2008

Keywords

Comments

a(1) to a(9) are equal to A000027. For n>9 the structure of the digits represents a mountain. The first digits are in increasing order. The last digits are in decreasing order. There is only one largest digit which represents the top of the mountain. This sequence is finite. The last member is 123456789876543210.
The sequence is a supersequence of A134941, because the restriction that both feet of the mountain are at "sea level" (first and last digit equal 1) is dropped here.
There are 173247 terms in this sequence. - Nathaniel Johnston, Dec 29 2010

Examples

			The number of this sequence (A134853) is a generalized mountain number.
. . . . . .
. . . 8 . .
. . . . . .
. . . . . .
. . . . 5 .
. . 4 . . .
. 3 . . . 3
. . . . . .
1 . . . . .
. . . . . .
		

Crossrefs

Programs

  • Python
    from itertools import chain, combinations as combs
    ups = list(chain.from_iterable(combs(range(10), r) for r in range(2, 11)))
    s = set(L[:-1] + R[::-1] for L in ups for R in ups if L[-1] == R[-1])
    afull = list(range(1, 10))
    afull += sorted(int("".join(map(str, t))) for t in s if t[0] != 0)
    print(afull[:60]) # Michael S. Branicky, Aug 02 2022

Extensions

Better definition and edited by Omar E. Pol, Nov 11 2009

A134971 Canyon primes.

Original entry on oeis.org

101, 313, 727, 757, 919, 929, 3023, 3203, 7027, 7057, 7127, 7207, 7237, 7247, 7307, 7417, 7457, 7507, 7517, 7537, 7547, 7607, 9029, 9049, 9059, 9109, 9209, 9239, 9319, 9349, 9419, 9439, 9479, 9539, 9619, 9629, 9649, 9679, 9689, 9719, 9739, 9749, 9769, 9829
Offset: 1

Views

Author

Omar E. Pol, Nov 25 2007

Keywords

Comments

Intersection of prime numbers and Canyon numbers ("Canyon primes"). This sequence is finite because A134970 is. There are 9237 Canyon primes (compare to 116505 Canyon numbers total). The largest Canyon prime (and last element of this sequence) is a(9237) = 98765432101456789.

Examples

			Illustration of 751367 as a Canyon prime:
. . . . . .
. . . . . .
7 . . . . 7
. . . . 6 .
. 5 . . . .
. . . . . .
. . . 3 . .
. . . . . .
. . 1 . . .
. . . . . .
		

Crossrefs

Cf. A000040, A134951, Primes in A134970.

Programs

  • Mathematica
    S = {}; c = 1;
    For[n = 1, n <= 9, n++,
      L = 2 n - 1;
      d = Join[Reverse[Range[1, n - 1]], Range[0, n - 1]];
      If[Mod[n, 2] != 0 && n != 5,
       For[j = 1, j < 2^L, j++,
         Dig = d[[Map[#[[1]] &, Position[IntegerDigits[j, 2, L], 1]]]];
         min = Min[Dig];
         If[Length[Position[Dig, min]] == 1,
          p = FromDigits[Join[{n}, Dig, {n}]];
          If[PrimeQ[p], S = Append[S, p]];
          ];
         ];
       ];
      ]; (* Kellen Myers, Jan 18 2011 *)
  • Python
    from sympy import isprime
    from itertools import chain, combinations as combs
    ups = list(chain.from_iterable(combs(range(10), r) for r in range(2, 11)))
    s = set(L[::-1] + R[1:] for L in ups for R in ups if L[0] == R[0])
    afull = sorted(filter(isprime, (int("".join(map(str, t))) for t in s if t[0] == t[-1])))
    print(afull[:44]) # Michael S. Branicky, Jan 16 2023

Formula

A000040 INTERSECT A134970.

Extensions

All terms past 3203, more comments, etc. by Kellen Myers, Jan 18 2011

A167844 Convex primes.

Original entry on oeis.org

101, 103, 107, 109, 113, 127, 137, 139, 149, 211, 223, 227, 229, 239, 307, 311, 313, 317, 337, 347, 349, 359, 401, 409, 419, 421, 433, 439, 449, 457, 503, 509, 521, 523, 547, 557, 569, 601, 607, 613, 617, 619, 631, 643, 647, 659, 701, 709, 719, 727, 733, 739
Offset: 1

Views

Author

Omar E. Pol, Nov 13 2009

Keywords

Comments

Primes in A135641.
Primes whose structure of digits represents a convex function or a convex object. In the graphic representation the points are connected by imaginary line segments from left to right.
See A246033 for a different notion of "convex prime". - N. J. A. Sloane, Jul 25 2017

Crossrefs

Programs

  • PARI
    \\ See Links section.

Extensions

More terms from Rémy Sigrist, Dec 15 2018

A167853 Generalized mountain primes.

Original entry on oeis.org

2, 3, 5, 7, 131, 151, 163, 173, 181, 191, 193, 197, 241, 251, 263, 271, 281, 283, 293, 353, 373, 383, 397, 461, 463, 487, 491, 563, 571, 587, 593, 673, 683, 691, 787, 797, 1231, 1283, 1291, 1297, 1321, 1361, 1373, 1381, 1451, 1453, 1471
Offset: 1

Views

Author

Omar E. Pol, Nov 13 2009, Nov 15 2009

Keywords

Comments

Primes in A134853. This sequence is finite because A134853 is.
Superset of A134951, mountain primes.
Question: How many terms are in this sequence?
The last term is a(7145) = 134567897654321. - Giovanni Resta, Mar 19 2013

Examples

			Illustration of 136973 as a generalized mountain prime:
. . . 9 . .
. . . . . .
. . . . 7 .
. . 6 . . .
. . . . . .
. . . . . .
. 3 . . . 3
. . . . . .
1 . . . . .
		

Crossrefs

Extensions

More terms provided. Harvey P. Dale, Aug 19 2010
a(37)-a(47) corrected by Giovanni Resta, Mar 19 2013

A167843 Obtuse-angled primes.

Original entry on oeis.org

113, 127, 137, 139, 149, 157, 167, 179, 199, 211, 223, 227, 229, 233, 239, 257, 269, 277, 311, 331, 337, 347, 349, 359, 367, 379, 389, 421, 431, 433, 443, 449, 457, 467, 479, 499, 521, 541, 557, 569, 577, 599, 631, 641, 643, 653, 661, 677, 733, 743, 751, 761
Offset: 1

Views

Author

Omar E. Pol, Nov 13 2009

Keywords

Comments

Primes in A135603.
Primes whose structure of digits represents an obtuse angle. The vertex is an internal digit. In the graphic representation the points are connected by imaginary line segments from left to right.

Crossrefs

Programs

  • Python
    # uses agen() from A135603
    from sympy import isprime
    g = filter(isprime, agen())
    print([next(g) for n in range(1, 53)]) # Michael S. Branicky, Aug 03 2022

Extensions

a(12) and beyond from Michael S. Branicky, Aug 03 2022

A167845 Concave primes.

Original entry on oeis.org

131, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 233, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 331, 353, 367, 373, 379, 383, 389, 397, 431, 443, 461, 463, 467, 479, 487, 491, 499, 541, 563, 571, 577, 587, 593, 599, 641, 653, 661, 673
Offset: 1

Views

Author

Omar E. Pol, Nov 13 2009

Keywords

Comments

Primes in A135642.
Primes whose structure of digits represents a concave function or a concave object. In the graphic representation the points are connected by imaginary line segments from left to right.

Crossrefs

Extensions

More terms from Max Alekseyev, Apr 24 2010

A167846 Concave-convex primes.

Original entry on oeis.org

1021, 1031, 1033, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423
Offset: 1

Views

Author

Omar E. Pol, Nov 13 2009

Keywords

Comments

Primes in A163278.
Prime numbers with more than three digits that are not straight-line numbers (A135643), concave numbers (A135642) or convex numbers (A135641).

Crossrefs

Extensions

More terms from Rémy Sigrist, May 22 2019

A178333 Characteristic function of mountain numbers.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 25 2010

Keywords

Comments

a(A134941(n)) = 1; a(A134951(n)) = 1;
a(n) = 0 for n > 12345678987654321;
a(A011540(n))=0; a(A052383(n))=0; a(A171901(n))=0;
A178334(n) = SUM(a(k): 0<=k<=n).

Crossrefs

Programs

  • Haskell
    a178333 n = fromEnum $
       n `mod` 10 == 1 && a000030 n == 1 && a196368 n == 1 && and down where
          down = dropWhile (== False) $ zipWith (<) (tail $ show n) (show n)
    a178333_list = map a178333 [0..]
    -- Reinhard Zumkeller, Oct 28 2001
  • Mathematica
    a[n_] := Boole[ MatchQ[ IntegerDigits[n], {1, a___, b_, c___, 1} /; OrderedQ[{1, a, b}, Less] && OrderedQ[ {b, c, 1}, Greater]]]; a[1]=1; Table[a[n], {n, 0, 200}] (* Jean-François Alcover, Jun 13 2012 *)

Formula

a(n) = if n mod 10 = 1 then if n = 1 then 1 else g(n div 10, 1) else 0
with g(x, y) = if x mod 10 > y then g(x div 10, x mod 10) else if x mod 10 = y then 0 else h(x div 10, x mod 10)
and h(x, y) = if y = 1 then 0^x else if x mod 10 < y then h(x div 10, x mod 10) else 0.

A167847 Straight-line primes.

Original entry on oeis.org

11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 4567, 76543, 23456789, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Omar E. Pol, Nov 14 2009

Keywords

Comments

Prime numbers with 2 digits together with the primes whose digits are in arithmetic progression. The structure of digits represents a straight line.
Note that in the graphic representation the points are connected by imaginary line segments (see also A135643).
Note that all two-digit primes are straight-line primes but this sequence has no three-digit terms.
No further terms between 23456789 and 115507867=prime(6600000). - R. J. Mathar, Dec 04 2009
All terms after 23456789 are repunit primes (A004022) with number of digits: 19, 23, 317, 1031, 49081, 86453, 109297, 270343, ... (A004023). - Jens Kruse Andersen, Jul 21 2014

Examples

			The number 4567 is straight-line prime:
  . . . .
  . . . .
  . . . 7
  . . 6 .
  . 5 . .
  4 . . .
  . . . .
  . . . .
  . . . .
  . . . .
		

Crossrefs

Extensions

2 more terms from R. J. Mathar, Dec 04 2009
a(25)-a(26) from Jens Kruse Andersen, Jul 21 2014
Showing 1-10 of 15 results. Next