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 A385904 #14 Jul 28 2025 09:01:13 %S A385904 1,1,2,2,1,4,1,3,3,2,1,11,1,3,4,5,1,9,1,9,3,3,1,27,2,2,4,8,1,27,1,7,3, %T A385904 2,2,49,1,1,3,22,1,21,1,7,8,3,1,77,2,5,2,4,1,22,2,21,2,1,1,248,1,2,7, %U A385904 11,1,21,1,4,2,17,1,235,1,1,9,7,1,20,1,64,6,1 %N A385904 a(n) is the number of nonempty subsets of the divisors of n that sum to a perfect square. %H A385904 Felix Huber, <a href="/A385904/b385904.txt">Table of n, a(n) for n = 1..10000</a> %F A385904 a(p) = 1 for primes p != 3. %e A385904 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. %p A385904 with(NumberTheory): %p A385904 A385904:=proc(n) %p A385904 local b,l,j; %p A385904 l:=[(Divisors(n))[]]: %p A385904 b:=proc(m,i) %p A385904 option remember; %p A385904 `if`(m=0,1,`if`(i<1,0,b(m,i-1)+`if`(l[i]>m,0,b(m-l[i],i-1)))) %p A385904 end; %p A385904 add(b(j^2,nops(l)),j=1..floor(sqrt(sigma(n)))); %p A385904 end: %p A385904 seq(A385904(n),n=1..82); %t A385904 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 *) %o A385904 (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 %Y A385904 Cf. A000290, A005835, A027750, A119347, A119348, A237290, A385645, A385646. %K A385904 nonn %O A385904 1,3 %A A385904 _Felix Huber_, Jul 21 2025