|
|
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).
|
|
50
|
|
|
0, 1, 2, 3, 6, 7, 8, 9, 24, 25, 26, 27, 30, 31, 32, 33, 120, 121, 122, 123, 126, 127, 128, 129, 144, 145, 146, 147, 150, 151, 152, 153, 720, 721, 722, 723, 726, 727, 728, 729, 744, 745, 746, 747, 750, 751, 752, 753, 840, 841, 842, 843, 846, 847, 848, 849, 864, 865
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Numbers that are sums of distinct factorials (0! and 1! not treated as distinct).
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).
The inversion set of finite permutation a(n) interpreted as a binary number (compare A211362) is A211364(n).
(End)
|
|
LINKS
|
|
|
FORMULA
|
G.f. 1/(1-x) * Sum_{k>=0} (k+1)!*x^2^k/(1+x^2^k). - Ralf Stephan, Jun 24 2003
(End)
a(n) = a(n - mbs(n)) + (1 + floor(log(n) / log(2)))!. - David A. Corneth, Aug 21 2016
|
|
EXAMPLE
|
128 is in the sequence since 5! + 3! + 2! = 128.
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
|
|
MAPLE
|
[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;
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;
|
|
MATHEMATICA
|
|
|
PROG
|
(Haskell)
import Data.List (elemIndices)
a059590 n = a059590_list !! n
a059590_list = elemIndices 1 $ map a115944 [0..]
(PARI) a(n) = if(n>0, a(n-msb(n)) + (1+logint(n, 2))!, 0)
msb(n) = 2^#binary(n)>>1
{my(b = binary(n)); sum(i=1, #b, b[i]*(#b+1-i)!)} \\ David A. Corneth, Aug 21 2016
(Python)
def facbase(k, f):
return sum(f[i] for i, bi in enumerate(bin(k)[2:][::-1]) if bi == "1")
def auptoN(N): # terms up to N factorial-base digits; 13 generates b-file
f = [factorial(i) for i in range(1, N+1)]
return list(facbase(k, f) for k in range(2**N))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Name changed (to emphasize the functional nature of the sequence) with the old definition moved to the comments by Antti Karttunen, Aug 21 2016
|
|
STATUS
|
approved
|
|
|
|