login
Greatest prime^2 factor of n, or a(n)=1 for squarefree n.
2

%I #19 Feb 11 2021 03:31:55

%S 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,

%T 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,

%U 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

%N Greatest prime^2 factor of n, or a(n)=1 for squarefree n.

%C Not multiplicative, for example a(4)*a(9) <> a(36). - _R. J. Mathar_, Oct 31 2011

%H Charles R Greathouse IV, <a href="/A083730/b083730.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A249740(n)^2. - _Amiram Eldar_, Feb 11 2021

%t 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 *)

%o (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

%Y Cf. A006530, A001248, A005117, A013929, A008833, A046028, A249740.

%K nonn,easy

%O 1,4

%A _Reinhard Zumkeller_, Jun 14 2003