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.

Previous Showing 11-20 of 24 results. Next

A135600 Angled numbers with an internal digit as the vertex.

Original entry on oeis.org

100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147
Offset: 1

Views

Author

Omar E. Pol, Dec 02 2007

Keywords

Comments

The structure of digits represents an angle. The vertex is an internal digit. In the graphic representation the points are connected by imaginary line segments from left to right. The last acute-angled number of this sequence has 14 digits: 98765432102468. The last right-angled number of this sequence has 19 digits: 9876543210123456789. All 3-digit numbers are terms of this sequence. Next terms are 1000, 1012, 1024, 1036, 1048, 1110, 1111, 1112, 1113, 1114, ....
For each k >= 20, there are 363 k-digit terms: 354 obtuse-angled and 9 straight-angled.- Michael S. Branicky, Aug 03 2022

Examples

			The acute-angled number 12342 (see A135601):
  . . . . .
  . . . 4 .
  . . 3 . .
  . 2 . . 2
  1 . . . .
The right-angled number 12343 (see A135602):
  . . . . .
  . . . 4 .
  . . 3 . 3
  . 2 . . .
  1 . . . .
The obtuse-angled number 12344 (see A135603):
  . . . . .
  . . . 4 4
  . . 3 . .
  . 2 . . .
  1 . . . .
The straight-angled (or straight-line) number 12345 (see A135643):
  . . . . 5
  . . . 4 .
  . . 3 . .
  . 2 . . .
  1 . . . .
		

Crossrefs

Programs

  • PARI
    \\ See PARI link. David A. Corneth, Aug 02 2022
    
  • Python
    from itertools import count, islice
    def agen():
        seeds = [k for k in range(100, 1000)]
        for digits in count(4):
            yield from sorted(seeds)
            new, pow10 = set(), 10**(digits-1)
            for q in seeds:
                d = list(map(int, str(q)))
                e1, e2 = d[0] - (d[1]-d[0]), d[-1] + (d[-1]-d[-2])
                if 9 >= e1 > 0: new.add(e1*pow10 + q)
                if 9 >= e2 >= 0: new.add(10*q + e2)
            seeds = new
    print(list(islice(agen(), 50))) # Michael S. Branicky, Aug 03 2022

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

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.

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

A173071 Palindromic mountain primes.

Original entry on oeis.org

131, 151, 181, 191, 12421, 12721, 12821, 13831, 13931, 14741, 17971, 1235321, 1245421, 1257521, 1268621, 1278721, 1456541, 1469641, 1489841, 1579751, 1589851, 123484321, 123494321, 123575321, 136797631, 167898761, 12345854321
Offset: 1

Views

Author

Omar E. Pol, Feb 09 2010

Keywords

Comments

All terms have an odd number of digits. - Emeric Deutsch, Mar 09 2010

Examples

			a(6) = 12721; is a palindromic mountain prime.
. . . . .
. . . . .
. . 7 . .
. . . . .
. . . . .
. . . . .
. . . . .
. 2 . 2 .
1 . . . 1
		

Crossrefs

Programs

  • Maple
    a := proc (n) local rev, n1: rev := proc (n) local nn: nn := convert(n, base, 10): add(nn[j]*10^(nops(nn)-j), j = 1 .. nops(nn)) end proc: n1 := convert(n, base, 10): if n1[1]=1 and isprime(n) = true and rev(n) = n and n1[1] < n1[2] and n1[2] < n1[3] and n1[3] < n1[4] then n else end if end proc: seq(a(n), n = 1000000 .. 9999999); # this program works only for 7-digit numbers; easily adjustable for other (2k+1)-digit numbers # Emeric Deutsch, Mar 09 2010
  • Python
    from itertools import combinations
    from gmpy2 import is_prime
    A173071_list = []
    for l in range(1,10):
        for i in combinations('23456789',l):
            s = '1'+''.join(i)
            p = int(s+s[l-1::-1])
            if is_prime(p):
                A173071_list.append(p) # Chai Wah Wu, Nov 05 2015

Extensions

More terms from Emeric Deutsch, Mar 09 2010, corrected Mar 19 2010
a(22)-a(27) from Donovan Johnson, Jul 22 2010

A343524 Palindromes with digits strictly increasing up to the middle digit.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 121, 131, 141, 151, 161, 171, 181, 191, 232, 242, 252, 262, 272, 282, 292, 343, 353, 363, 373, 383, 393, 454, 464, 474, 484, 494, 565, 575, 585, 595, 676, 686, 696, 787, 797, 898, 1221, 1331
Offset: 1

Views

Author

James S. DeArmon, Apr 18 2021

Keywords

Comments

The maximum term in the sequence is 123456789987654321, if leading zeros are not allowed.

Examples

			121 and 1221 are legal terms but 122221 is not, since the digits 2,2 at positions 2 and 3 are not increasing.
		

Crossrefs

Cf. A002113, A009993, A062351 (primes), A134941.

Programs

  • Perl
    #!/usr/bin/perl
    open(OUT,">incrDecrPalindrome.txt")||die "open fail OUT\n";
    foreach $cand (0..100000){
        @a=split("",$cand);
        $b = join("",reverse @a);
        next unless $cand==$b; # palindromes only
        $n = int(@a/2.);
        $n-- if &is_even(0+@a); # backoff if even count of digits
        foreach $i (1..$n){
            goto skip_num unless $a[$i-1] < $a[$i];
        }
        print OUT "$cand,";
    skip_num:;
        print "";
    }
    print OUT "\n";
    ##########################################
    sub is_even{  $[0]/2. == int $[0]/2.  }
    ##########################################
    
  • Python
    from itertools import combinations
    A343524_list = [0]
    for l in range(1,4):
        for d in combinations('123456789',l):
            s = ''.join(d)
            A343524_list.append(int(s+s[-2::-1]))
        for d in combinations('123456789',l):
            s = ''.join(d)
            A343524_list.append(int(s+s[::-1])) # Chai Wah Wu, Apr 24 2021

Extensions

Terms < 100 prepended by Rémy Sigrist, Apr 25 2021

A173070 Palindromic mountain numbers.

Original entry on oeis.org

1, 121, 131, 141, 151, 161, 171, 181, 191, 12321, 12421, 12521, 12621, 12721, 12821, 12921, 13431, 13531, 13631, 13731, 13831, 13931, 14541, 14641, 14741, 14841, 14941, 15651, 15751, 15851, 15951, 16761, 16861, 16961, 17871, 17971, 18981
Offset: 1

Views

Author

Omar E. Pol, Feb 09 2010

Keywords

Comments

There are 256 terms, the last of which is 12345678987654321. - Michael S. Branicky, Aug 04 2022

Examples

			13731 is in the sequence because it is a palindrome (A002113) and it is also a mountain number (A134941).
. . . . .
. . . . .
. . 7 . .
. . . . .
. . . . .
. . . . .
. 3 . 3 .
. . . . .
1 . . . 1
		

Crossrefs

Programs

  • Python
    from itertools import chain, combinations as combs
    def c(s): return s[0] == s[-1] == 1 and s == s[::-1]
    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 = [1] + sorted(int("".join(map(str, t))) for t in s if c(t))
    print(afull[:40]) # Michael S. Branicky, Aug 04 2022

A182721 Mountain emirps.

Original entry on oeis.org

1231, 1321, 1381, 1471, 1741, 1831, 12491, 12641, 12841, 13591, 13751, 13781, 13841, 14591, 14621, 14821, 14831, 14891, 15731, 15791, 18731, 19421, 19531, 19541, 19751, 19841, 123731, 123821, 124951, 124981, 125641, 125651, 125791, 125821, 125941, 126761, 126851
Offset: 1

Views

Author

Omar E. Pol, Dec 21 2010

Keywords

Comments

Intersection of emirps A006567 and mountain numbers A134941.
The smallest mountain emirp 1231 and other terms of this sequence was mentioned by Loungrides in Prime Curios! (see link).
Question: How many are there?
There are 602 such terms. - Michael S. Branicky, Dec 31 2021

Examples

			Illustration of a(11) = 13751 as a mountain emirp:
  . . . . .
  . . . . .
  . . 7 . .
  . . . . .
  . . . 5 .
  . . . . .
  . 3 . . .
  . . . . .
  1 . . . 1
		

Crossrefs

Programs

  • Python
    # uses A134941()
    from sympy import isprime
    def is_emirp(n):
        if not isprime(n): return False
        revn = int(str(n)[::-1])
        return n != revn and isprime(revn)
    print([k for k in A134941() if is_emirp(k)]) # Michael S. Branicky, Dec 31 2021

Formula

A006567 INTERSECT A134941.

Extensions

More terms from Nathaniel Johnston, Dec 29 2010
Terms a(31) and beyond from Michael S. Branicky, Dec 31 2021

A178912 Number of generalized mountain numbers (see A134853) with n digits.

Original entry on oeis.org

9, 0, 240, 1380, 4578, 10794, 19494, 27912, 32195, 30085, 22748, 13820, 6656, 2486, 695, 137, 17, 1
Offset: 1

Views

Author

Nathaniel Johnston, Dec 29 2010

Keywords

Comments

The total number of generalized mountain numbers is 173247.

Examples

			a(18) = 1 because there is exactly one generalized mountain number with 18 digits: 123456789876543210
		

Crossrefs

A182776 Mountain nonprimes.

Original entry on oeis.org

1, 121, 141, 161, 171, 1241, 1251, 1261, 1271, 1281, 1341, 1351, 1371, 1391, 1421, 1431, 1461, 1491, 1521, 1541, 1561, 1581, 1591, 1631, 1641, 1651, 1671, 1681, 1691, 1731, 1751, 1761, 1781, 1791, 1821, 1841, 1851, 1891, 1921, 1941, 1961, 1971, 1981, 12321, 12341, 12351, 12361, 12371
Offset: 1

Views

Author

Omar E. Pol, Dec 14 2010

Keywords

Comments

The total number of terms is 19226. The largest is 12345678987654321 which is also the largest Giza number A134810.

Examples

			a(2)=121 is in the sequence because 121 is a nonprime number A018252 and 121 is also a mountain number A134941.
Illustration of 134961 as a mountain nonprime:
. . . 9 . .
. . . . . .
. . . . . .
. . . . 6 .
. . . . . .
. . 4 . . .
. 3 . . . .
. . . . . .
1 . . . . 1
		

Crossrefs

Formula

A018252 INTERSECT A134941.
Previous Showing 11-20 of 24 results. Next