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.

A345326 Number of primes less than 10^n with digits in nonincreasing order.

Original entry on oeis.org

0, 4, 14, 49, 125, 296, 646, 1304, 2459, 4543, 7882, 13272, 21856, 34934, 53446, 82055, 121322, 175498, 251714, 354810, 488440, 676065, 914834, 1220629, 1627770, 2135954, 2759889, 3590609, 4602572, 5830588, 7386200, 9266652, 11469407, 14314939, 17658240
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 22 2021

Keywords

Comments

Number of primes with at most n digits arranged in nonincreasing order.

Crossrefs

Programs

  • Mathematica
    Table[Length@Select[Prime@Range[PrimePi[10^n]],OrderedQ@Reverse@IntegerDigits@#&],{n,0,7}] (* Giorgos Kalogeropoulos, Jul 22 2021 *)
  • Python
    from sympy import isprime
    from itertools import accumulate, combinations_with_replacement as mc
    def numwithdigs(d):
        if d == 0: return 0
        nonincreasing = (int("".join(m)) for m in mc("987654321", d))
        return len(list(filter(isprime, nonincreasing)))
    def aupto(nn): return list(accumulate(numwithdigs(d) for d in range(nn+1)))
    print(aupto(14)) # Michael S. Branicky, Jul 22 2021

Extensions

a(12)-a(34) from Michael S. Branicky, Jul 22 2021