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 A327475 #13 Jan 13 2024 17:05:26 %S A327475 1,2,3,6,9,16,27,46,77,136,239,426,769,1400,2571,4762,8857,16568, %T A327475 31139,58734,111165,211044,401695,766418,1465489,2807672,5388783, %U A327475 10359850,19946833,38459624,74251095,143524762,277742489,538043664,1043333935,2025040766,3933915349 %N A327475 Number of subsets of {1..n} whose mean is an integer, where {} has mean 0. %F A327475 a(n) = A051293(n) + 1. %e A327475 The a(0) = 1 through a(5) = 16 subsets: %e A327475 {} {} {} {} {} {} %e A327475 {1} {1} {1} {1} {1} %e A327475 {2} {2} {2} {2} %e A327475 {3} {3} {3} %e A327475 {1,3} {4} {4} %e A327475 {1,2,3} {1,3} {5} %e A327475 {2,4} {1,3} %e A327475 {1,2,3} {1,5} %e A327475 {2,3,4} {2,4} %e A327475 {3,5} %e A327475 {1,2,3} %e A327475 {1,3,5} %e A327475 {2,3,4} %e A327475 {3,4,5} %e A327475 {1,2,4,5} %e A327475 {1,2,3,4,5} %p A327475 with(numtheory): %p A327475 b:= n-> add(2^(n/d)*phi(d), d=select(x-> x::odd, divisors(n)))/n: %p A327475 a:= proc(n) option remember; `if`(n=0, 1, b(n)-1+a(n-1)) end: %p A327475 seq(a(n), n=0..36); # _Alois P. Heinz_, Jan 13 2024 %t A327475 Table[Length[Select[Subsets[Range[n]],#=={}||IntegerQ[Mean[#]]&]],{n,0,10}] %o A327475 (Python) %o A327475 from sympy import totient, divisors %o A327475 def A327475(n): return sum((sum(totient(d)<<k//d-1 for d in divisors(k>>(~k&k-1).bit_length(),generator=True))<<1)//k for k in range(1,n+1))-n+1 # _Chai Wah Wu_, Feb 22 2023 %Y A327475 If the subset is required to contain n, we get A063776. %Y A327475 Cf. A000016, A051293, A065795, A082550, A135342, A327474, A327481. %K A327475 nonn %O A327475 0,2 %A A327475 _Gus Wiseman_, Sep 13 2019