|
%I
%S 0,1,2,3,6,7,8,9,24,25,26,27,30,31,32,33,120,121,122,123,126,127,128,
%T 129,144,145,146,147,150,151,152,153,720,721,722,723,726,727,728,729,
%U 744,745,746,747,750,751,752,753,840,841,842,843,846,847,848,849,864,865
%N Sum of distinct factorials (0! and 1! not treated as distinct).
%C Complement of A115945; A115944(a(n)) > 0; A115647 is a subsequence. - _Reinhard Zumkeller_, Feb 02 2006
%C A115944(a(n)) = 1. [_Reinhard Zumkeller_, Dec 04 2011]
%C From _Tilman Piesk_, Jun 04 2012: (Start)
%C The inversion vector (compare A007623) of finite permutation a(n) (compare A055089, A195663) has only zeros and ones. Interpreted as a binary number it is 2*n (or n when the inversion vector is defined without the leading 0).
%C The inversion set of finite permutation a(n) interpreted as a binary number (compare A211362) is A211364(n).
%C (End)
%H _Reinhard Zumkeller_, <a href="/A059590/b059590.txt">Table of n, a(n) for n = 0..500</a>
%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>
%F G.f. 1/(1-x) * sum(k>=0, (k+1)!x^2^k/(1+x^2^k)). - _Ralf Stephan_, Jun 24 2003
%F a(n)=Sum_k>=0 {A030308(n,k)*A000142(k+1)}. - From Philippe Deléham, Oct 15 2011.
%e 128 is in the sequence since 5!+3!+2!=128
%p [seq(bin2facbase(j),j=0..64)]; bin2facbase := proc(n) local i; add((floor(n/(2^i)) mod 2)*((i+1)!),i=0..floor_log_2(n)); end;
%p floor_log_2 := proc(n) local nn,i; nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi; nn := floor(nn/2); od; end;
%t a[n_] := Reverse[id = IntegerDigits[n, 2]].Range[Length[id]]!; Table[a[n], {n, 0, 60}] (* _Jean-François Alcover_, Jun 19 2012, after Philippe Deléham *)
%o (Haskell)
%o import Data.List (elemIndices)
%o a059590 n = a059590_list !! n
%o a059590_list = elemIndices 1 $ map a115944 [0..]
%o -- _Reinhard Zumkeller_, Dec 04 2011
%Y Cf. A014597, A051760, A051761, A059589, A060112 (sums of distinct non-consecutive factorials). Subset of A060132.
%Y Other sequences that are built by replacing 2^k in the binary representation with other numbers: A029931 (naturals), A089625 (primes), A022290 (Fibonacci).
%Y Cf. A025494 (subsequence).
%K nonn
%O 0,3
%A _Henry Bottomley_, Jan 24 2001
|