cp's OEIS Frontend

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.

A059590 Numbers obtained by reinterpreting base-2 representation of n in the factorial base: a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1).

This page as a plain text file.
%I A059590 #63 Aug 12 2025 12:01:36
%S A059590 0,1,2,3,6,7,8,9,24,25,26,27,30,31,32,33,120,121,122,123,126,127,128,
%T A059590 129,144,145,146,147,150,151,152,153,720,721,722,723,726,727,728,729,
%U A059590 744,745,746,747,750,751,752,753,840,841,842,843,846,847,848,849,864,865
%N A059590 Numbers obtained by reinterpreting base-2 representation of n in the factorial base: a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1).
%C A059590 Numbers that are sums of distinct factorials (0! and 1! not treated as distinct).
%C A059590 Complement of A115945; A115944(a(n)) > 0; A115647 is a subsequence. - _Reinhard Zumkeller_, Feb 02 2006
%C A059590 A115944(a(n)) = 1. - _Reinhard Zumkeller_, Dec 04 2011
%C A059590 From _Tilman Piesk_, Jun 04 2012: (Start)
%C A059590 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 A059590 The inversion set of finite permutation a(n) interpreted as a binary number (compare A211362) is A211364(n).
%C A059590 (End)
%H A059590 Reinhard Zumkeller (terms 0..500) & Antti Karttunen, <a href="/A059590/b059590.txt">Table of n, a(n) for n = 0..8191</a>
%H A059590 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>
%H A059590 <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>
%F A059590 G.f. 1/(1-x) * Sum_{k>=0} (k+1)!*x^2^k/(1+x^2^k). - _Ralf Stephan_, Jun 24 2003
%F A059590 a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1). - _Philippe Deléham_, Oct 15 2011
%F A059590 From _Antti Karttunen_, Aug 19 2016: (Start)
%F A059590 a(0) = 0, a(2n) = A153880(a(n)), a(2n+1) = 1+A153880(a(n)).
%F A059590 a(n) = A225901(A276091(n)).
%F A059590 a(n) = A276075(A019565(n)).
%F A059590 a(A275727(n)) = A276008(n).
%F A059590 A275736(a(n)) = n.
%F A059590 A276076(a(n)) = A019565(n).
%F A059590 A007623(a(n)) = A007088(n).
%F A059590 (End)
%F A059590 a(n) = a(n - mbs(n)) + (1 + floor(log(n) / log(2)))!. - _David A. Corneth_, Aug 21 2016
%e A059590 128 is in the sequence since 5! + 3! + 2! = 128.
%e A059590 a(22) = 128. a(22) = a(6) + (1 + floor(log(16) / log(2)))! = 8 + 5! = 128. Also, 22 = 10110_2. Therefore, a(22) = 1 * 5! + 0 * 4! + 1 * 3! + 1 + 2! + 0 * 0! = 128. - _David A. Corneth_, Aug 21 2016
%p A059590 [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 A059590 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;
%p A059590 # next Maple program:
%p A059590 a:= n-> (l-> add(l[j]*j!, j=1..nops(l)))(Bits[Split](n)):
%p A059590 seq(a(n), n=0..57);  # _Alois P. Heinz_, Aug 12 2025
%t A059590 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 A059590 (Haskell)
%o A059590 import Data.List (elemIndices)
%o A059590 a059590 n = a059590_list !! n
%o A059590 a059590_list = elemIndices 1 $ map a115944 [0..]
%o A059590 -- _Reinhard Zumkeller_, Dec 04 2011
%o A059590 (PARI) a(n) = if(n>0, a(n-msb(n)) + (1+logint(n,2))!, 0)
%o A059590 msb(n) = 2^#binary(n)>>1
%o A059590 {my(b = binary(n)); sum(i=1,#b,b[i]*(#b+1-i)!)} \\ _David A. Corneth_, Aug 21 2016
%o A059590 (Python)
%o A059590 def facbase(k, f):
%o A059590     return sum(f[i] for i, bi in enumerate(bin(k)[2:][::-1]) if bi == "1")
%o A059590 def auptoN(N): # terms up to N factorial-base digits; 13 generates b-file
%o A059590     f = [factorial(i) for i in range(1, N+1)]
%o A059590     return list(facbase(k, f) for k in range(2**N))
%o A059590 print(auptoN(5)) # _Michael S. Branicky_, Oct 15 2022
%Y A059590 Cf. A007088, A007623, A014597, A051760, A051761, A059589.
%Y A059590 Indices of zeros in A257684.
%Y A059590 Cf. A275736 (left inverse).
%Y A059590 Cf. A025494, A060112 (subsequences).
%Y A059590 Cf. A153880, A225901.
%Y A059590 Subsequence of A060132, A256450 and A275804.
%Y A059590 Other sequences that are built by replacing 2^k in the binary representation with other numbers: A029931 (naturals), A089625 (primes), A022290 (Fibonacci), A197433 (Catalans), A276091 (n*n!), A275959 ((2n)!/2). Cf. also A276082 & A276083.
%K A059590 nonn,base
%O A059590 0,3
%A A059590 _Henry Bottomley_, Jan 24 2001
%E A059590 Name changed (to emphasize the functional nature of the sequence) with the old definition moved to the comments by _Antti Karttunen_, Aug 21 2016