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

A367735 Prime numbers wherein digit values increase, decrease, and finally increase.

Original entry on oeis.org

1201, 1213, 1217, 1301, 1303, 1307, 1319, 1327, 1409, 1423, 1427, 1429, 1439, 1523, 1549, 1601, 1607, 1609, 1613, 1619, 1627, 1637, 1657, 1709, 1723, 1747, 1759, 1801, 1823, 1847, 1867, 1879, 1901, 1907, 1913, 1949, 1979, 2309, 2417, 2423, 2437, 2503, 2539
Offset: 1

Views

Author

James S. DeArmon, Jan 24 2024

Keywords

Comments

Terms must have at least 4 digits.
There are 3287310 terms, with the last being 1245678987653210123456789. - Michael S. Branicky, Jan 26 2024

Examples

			The first term is 1201: increases 1-2, decreases 2-0, then increases 0-1.  An example 7-digit term is 1215679.
		

Crossrefs

Programs

  • Maple
    q:= proc(n) local i, l, s;
          l, s:= convert(n, base, 10), 1;
          for i to nops(l)-1 while s<5 do s:=
           `if`(l[i]=l[i+1], 5,
           `if`(l[i]>l[i+1], [2$2, 4$2][s], [5, 3$2, 5][s]))
          od; is(s=4)
        end:
    select(isprime and q, [$1..15000])[];  # Alois P. Heinz, Jan 26 2024
  • Python
    from sympy import isprime
    from itertools import combinations, islice
    def agen(): # generator of terms
        for d in range(4, 28):
            print(d)
            passed = set()
            for d1 in range(2, min(d-2, 9)+1):
                for c1 in combinations("123456789", d1):
                    for d2 in range(1, min(d-d1-1, 10)+1):
                        digits2 = list(map(str, range(int(c1[-1])-1, -1, -1)))
                        for c2 in combinations(digits2, d2):
                            digits3 = list(map(str, range(int(c2[-1])+1, 11)))
                            for c3 in combinations(digits3, d - d1 - d2):
                                t = int("".join(c1 + c2 + c3))
                                if isprime(t):
                                    passed.add(t)
            yield from sorted(passed)
    print(list(islice(agen(), 63))) # Michael S. Branicky, Jan 26 2024

A371378 Prime numbers wherein digit values decrease, increase, and finally decrease.

Original entry on oeis.org

1021, 1031, 1051, 1061, 1063, 1087, 1091, 1093, 1097, 2053, 2063, 2081, 2083, 2087, 2131, 2141, 2143, 2153, 2161, 3041, 3061, 3083, 3121, 3163, 3181, 3187, 3191, 3251, 3253, 3271, 4021, 4051, 4073, 4091, 4093, 4153, 4231, 4241, 4243, 4253, 4261, 4271, 4273, 4283
Offset: 1

Views

Author

James S. DeArmon, Mar 20 2024

Keywords

Comments

Terms must have at least 4 digits. The sequence is finite.
There are 3136837 terms, with the last being 98765432101234567987654321. - Michael S. Branicky, Mar 20 2024

Crossrefs

Programs

  • Maple
    q:= proc(n) local i, l, s;
          l, s:= convert(n, base, 10), 1;
          for i to nops(l)-1 while s<5 do s:=
           `if`(l[i]=l[i+1], 5,
           `if`(l[i]Alois P. Heinz, Mar 21 2024
  • Mathematica
    Select[Prime[Range[600]], SplitBy[Sign[Differences[IntegerDigits[#]]], Sign][[;; , 1]] == {-1, 1, -1} &] (* Amiram Eldar, Mar 21 2024 *)
  • Python
    from sympy import isprime
    from itertools import combinations, islice
    def agen(): # generator of terms
        for d in range(4, 29):
            print(d)
            passed = set()
            for d1 in range(2, min(d-2, 11)+1):
                for c1 in combinations("9876543210", d1):
                    for d2 in range(1, min(d-d1-1, 10)+1):
                        digits2 = list(map(str, range(int(c1[-1])+1, 10)))
                        for c2 in combinations(digits2, d2):
                            digits3 = list(map(str, range(int(c2[-1])-1, -1, -1)))
                            for c3 in combinations(digits3, d - d1 - d2):
                                t = int("".join(c1 + c2 + c3))
                                if isprime(t):
                                    passed.add(t)
            yield from sorted(passed)
    print(list(islice(agen(), 63))) # Michael S. Branicky, Mar 20 2024

Extensions

More terms from Michael S. Branicky, Mar 20 2024

A157083 Depression-type primes with five digits; from left to right digits decrease to and increase from the central digit.

Original entry on oeis.org

21013, 21017, 21019, 21023, 21059, 21067, 21089, 31013, 31019, 31039, 31069, 31079, 32027, 32029, 32057, 32059, 32069, 32089, 32159, 32189, 41017, 41023, 41039, 41047, 41057, 42013, 42017, 42019, 42023, 42089, 42139, 42157, 42169
Offset: 1

Views

Author

Ki Punches, Feb 22 2009

Keywords

Comments

The sequence is finite, ending with [308] 98689.

Crossrefs

Related sequence: A156116

Extensions

Corrected and edited Ki Punches, Feb 26 2009
Showing 1-3 of 3 results.