login
Number of subsets of {1..n} not containing their mean.
6

%I #17 Feb 22 2023 18:04:10

%S 1,1,2,4,10,22,48,102,214,440,900,1830,3706,7486,15092,30380,61100,

%T 122780,246566,494912,992984,1991620,3993446,8005388,16044460,

%U 32150584,64414460,129037790,258462026,517641086,1036616262,2075721252,4156096036,8320912744,16658202200

%N Number of subsets of {1..n} not containing their mean.

%F a(n) = 2^n - A065795(n). - _Alois P. Heinz_, Sep 13 2019

%e The a(1) = 1 through a(5) = 22 subsets:

%e {} {} {} {} {}

%e {1,2} {1,2} {1,2} {1,2}

%e {1,3} {1,3} {1,3}

%e {2,3} {1,4} {1,4}

%e {2,3} {1,5}

%e {2,4} {2,3}

%e {3,4} {2,4}

%e {1,2,4} {2,5}

%e {1,3,4} {3,4}

%e {1,2,3,4} {3,5}

%e {4,5}

%e {1,2,4}

%e {1,2,5}

%e {1,3,4}

%e {1,4,5}

%e {2,3,5}

%e {2,4,5}

%e {1,2,3,4}

%e {1,2,3,5}

%e {1,2,4,5}

%e {1,3,4,5}

%e {2,3,4,5}

%t Table[Length[Select[Subsets[Range[n]],!MemberQ[#,Mean[#]]&]],{n,0,10}]

%o (Python)

%o from sympy import totient, divisors

%o def A327471(n): return (1<<n)-(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))>>1) # _Chai Wah Wu_, Feb 22 2023

%Y Subsets containing their mean are A065795.

%Y Subsets containing n but not their mean are A327477.

%Y Partitions not containing their mean are A327472.

%Y Strict partitions not containing their mean are A240851.

%Y Cf. A000016, A007865, A051293, A067538, A082550, A114639, A135342, A324741, A327476.

%K nonn

%O 0,3

%A _Gus Wiseman_, Sep 12 2019

%E More terms from _Alois P. Heinz_, Sep 13 2019