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.

Previous Showing 21-22 of 22 results.

A339427 Number of compositions (ordered partitions) of n into an odd number of powers of 2.

Original entry on oeis.org

0, 1, 1, 1, 4, 4, 9, 17, 26, 50, 88, 150, 274, 478, 841, 1497, 2634, 4650, 8234, 14518, 25654, 45340, 80040, 141414, 249822, 441192, 779422, 1376752, 2431772, 4295678, 7587761, 13402881, 23675186, 41819442, 73869802, 130483966, 230485902, 407130212, 719154602
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 03 2020

Keywords

Examples

			a(5) = 4 because we have [2, 2, 1], [2, 1, 2], [1, 2, 2] and [1, 1, 1, 1, 1].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, t,
          add(b(n-2^i, 1-t), i=0..ilog2(n)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..42);  # Alois P. Heinz, Dec 03 2020
  • Mathematica
    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]

Formula

G.f.: (1/2) * (1 / (1 - Sum_{k>=0} x^(2^k)) - 1 / (1 + Sum_{k>=0} x^(2^k))).
a(n) = (A023359(n) - A339422(n)) / 2.
a(n) = -Sum_{k=0..n-1} A023359(k) * A339422(n-k).

A364525 a(n) is the number of distinct ways to partition the set {1,2,...,n} into nonempty subsets such that the sum of the pi(x)*(pi(x) + 1)/2 values of each subset's size x equals n, where pi() is the prime counting function given by A000720.

Original entry on oeis.org

0, 0, 1, 1, 2, 5, 9, 18, 36, 73, 145, 290, 580, 1159, 2319, 4637, 9273, 18544, 37083, 74157, 148330, 296658, 593311, 1186613, 2373208, 4746380, 9492687, 18985447, 37970821, 75941497, 151882704, 303764828, 607528497, 1215054675, 2430104713, 4860217541
Offset: 1

Views

Author

Robert P. P. McKone, Dec 22 2023

Keywords

Crossrefs

Cf. A000720.
Cf. A166444.
Cf. A365062 (sum of pi(x) + 1 for n>0).

Programs

  • Mathematica
    p[n_] := p[n] = PrimePi[n];
    pv[n_] := pv[n] = p[n]*(p[n] + 1)/2;
    v[n_, k_] := v[n, k] = Module[{c = 0, i = 1}, If[k == 1, Return[If[pv[n] == n, 1, 0]]]; While[i < n - k + 2, If[pv[i] <= n, c += v[n - i, k - 1]]; i++]; c];
    a[n_] := a[n] = Module[{c = 0, k = 1}, While[k <= n, c += v[n, k]; k++]; c]; Table[a[n], {n, 1, 36}]
Previous Showing 21-22 of 22 results.