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 A327474 #13 Feb 22 2023 21:24:12 %S A327474 1,2,4,6,10,16,26,38,56,78,106,138,180,226,284,348,420,500,596,698, %T A327474 818,946,1086,1236,1408,1588,1788,2000,2230,2472,2742,3020,3328,3652, %U A327474 3996,4356,4740,5136,5568,6018,6492,6982,7512,8054,8638,9242,9870,10520,11216 %N A327474 Number of distinct means of subsets of {1..n}, where {} has mean 0. %F A327474 a(n) = A135342(n) + 1. %F A327474 a(n) = 2*a(n-1) - a(n-2) + phi(n-1) for n>3. - _Chai Wah Wu_, Feb 22 2023 %e A327474 The a(3) = 6 distinct means are 0, 1, 3/2, 2, 5/2, 3. %p A327474 a:= proc(n) option remember; `if`(n<4, [1, 2, 4, 6][n+1], %p A327474 2*a(n-1)-a(n-2)+numtheory[phi](n-1)) %p A327474 end: %p A327474 seq(a(n), n=0..50); # _Alois P. Heinz_, Feb 22 2023 %t A327474 Table[Length[Union[Mean/@Subsets[Range[n]]]],{n,0,10}] %o A327474 (Python) %o A327474 from itertools import count, islice %o A327474 from sympy import totient %o A327474 def A327474_gen(): # generator of terms %o A327474 a, b = 4, 6 %o A327474 yield from (1,2,4,6) %o A327474 for n in count(3): %o A327474 a, b = b, (b<<1)-a+totient(n) %o A327474 yield b %o A327474 A327474_list = list(islice(A327474_gen(),30)) # _Chai Wah Wu_, Feb 22 2023 %Y A327474 The version for only nonempty subsets is A135342. %Y A327474 Cf. A000016, A051293, A065795, A082550, A327475, A327481. %K A327474 nonn %O A327474 0,2 %A A327474 _Gus Wiseman_, Sep 13 2019