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.

A366922 a(n) is the exponent of 3 in the prime factorization of 10^n - 1.

Original entry on oeis.org

2, 2, 3, 2, 2, 3, 2, 2, 4, 2, 2, 3, 2, 2, 3, 2, 2, 4, 2, 2, 3, 2, 2, 3, 2, 2, 5, 2, 2, 3, 2, 2, 3, 2, 2, 4, 2, 2, 3, 2, 2, 3, 2, 2, 4, 2, 2, 3, 2, 2, 3, 2, 2, 5, 2, 2, 3, 2, 2, 3, 2, 2, 4, 2, 2, 3, 2, 2, 3, 2, 2, 4, 2, 2, 3, 2, 2, 3, 2, 2, 6, 2, 2, 3, 2, 2, 3, 2, 2, 4
Offset: 1

Views

Author

Hugo Pfoertner, Oct 28 2023

Keywords

Comments

1

Crossrefs

Programs

  • Mathematica
    a[n_]:=IntegerExponent[10^n-1,3]; Array[a,90] (* Stefano Spezia, Oct 28 2023 *)
  • PARI
    a366922(n) = valuation(10^n-1,3)
    
  • Python
    def A366922(n):
        c = 0
        a, b = divmod(10**n-1, 3)
        while b == 0:
            a, b = divmod(a, 3)
            c += 1
        return c # Chai Wah Wu, Oct 29 2023

Formula

a(n) = A007949(10^n - 1).
a(n) = A007949(n) + 2 = A051064(n) + 1.