A120454 a(n) = ceiling(GPF(n)/LPF(n)) where GPF is greatest prime factor, LPF is least prime factor.
1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 4, 2, 1, 1, 2, 1, 3, 3, 6, 1, 2, 1, 7, 1, 4, 1, 3, 1, 1, 4, 9, 2, 2, 1, 10, 5, 3, 1, 4, 1, 6, 2, 12, 1, 2, 1, 3, 6, 7, 1, 2, 3, 4, 7, 15, 1, 3, 1, 16, 3, 1, 3, 6, 1, 9, 8, 4, 1, 2, 1, 19, 2, 10, 2, 7, 1, 3, 1, 21, 1, 4, 4, 22, 10, 6, 1, 3, 2, 12, 11, 24, 4, 2, 1, 4, 4
Offset: 1
Examples
a(26) = ceiling(GPF(26)/LPF(26)) = ceiling(13/2) = 7.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Maple
A120454 := proc(n) local ifs ; if n = 1 then RETURN(1) ; else ifs := ifactors(n)[2] ; RETURN( ceil(op(1,op(-1,ifs))/op(1,op(1,ifs))) ) ; fi ; end ; for n from 1 to 100 do printf("%d, ",A120454(n)) ; od ; # R. J. Mathar, Dec 16 2006
-
Mathematica
a[n_] := Module[{p = FactorInteger[n][[;;, 1]]}, Ceiling[p[[-1]] / p[[1]]]]; Array[a, 100] (* Amiram Eldar, Oct 24 2024 *)
-
PARI
A120454(n) = if(1==n,1, my(f = factor(n), lpf = f[1, 1], gpf = f[#f~, 1]); ceil(gpf/lpf)); \\ Antti Karttunen, Sep 06 2018
Formula
a(n) = A069897(n) + 1 if n is not a power of a prime (A024619), and 1 otherwise. - Amiram Eldar, Oct 24 2024
Extensions
Corrected and extended by R. J. Mathar, Dec 16 2006
Comments