OFFSET
1,3
LINKS
Felix Huber, Table of n, a(n) for n = 1..10000
FORMULA
a(p) = 1 for primes p != 3.
EXAMPLE
a(6) = 4 because exactly the 4 nonempty subsets {1}, {1, 3}, {1, 2, 6} and {3, 6} of the divisors of 6 sum to a perfect square: 1 = 1^2, 1 + 3 = 2^2, 1 + 2 + 6 = 3^2.
MAPLE
MATHEMATICA
a[n_]:=Module[{nb = 0, d = Divisors[n]}, Length[Select[Subsets[d], IntegerQ[Sqrt[Total[#]]]&]]]-1; Array[a, 82] (* James C. McMahon, Jul 27 2025 *)
PROG
(PARI) a(n) = my(nb=0, d=divisors(n)); forsubset(#d, s, nb+=issquare(sum(i=1, #s, d[s[i]]))); nb-1; \\ Michel Marcus, Jul 22 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Huber, Jul 21 2025
STATUS
approved
