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.

A376129 Run lengths of the most significant decimal digit in the primes (A077648).

Original entry on oeis.org

1, 1, 1, 1, 4, 2, 2, 3, 2, 2, 3, 2, 1, 21, 16, 16, 17, 14, 16, 14, 15, 14, 135, 127, 120, 119, 114, 117, 107, 110, 112, 1033, 983, 958, 930, 924, 878, 902, 876, 879, 8392, 8013, 7863, 7678, 7560, 7445, 7408, 7323, 7224, 70435, 67883, 66330, 65367, 64336, 63799, 63129, 62712, 62090
Offset: 1

Views

Author

Stuart Coe, Sep 11 2024

Keywords

Examples

			The primes and the run lengths of their initial digits begin
  primes   2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, ...
  runs                 \------------/  \----/  \----/
  lengths  1  1  1  1         4          2       2     ...
		

Crossrefs

Programs

  • Python
    from sympy import primepi
    def A376129(n):
        if n<5: return 1
        def f(m): return (lambda x:primepi(10**x[0]*(x[1]+1)))(divmod(m,9))
        return int(f(n+5)-f(n+4)) # Chai Wah Wu, Oct 16 2024

Formula

a(n) = A000720(A037124(n+6)) - A000720(A037124(n+5)) for n >= 5. - Pontus von Brömssen, Oct 07 2024