%I #20 Nov 10 2023 18:23:32
%S 1,2,3,8,5,36,7,64,81,100,11,144,13,196,225,256,17,324,19,400,441,484,
%T 23,576,625,676,729,784,29,900,31,1024,1089,1156,1225,1296,37,1444,
%U 1521,1600,41,1764,43,1936,2025,2116,47,2304,2401,2500,2601,2704,53,2916
%N a(n) = gcd(n^2, n!).
%F If n is prime then a(n) = n; otherwise, if n <> 4 then a(n) = n^2. - _Zak Seidov_, Dec 28 2009
%F a(n) = n!/A092043(n). - _Johannes W. Meijer_, Jun 04 2016
%F a(n) = n^2 / n^c(n), where c = A010051 for n >= 5. - _Wesley Ivan Hurt_, Nov 10 2023
%p GCDWITHFACTORIAL:=proc(a) local b,i,k:
%p if whattype(a) <> list then RETURN([]); fi:
%p b:=[]:
%p for i to nops(a) do b:=[op(b), gcd(a[i],i!)]: od;
%p RETURN(b);
%p end:
%p A170826 := proc(n): gcd(n^2, n!) end: seq(A170826(n), n=1..54); # _Johannes W. Meijer_, Jun 04 2016
%t Table[GCD[n^2, n!], {n, 54}] (* _Michael De Vlieger_, Jun 05 2016 *)
%o (PARI) a(n)=if(isprime(n),n,if(n==4,8,n^2)) \\ _Charles R Greathouse IV_, Feb 01 2013
%Y Cf. A010051, A092043.
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_, Dec 27 2009