cp's OEIS Frontend

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.

A339666 Number of nonempty subsets of divisors of n whose root-mean-square is an integer.

This page as a plain text file.
%I A339666 #13 Feb 16 2025 08:34:01
%S A339666 1,2,2,3,2,4,3,4,3,4,2,6,2,6,4,5,2,6,2,6,6,4,2,8,3,4,4,9,2,8,2,6,4,4,
%T A339666 7,9,2,4,4,12,3,12,2,6,7,4,2,12,5,6,4,6,2,8,5,12,4,4,2,26,2,4,9,7,4,8,
%U A339666 2,6,4,14,2,12,2,4,6,6,6,8,2,24,5,6,2,22
%N A339666 Number of nonempty subsets of divisors of n whose root-mean-square is an integer.
%H A339666 Alois P. Heinz, <a href="/A339666/b339666.txt">Table of n, a(n) for n = 1..1000</a>
%H A339666 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Root-Mean-Square.html">Root-Mean-Square</a>
%H A339666 <a href="/index/Di#divisors">Index entries for sequences related to divisors of numbers</a>
%e A339666 a(14) = 6 subsets: {1}, {2}, {7}, {14}, {1, 7} and {2, 14}.
%p A339666 a:= proc(n) option remember; uses numtheory; local l, b;
%p A339666       l, b:= sort([divisors(n)[]]),
%p A339666       proc(i, s, c) option remember;
%p A339666         `if`(i=0, `if`(c>0 and issqr(s/c), 1, 0),
%p A339666          b(i-1, s, c)+b(i-1, s+l[i]^2, c+1))
%p A339666       end; forget(b); b(nops(l), 0$2)
%p A339666     end:
%p A339666 seq(a(n), n=1..100);  # _Alois P. Heinz_, Sep 30 2022
%t A339666 a[n_] := a[n] = Module[{b, l = Divisors[n]}, b[i_, s_, c_] := b[i, s, c] = If[i == 0, If[c > 0 && IntegerQ @ Sqrt[s/c], 1, 0], b[i-1, s, c]+b[i-1, s+l[[i]]^2, c+1]]; b[Length[l], 0, 0]];
%t A339666 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Oct 13 2022, after _Alois P. Heinz_ *)
%Y A339666 Cf. A027750, A100587, A339454, A339663, A339664, A339665.
%K A339666 nonn
%O A339666 1,2
%A A339666 _Ilya Gutkovskiy_, Dec 11 2020