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.

A339426 Number of compositions (ordered partitions) of n into an even number of powers of 2.

This page as a plain text file.
%I A339426 #6 Dec 03 2020 20:27:16
%S A339426 1,0,1,2,2,6,9,14,30,48,86,156,268,478,849,1486,2638,4660,8214,14532,
%T A339426 25664,45304,80078,141412,249768,441276,779376,1376696,2431924,
%U A339426 4295534,7587753,13403102,23674870,41819588,73870046,130483396,230486384,407130332,719153726
%N A339426 Number of compositions (ordered partitions) of n into an even number of powers of 2.
%H A339426 <a href="/index/Com#comp">Index entries for sequences related to compositions</a>
%F A339426 G.f.: (1/2) * (1 / (1 - Sum_{k>=0} x^(2^k)) + 1 / (1 + Sum_{k>=0} x^(2^k))).
%F A339426 a(n) = (A023359(n) + A339422(n)) / 2.
%F A339426 a(n) = Sum_{k=0..n} A023359(k) * A339422(n-k).
%e A339426 a(5) = 6 because we have [4, 1], [1, 4], [2, 1, 1, 1], [1, 2, 1, 1], [1, 1, 2, 1] and [1, 1, 1, 2].
%p A339426 b:= proc(n, t) option remember; `if`(n=0, t,
%p A339426       add(b(n-2^i, 1-t), i=0..ilog2(n)))
%p A339426     end:
%p A339426 a:= n-> b(n, 1):
%p A339426 seq(a(n), n=0..42);  # _Alois P. Heinz_, Dec 03 2020
%t A339426 nmax = 38; CoefficientList[Series[(1/2) (1/(1 - Sum[x^(2^k), {k, 0, Floor[Log[2, nmax]] + 1}]) + 1/(1 + Sum[x^(2^k), {k, 0, Floor[Log[2, nmax]] + 1}])), {x, 0, nmax}], x]
%Y A339426 Cf. A000079, A023359, A034008, A040039, A339422, A339427.
%K A339426 nonn
%O A339426 0,4
%A A339426 _Ilya Gutkovskiy_, Dec 03 2020