OFFSET
1,1
COMMENTS
EXAMPLE
a(1) = 4 is a term because the prime factors of 4 are {2, 2} and 2^2 = 2^2.
a(7) = 240 is a term (the first nonsquare term) because the prime factors of 240 are {2, 2, 2, 2, 3, 5} and 2^2 + 2^2 + 2^2 + 2^2 + 3^2 = 5^2.
1200 is NOT a term because its prime factors are {2, 2, 2, 2, 3, 5, 5} and 2^2 + 2^2 + 2^2 + 2^2 + 3^2 + 5^2 != 5^2.
MATHEMATICA
f[{p_, e_}]:=Table[p^2, e]; lps[k_]:=Last[f/@FactorInteger[k]//Flatten]; sum[k_]:=Total[f/@FactorInteger[k]//Flatten]; Select[Range[30000], !PrimeQ[#]&&sum[#]==2*lps[#]&] (* James C. McMahon, Jan 03 2026 *)
PROG
(PARI) is_a390574(n)={my(f=Vec(factor(n))); f[2][#f[2]]--; return(if(f[1][#f[1]]^2==sum(i=1, #f[1], f[1][i]^2*f[2][i]), 1, 0))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles L. Hohn, Dec 17 2025
STATUS
approved
