This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A365837 #42 Nov 20 2023 15:31:03 %S A365837 1,1,1,1,1,1,1,4,1,1,1,4,1,1,1,4,1,9,1,4,1,1,1,4,1,1,9,4,1,1,1,16,1,1, %T A365837 1,9,1,1,1,4,1,1,1,4,9,1,1,16,1,25,1,4,1,9,1,4,1,1,1,4,1,1,9,16,1,1,1, %U A365837 4,1,1,1,36,1,1,25,4,1,1,1,16,9,1,1,4,1,1,1,4,1,9,1,4,1,1,1,16,1,49,9,25 %N A365837 Largest proper square divisor of n, for n >= 2; a(1) = 1. %H A365837 Robert Israel, <a href="/A365837/b365837.txt">Table of n, a(n) for n = 1..10000</a> %p A365837 f:= proc(n) local F, t; %p A365837 if issqr(n) then %p A365837 n/min(numtheory:-factorset(n))^2 %p A365837 else %p A365837 F:= ifactors(n)[2]; %p A365837 mul(t[1]^(2*floor(t[2]/2)),t=F) %p A365837 fi %p A365837 end proc: %p A365837 f(1):= 1: %p A365837 map(f, [$1..100]); # _Robert Israel_, Nov 20 2023 %t A365837 Join[{1}, Table[Last[Select[Divisors[n], # < n && IntegerQ[Sqrt[#]] &]], {n, 2, 100}]] %t A365837 f[p_, e_] := p^(2*Floor[e/2]); a[n_] := Module[{fct = FactorInteger[n]}, Times @@ f @@@ fct/If[AllTrue[fct[[;; , 2]], EvenQ], fct[[1, 1]]^2, 1]]; Array[a, 100] (* _Amiram Eldar_, Oct 19 2023 *) %o A365837 (PARI) a(n) = if (n==1, 1, my(d=divisors(n)); vecmax(select(issquare, Vec(d, #d-1)))); \\ _Michel Marcus_, Oct 17 2023 %o A365837 (Python) %o A365837 from math import prod %o A365837 from sympy import factorint %o A365837 def A365837(n): %o A365837 if n<=1: return 1 %o A365837 f = factorint(n) %o A365837 return prod(p**(e&-2) for p, e in f.items())//(min(f)**2 if all(e&1^1 for e in f.values()) else 1) # _Chai Wah Wu_, Oct 20 2023 %Y A365837 Cf. A008833, A032742, A063928, A085392, A089384, A093803, A366524. %K A365837 nonn %O A365837 1,8 %A A365837 _Ilya Gutkovskiy_, Oct 17 2023