A083730 Greatest prime^2 factor of n, or a(n)=1 for squarefree n.
1, 1, 1, 4, 1, 1, 1, 4, 9, 1, 1, 4, 1, 1, 1, 4, 1, 9, 1, 4, 1, 1, 1, 4, 25, 1, 9, 4, 1, 1, 1, 4, 1, 1, 1, 9, 1, 1, 1, 4, 1, 1, 1, 4, 9, 1, 1, 4, 49, 25, 1, 4, 1, 9, 1, 4, 1, 1, 1, 4, 1, 1, 9, 4, 1, 1, 1, 4, 1, 1, 1, 9, 1, 1, 25, 4, 1, 1, 1, 4, 9, 1, 1, 4, 1, 1, 1, 4, 1, 9, 1, 4, 1, 1, 1, 4, 1, 49, 9
Offset: 1
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[n_] := If[(pos = Position[(f = FactorInteger[n])[[;; , 2]], ?(# >= 2 &)]) == {}, 1, f[[pos[[-1, 1]], 1]]^2]; Array[a, 100] (* _Amiram Eldar, Nov 14 2020 *)
-
PARI
a(n)=my(f=factor(n)); forstep(i=#f~,1,-1, if(f[i,2]>1, return(f[i,1]^2))); 1 \\ Charles R Greathouse IV, Jul 23 2017
Formula
a(n) = A249740(n)^2. - Amiram Eldar, Feb 11 2021
Comments