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.

A307908 a(n) is the least k such that p^k >= n for any prime factor p of n.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 05 2019

Keywords

Examples

			For n = 12:
- the prime factors of 12 are 2 and 3,
- 3^4 > 2^4 >= 12 > 2^3,
- hence a(n) = 4.
		

Crossrefs

Programs

  • Mathematica
    Array[If[PrimeQ@ #, 1, Ceiling@ Log[FactorInteger[#][[1, 1]], #]] &, 105, 2] (* Michael De Vlieger, May 08 2019 *)
  • PARI
    a(n) = my (f=factor(n)); logint(n, f[1,1]) + if (#f~>1, 1, 0)
    
  • Python
    from operator import sub
    from sympy import integer_log, primefactors
    def A307908(n): return 1+sub(*integer_log(n,min(primefactors(n)))) # Chai Wah Wu, Oct 12 2024

Formula

a(n) = ceiling(log(n)/log(A020639(n))).
a(p^k) = k for any prime number p and any k > 0.
0 <= k*a(n) - a(n^k) < k for any n > 1 and k > 0.
a(n) = 1 iff n is a prime number (A000040).
a(n) = 2 iff n is the square of a prime number (A001248).