login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A365837 Largest proper square divisor of n, for n >= 2; a(1) = 1. 1
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
LINKS
MAPLE
f:= proc(n) local F, t;
if issqr(n) then
n/min(numtheory:-factorset(n))^2
else
F:= ifactors(n)[2];
mul(t[1]^(2*floor(t[2]/2)), t=F)
fi
end proc:
f(1):= 1:
map(f, [$1..100]); # Robert Israel, Nov 20 2023
MATHEMATICA
Join[{1}, Table[Last[Select[Divisors[n], # < n && IntegerQ[Sqrt[#]] &]], {n, 2, 100}]]
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 *)
PROG
(PARI) a(n) = if (n==1, 1, my(d=divisors(n)); vecmax(select(issquare, Vec(d, #d-1)))); \\ Michel Marcus, Oct 17 2023
(Python)
from math import prod
from sympy import factorint
def A365837(n):
if n<=1: return 1
f = factorint(n)
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
CROSSREFS
Sequence in context: A276330 A234957 A327939 * A369669 A155826 A273711
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Oct 17 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 16 08:10 EDT 2024. Contains 374345 sequences. (Running on oeis4.)