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-10 of 12 results. Next

A089049 Number of ways of writing n as a sum of exactly 4 powers of 2.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 1, 3, 1, 1, 0, 2, 1, 2, 2, 3, 2, 3, 1, 3, 2, 3, 1, 3, 1, 1, 0, 2, 2, 3, 1, 3, 1, 1, 0, 3, 1, 1, 0, 1, 0, 0, 0, 2, 1, 2, 2, 3, 2, 3, 1, 3, 2, 3, 1, 3, 1, 1, 0, 3, 2, 3, 1, 3, 1, 1, 0, 3, 1, 1, 0, 1, 0, 0, 0, 2, 2, 3, 1, 3, 1, 1, 0, 3
Offset: 0

Views

Author

N. J. A. Sloane, Dec 03 2003

Keywords

Comments

The powers do not need to be distinct.

Crossrefs

A089050 Number of ways of writing n as a sum of exactly 5 powers of 2.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 2, 3, 3, 3, 2, 3, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1, 3, 2, 3, 2, 5, 3, 4, 3, 5, 3, 5, 3, 5, 3, 4, 1, 4, 2, 4, 3, 5, 3, 4, 1, 4, 3, 4, 1, 4, 1, 1, 0, 3, 2, 3, 2, 5, 3, 4, 3, 6, 3, 5, 3, 5, 3, 4, 1, 5, 3, 5, 3, 6, 3, 4, 1, 5, 3, 4, 1, 4, 1, 1, 0, 4, 2, 4, 3, 5, 3, 4, 1, 5
Offset: 0

Views

Author

N. J. A. Sloane, Dec 03 2003

Keywords

Comments

The powers do not need to be distinct.

Crossrefs

A089051 Number of ways of writing n as a sum of exactly 6 powers of 2.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 3, 4, 3, 4, 4, 5, 4, 6, 4, 5, 4, 6, 4, 6, 4, 5, 3, 5, 3, 6, 5, 6, 4, 7, 5, 7, 5, 8, 5, 7, 4, 7, 4, 6, 4, 8, 5, 7, 4, 7, 4, 7, 4, 7, 4, 5, 1, 5, 3, 5, 3, 7, 5, 6, 4, 9, 6, 8, 5, 9, 5, 7, 4, 8, 5, 8, 5, 10, 6, 8, 4, 9, 5, 8, 4, 8, 4, 5, 1, 7, 4, 6, 4, 9, 5, 7, 4, 9
Offset: 0

Views

Author

N. J. A. Sloane, Dec 03 2003

Keywords

Comments

The powers do not need to be distinct.

Crossrefs

A089048 Number of ways of writing n as a sum of exactly 3 powers of 2.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 0, 1, 1, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1, 1, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1
Offset: 0

Views

Author

N. J. A. Sloane, Dec 03 2003

Keywords

Comments

The powers do not need to be distinct.

Crossrefs

Programs

  • Maple
    f := proc(n,k) option remember; if k > n then RETURN(0); fi; if k= 0 then if n=0 then RETURN(1) else RETURN(0); fi; fi; if n mod 2 = 1 then RETURN(f(n-1,k-1)); fi; f(n-1,k-1)+f(n/2,k); end; # present sequence is f(n,3)
  • Mathematica
    a[n_] := If[n < 3, 0, ((1 - Mod[n, 2])*(1 - Mod[DigitCount[n, 2, 1], 2]) + 1)*If[Floor[(1/4)*DigitCount[n, 2, 1]] == 0, 1, 0]];
    Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Feb 13 2018, after Reinhard Zumkeller *)

Formula

For n > 2: a(n) = (1 + (1 - A000120(n) mod 2)*(1 - n mod 2)) * 0^floor(A000120(n)/4). - Reinhard Zumkeller, Dec 14 2003

A319922 Number of ways of writing n as a sum of exactly 10 powers of 2.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 4, 4, 5, 6, 5, 6, 6, 7, 8, 9, 8, 10, 9, 10, 11, 13, 11, 14, 12, 13, 12, 15, 12, 16, 14, 16, 14, 18, 15, 19, 17, 21, 18, 22, 17, 22, 18, 22, 19, 25, 19, 24, 20, 25, 21, 28, 21, 27, 21, 26, 19, 27, 20, 26, 19
Offset: 0

Views

Author

Alois P. Heinz, Oct 01 2018

Keywords

Crossrefs

Column k=10 of A089052.
Cf. A000079.

Programs

  • Maple
    h:= proc(n) option remember; `if`(n<1, 0,
          `if`(n=2^ilog2(n), n, h(n-1)))
        end:
    b:= proc(n, i, k) option remember; `if`(n=0, `if`(k=0, 1, 0), `if`(
          k>n or i*k b(n, h(n), 10):
    seq(a(n), n=0..120);

Formula

a(n) = [x^n y^10] 1/Product_{j>=0} (1-y*x^(2^j)).

A073266 Triangle read by rows: T(n,k) is the number of compositions of n as the sum of k integral powers of 2.

Original entry on oeis.org

1, 1, 1, 0, 2, 1, 1, 1, 3, 1, 0, 2, 3, 4, 1, 0, 2, 4, 6, 5, 1, 0, 0, 6, 8, 10, 6, 1, 1, 1, 3, 13, 15, 15, 7, 1, 0, 2, 3, 12, 25, 26, 21, 8, 1, 0, 2, 6, 10, 31, 45, 42, 28, 9, 1, 0, 0, 6, 16, 30, 66, 77, 64, 36, 10, 1, 0, 2, 4, 18, 40, 76, 126, 126, 93, 45, 11, 1, 0, 0, 6, 16, 50, 96, 168, 224, 198, 130, 55, 12, 1
Offset: 1

Views

Author

Antti Karttunen, Jun 25 2002

Keywords

Comments

Upper triangular region of the table A073265 read by rows. - Emeric Deutsch, Feb 04 2005
Also the convolution triangle of A209229. - Peter Luschny, Oct 07 2022

Examples

			T(6,3) = 4 because there are four ordered partitions of 6 into 3 powers of 2, namely: 4+1+1, 1+4+1, 1+1+4 and 2+2+2.
Triangle begins:
  1;
  1, 1;
  0, 2, 1;
  1, 1, 3, 1;
  0, 2, 3, 4, 1;
  0, 2, 4, 6, 5, 1;
		

Crossrefs

Cf. A048298, A073265, A023359 (row sums), A089052 (partitions of n).
T(2n,n) gives A333047.

Programs

  • Maple
    b:= proc(n) option remember; expand(`if`(n=0, 1,
           add(b(n-2^j)*x, j=0..ilog2(n))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n)):
    seq(T(n), n=1..14);  # Alois P. Heinz, Mar 06 2020
    # Uses function PMatrix from A357368. Adds a row above and a column to the left.
    PMatrix(10, n -> if n = 2^ilog2(n) then 1 else 0 fi); # Peter Luschny, Oct 07 2022
  • Mathematica
    m:= 10; T[n_, k_]:= T[n, k]= Coefficient[(Sum[x^(2^j), {j,0,m+1}])^k, x, n]; Table[T[n, k], {n,10}, {k,n}]//Flatten (* G. C. Greubel, Mar 06 2020 *)

Formula

T(n, k) = coefficient of x^n in the formal power series (x + x^2 + x^4 + x^8 + x^16 + ...)^k. - Emeric Deutsch, Feb 04 2005
T(0, k) = T(n, 0) = 0, T(n, k) = 0 if k > n, T(n, 1) = 1 if n = 2^m, 0 otherwise and in other cases T(n, k) = Sum_{i=0..floor(log_2(n-1))} T(n-(2^i), k-1). - Emeric Deutsch, Feb 04 2005
Sum_{k=0..n} T(n,k) = A023359(n). - Philippe Deléham, Nov 04 2006

A089053 Triangle read by rows: T(n,k) (n >= 1, 1 <= k <= n) = number of partitions of n into exactly k powers of 2.

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 0, 0, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 2, 2, 2, 2, 2, 1, 1, 1, 0, 0, 1, 2, 2, 2, 2, 2, 1, 1, 1, 0, 1, 2, 2, 3, 3, 2, 2, 2, 1, 1, 1, 0, 0, 1, 2, 2, 3, 3, 2, 2, 2, 1, 1, 1, 0, 0, 1, 3, 3, 3, 4, 3, 2, 2, 2, 1, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Dec 03 2003

Keywords

Crossrefs

See A089052, which is the main entry for this triangle.

Programs

  • Mathematica
    T[n_, k_] := T[n, k] = Which[k > n, 0, k == 0, If[n == 0, 1, 0], Mod[n, 2] == 1, T[n - 1, k - 1], True, T[n - 1, k - 1] + T[n/2, k]];
    Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Mar 07 2021 *)

A342247 Number of partitions of n into seven powers of 2.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 4, 3, 4, 4, 4, 4, 5, 4, 6, 5, 6, 6, 7, 5, 8, 6, 7, 6, 8, 5, 7, 5, 7, 6, 9, 6, 9, 7, 9, 7, 11, 8, 10, 7, 10, 7, 10, 6, 11, 8, 10, 7, 12, 7, 10, 7, 11, 7, 10, 5, 9, 5, 8, 5, 10, 7, 10, 6, 11, 9, 12, 8, 14, 9, 11, 7, 13, 8, 12, 8, 14, 10, 13, 8, 15, 9, 13
Offset: 7

Views

Author

Ilya Gutkovskiy, Mar 07 2021

Keywords

Crossrefs

A342248 Number of partitions of n into eight powers of 2.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 4, 4, 4, 5, 4, 5, 5, 6, 6, 7, 6, 8, 7, 8, 8, 10, 7, 10, 8, 9, 7, 10, 7, 10, 9, 11, 9, 12, 9, 13, 11, 14, 10, 14, 10, 13, 10, 14, 11, 15, 10, 15, 12, 15, 10, 17, 11, 14, 10, 15, 9, 13, 8, 14, 10, 14, 10, 16, 11, 16, 12, 18, 14, 18, 11, 18, 13, 17, 12, 20
Offset: 8

Views

Author

Ilya Gutkovskiy, Mar 07 2021

Keywords

Crossrefs

A342249 Number of partitions of n into nine powers of 2.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 4, 4, 5, 5, 5, 5, 6, 6, 8, 7, 8, 8, 9, 8, 11, 10, 11, 10, 12, 9, 12, 10, 12, 10, 14, 11, 14, 12, 15, 13, 17, 14, 18, 14, 17, 13, 18, 14, 19, 15, 19, 15, 20, 15, 21, 17, 21, 14, 21, 15, 19, 13, 20, 14, 19, 14, 22, 16, 21, 16, 24, 18, 24, 18, 25
Offset: 9

Views

Author

Ilya Gutkovskiy, Mar 07 2021

Keywords

Crossrefs

Showing 1-10 of 12 results. Next