All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Easy count (Posted on 2014-07-29)
Let S be a set of some positive integers.
We'll call S autonomous if the number of elements in S is itself an element of S. e.g. the set {2,3,5} is autonomous, as is the set {2,7}, but the sets {1, 4} or {2,4,5} are not.

Determine a general formula for the number
of autonomous subsets of {1, 2, 3, ... , n}.

 See The Solution Submitted by Ady TZIDON No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer assisted solution | Comment 1 of 5
Let f(n) be the sought function of n.

f(1) = 0
f(2) = 1  {2}
f(3) = 3  {2}{3}{1,3}
f(4) = 7  {2}{3}{4}{1,3}{1,4}{3,4}{1,2,4}

f(n) = Sigma{i=1 to n-1} C(n-1,i)

10   for N=2 to 12
15     T=0
20     for I=1 to N-1
30        T=T+combi(N-1,I)
40     next
50     print N,T
60   next

finds

`2    13    34    75    156    317    638    1279    25510   51111   102312   2047`

f(n) = 2^(n-1) - 1

 Posted by Charlie on 2014-07-29 14:38:40

 Search: Search body:
Forums (0)