login
a(n) = the number of ways to express n as a sum d1*(k1!-1) + d2*(k2!-1) + ... + dj*(kj!-1), where all k's are distinct and greater than one and each di is in range [1,ki]; the characteristic function of A219650.
12

%I #11 Nov 08 2013 13:45:42

%S 1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,1,

%T 1,1,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,0,0,

%U 0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1

%N a(n) = the number of ways to express n as a sum d1*(k1!-1) + d2*(k2!-1) + ... + dj*(kj!-1), where all k's are distinct and greater than one and each di is in range [1,ki]; the characteristic function of A219650.

%H Antti Karttunen, <a href="/A230412/b230412.txt">Table of n, a(n) for n = 0..10079</a>

%F a(0)=1 and for n>=1, a(n) = [(A219650(A230413(n-1)) + A230405(A230413(n-1))) = n], where [] stands for Iverson bracket.

%e a(0)=1 as the only solution is an empty sum.

%e 1 can be represented as 1*(2!-1), and this is the only solution, thus a(1) = 1.

%e 2 can be represented (also uniquely) as 2*(2!-1) thus a(2) = 1.

%e 3 and 4 cannot be represented as such a sum, thus a(3) = a(4) = 0.

%e 5 can be represented (uniquely) as 1*(3!-1) thus a(5) = 1.

%e 6 can be represented (uniquely) as 1*(3!-1) + 1*(2!-1), thus a(6) = 1.

%e 7 can be represented (uniquely) as 1*(3!-1) + 2*(2!-1), thus a(7) = 1.

%e 17 can be represented (uniquely) as 3*(3!-1) + 2*(2!-1), thus a(17) = 1.

%o (Scheme, with memoizing definec-macro from _Antti Karttunen_'s IntSeq-library)

%o (definec (A230412 n) (if (zero? n) 1 (let ((k (A230413 (- n 1)))) (if (= (+ (A219650 k) (A230405 k)) n) 1 0))))

%Y The characteristic function of A219650. A219658 gives the positions of zeros.

%Y Together with A230413 (the partial sums) can be used to compute A230414, A230423 and A230424.

%Y This sequence relates to the factorial base representation (A007623) in a similar way as A079559 relates to the binary system.

%K nonn

%O 0

%A _Antti Karttunen_, Nov 02 2013