login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A066213
Numbers which are sums of squares of some subset of divisors.
4
1, 4, 9, 16, 20, 25, 30, 36, 49, 64, 80, 81, 90, 100, 120, 121, 126, 130, 144, 150, 169, 180, 195, 196, 210, 225, 252, 256, 264, 270, 272, 280, 289, 294, 300, 315, 320, 324, 330, 336, 350, 360, 361, 378, 390, 396, 400, 414, 420, 441, 450, 468, 480, 484, 500
OFFSET
1,2
COMMENTS
If m is in the sequence then so is m*k^2 for k >= 1. - David A. Corneth, Jan 22 2024
LINKS
David A. Corneth, PARI program
EXAMPLE
20 is in the list since 20 = 2^2 + 4^2 and 2 and 4 are divisors of 20
MAPLE
isA066213 := proc(n)
local S, els;
S:=subsets(numtheory[divisors](n));
while not S[finished] do
els:=S[nextvalue]() ;
if add(d^2, d=els) = n then
return true ;
end if ;
end do;
false
end proc:
for n from 1 do
if isA066213(n) then
print(n) ;
end if;
end do: # R. J. Mathar, Oct 09 2023
MATHEMATICA
okQ[k_] := AnyTrue[Subsets[Select[Divisors[k]^2, # <= k&]], Total[#]==k&];
Reap[For[k = 1, k <= 5000, k++, If[okQ[k], Print[k]; Sow[k]]]][[2, 1]] (* Jean-François Alcover, May 27 2024 *)
PROG
(PARI) \\ See PARI link
CROSSREFS
KEYWORD
nonn
AUTHOR
Erich Friedman, Dec 17 2001
EXTENSIONS
Offset 1 from David A. Corneth, Jan 22 2024
STATUS
approved