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.

A383782 a(n) is the number of n-digit terms in A383781.

Original entry on oeis.org

4, 10, 30, 147, 408, 1823, 4353, 17690, 38419, 143219, 284441, 980166, 1806038, 5813294, 10037352, 30426498, 49595776, 142437454, 220519428, 603013312, 890961094, 2329755538
Offset: 1

Views

Author

Stefano Spezia, May 09 2025

Keywords

Comments

After the first two terms, the ratios between successive odd terms and the ratios between successive even terms are decreasing. - Michael S. Branicky, May 11 2025

Crossrefs

Cf. A383781.

Programs

  • Mathematica
    Unprotect[CompositeQ]; CompositeQ[1]:=True; Protect[CompositeQ]; Q[n_]:=And[AllTrue[FromDigits/@Table[Take[IntegerDigits[n], -i], {i,IntegerLength[n],1,-2}], PrimeQ], AllTrue[FromDigits/@Table[Take[IntegerDigits[n], -i], {i,IntegerLength[ n]-1,1,-2}], CompositeQ]]; a[n_]:=Module[{p=Prime[PrimePi[10^(n-1)]+1], k=0}, While[10^(n-1)<=p<10^n-1, If[Q[p], k++]; p=NextPrime[p]]; k]; Array[a,7]
  • Python
    from gmpy2 import is_prime, mpz
    from itertools import count, islice
    def agen():
        olst, elst = [2, 3, 5, 7], [11, 19, 29, 31, 41, 59, 61, 71, 79, 89]
        yield from (len(olst), len(elst))
        for n in count(1):
            olst2, elst2 = [], []
            for o in olst:
                o, base = o, 10**(2*n-1)
                for i in range(10*base, 100*base, base):
                    t = i + o
                    t2 = int(str(t)[1:])
                    if is_prime(t) and not is_prime(t2):
                        olst2.append(t)
            yield len(olst2)
            for e in elst:
                e, base = e, 10**(2*n)
                for i in range(10*base, 100*base, base):
                    t = i + e
                    t2 = int(str(t)[1:])
                    if is_prime(t) and not is_prime(t2):
                        elst2.append(t)
            yield len(elst2)
            olst, elst = sorted(olst2), sorted(elst2)
    print(list(islice(agen(), 12))) # Michael S. Branicky, May 11 2025

Extensions

a(11)-a(19) from Michael S. Branicky, May 11 2025
a(20)-a(22) from Michael S. Branicky, May 19 2025