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.

Showing 1-1 of 1 results.

A357534 Number of compositions (ordered partitions) of n into two or more powers of 2.

Original entry on oeis.org

0, 0, 1, 3, 5, 10, 18, 31, 55, 98, 174, 306, 542, 956, 1690, 2983, 5271, 9310, 16448, 29050, 51318, 90644, 160118, 282826, 499590, 882468, 1558798, 2753448, 4863696, 8591212, 15175514, 26805983, 47350055, 83639030, 147739848, 260967362, 460972286, 814260544, 1438308328
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 02 2022

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember;
          `if`(n=0, 1, add(b(n-2^i), i=0..ilog2(n)))
        end:
    a:= n-> b(n)-`if`(2^ilog2(n)=n, 1, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, Oct 02 2022
  • Mathematica
    b[n_] := b[n] = If[n == 0, 1, Sum[b[n - 2^i], {i, 0, Floor@ Log2[n]}]];
    a[n_] :=  b[n] - If[2^Floor@Log2[n] == n, 1, 0];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Dec 26 2022, after Alois P. Heinz *)

Formula

a(n) = A023359(n) - A209229(n) for n > 0.
Showing 1-1 of 1 results.