A327477 Number of subsets of {1..n} containing n whose mean is not an element.
0, 0, 1, 2, 6, 12, 26, 54, 112, 226, 460, 930, 1876, 3780, 7606, 15288, 30720, 61680, 123786, 248346, 498072, 998636, 2001826, 4011942, 8039072, 16106124, 32263876, 64623330, 129424236, 259179060, 518975176, 1039104990, 2080374784, 4164816708, 8337289456
Offset: 0
Keywords
Examples
The a(1) = 1 through a(5) = 12 subsets: {1,2} {1,3} {1,4} {1,5} {2,3} {2,4} {2,5} {3,4} {3,5} {1,2,4} {4,5} {1,3,4} {1,2,5} {1,2,3,4} {1,4,5} {2,3,5} {2,4,5} {1,2,3,5} {1,2,4,5} {1,3,4,5} {2,3,4,5}
Crossrefs
Programs
-
Mathematica
Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&!MemberQ[#,Mean[#]]&]],{n,0,10}]
-
Python
from sympy import totient, divisors def A327477(n): return (1<
>(~n&n-1).bit_length(),generator=True))//n if n else 0 # Chai Wah Wu, Feb 21 2023
Formula
From Alois P. Heinz, Feb 21 2023: (Start)
a(n) = 2^(n-1) - A000016(n) for n>=1. (End)
Extensions
a(25)-a(34) from Alois P. Heinz, Feb 21 2023