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-2 of 2 results.

A339408 Number of compositions (ordered partitions) of n into an even number of primes.

Original entry on oeis.org

1, 0, 0, 0, 1, 2, 1, 2, 3, 6, 9, 8, 16, 24, 40, 52, 72, 112, 172, 256, 364, 528, 804, 1188, 1757, 2548, 3782, 5614, 8308, 12214, 17979, 26586, 39352, 58044, 85608, 126248, 186630, 275556, 406737, 600066, 885952, 1308250, 1931473, 2850692, 4207952, 6212110, 9171800, 13538980
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 03 2020

Keywords

Examples

			a(8) = 3 because we have [5, 3], [3, 5] and [2, 2, 2, 2].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, t, add(
          b(n-ithprime(j), 1-t), j=1..numtheory[pi](n)))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..55);  # Alois P. Heinz, Dec 03 2020
  • Mathematica
    nmax = 47; CoefficientList[Series[(1/2) (1/(1 - Sum[x^Prime[k], {k, 1, nmax}]) + 1/(1 + Sum[x^Prime[k], {k, 1, nmax}])), {x, 0, nmax}], x]

Formula

G.f.: (1/2) * (1 / (1 - Sum_{k>=1} x^prime(k)) + 1 / (1 + Sum_{k>=1} x^prime(k))).

A339433 Number of compositions (ordered partitions) of n into an odd number of distinct primes.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 6, 1, 6, 1, 6, 6, 6, 1, 12, 7, 12, 12, 12, 13, 12, 12, 18, 18, 132, 19, 132, 25, 18, 24, 252, 30, 258, 31, 264, 156, 486, 37, 498, 157, 504, 276, 738, 175, 738, 288, 750, 528, 984, 307, 1218, 666, 1110, 780, 6378, 679, 6618, 799, 1716, 1272
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 04 2020

Keywords

Examples

			a(10) = 6 because we have [5, 3, 2], [5, 2, 3], [3, 5, 2], [3, 2, 5], [2, 5, 3] and [2, 3, 5].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, irem(p, 2)*p!, (s->
         `if`(s>n, 0, b(n, i+1, p)+b(n-s, i+1, p+1)))(ithprime(i)))
        end:
    a:= n-> b(n, 1, 0):
    seq(a(n), n=0..70);  # Alois P. Heinz, Dec 04 2020
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[n == 0, Mod[p, 2]*p!, Function[s, If[s > n, 0, b[n, i + 1, p] + b[n - s, i + 1, p + 1]]][Prime[i]]];
    a[n_] := b[n, 1, 0];
    Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Feb 26 2022, after Alois P. Heinz *)
Showing 1-2 of 2 results.