OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Jean-Marie De Koninck and Rafael Jakimczuk, Summing the largest prime factor over integer sequences, Revista de la Unión Matemática Argentina, Vol. 67, No. 1 (2024), pp. 27-35.
FORMULA
Sum_{A005117(n) <= x} a(n) = Sum_{i=1..k} d_i * x^2/log(x)^i + O(x^2/log(x)^(k+1)), for any given positive integer k, where d_i are constants, d_1 = 15/(2*Pi^2) = 0.759908... (A323669) (De Koninck and Jakimczuk, 2024). - Amiram Eldar, Mar 03 2024
MAPLE
issquarefree := proc(n::integer) local nf, ifa, lar; nf := op(2, ifactors(n)); for ifa from 1 to nops(nf) do lar := op(1, op(ifa, nf)); if op(2, op(ifa, nf)) >= 2 then RETURN(0); fi; od : RETURN(lar); end: printf("1, "); for n from 2 to 100 do lfa := issquarefree(n); if lfa > 0 then printf("%a, ", lfa); fi; od : # R. J. Mathar, Apr 02 2006
MATHEMATICA
FactorInteger[#][[-1, 1]]& /@ Select[Range[100], SquareFreeQ] (* Jean-François Alcover, Feb 01 2018 *)
s[n_] := Module[{f = FactorInteger[n]}, If[AllTrue[f[[;; , 2]], # < 2 &], f[[-1, 1]], Nothing]]; Array[s, 200] (* Amiram Eldar, Mar 03 2024 *)
PROG
(Haskell)
a073482 = a006530 . a005117 -- Reinhard Zumkeller, Feb 04 2012
(PARI) do(x)=my(v=List([1])); forfactored(n=2, x\1, if(vecmax(n[2][, 2])==1, listput(v, vecmax(n[2][, 1])))); Vec(v) \\ Charles R Greathouse IV, Nov 05 2017
(Python)
from math import isqrt
from sympy import mobius, primefactors
def A073482(n):
def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
kmin, kmax = 0, 1
while f(kmax) > kmax:
kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return max(primefactors(kmax), default=1) # Chai Wah Wu, Aug 28 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Aug 03 2002
EXTENSIONS
More terms from Jason Earls, Aug 06 2002
STATUS
approved