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.

A102291 Total number of prime parts in all compositions of n.

Original entry on oeis.org

0, 0, 1, 3, 7, 18, 42, 98, 222, 497, 1100, 2413, 5250, 11350, 24398, 52193, 111180, 235949, 499074, 1052502, 2213710, 4644833, 9724492, 20318637, 42376578, 88231765, 183420748, 380755932, 789340736, 1634339217, 3379993922, 6982618822, 14410499598, 29711523105
Offset: 0

Views

Author

Vladeta Jovovic, Feb 19 2005

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, add(a(n-j)+
          `if`(isprime(j), ceil(2^(n-j-1)), 0), j=1..n))
        end:
    seq(a(n), n=0..33);  # Alois P. Heinz, Aug 06 2019
  • Mathematica
    a[n_] := a[n] = If[n==0, 0, Sum[a[n-j] + If[PrimeQ[j], Ceiling[2^(n-j-1)], 0], {j, 1, n}]];
    a /@ Range[0, 33] (* Jean-François Alcover, Oct 30 2020, after Alois P. Heinz *)

Formula

G.f.: Sum_{k>=1} x^prime(k)*(1-x)^2/(1-2*x)^2.
a(n) = Sum_{k=1..floor(n/2)} k * A224344(n,k). - Alois P. Heinz, Aug 06 2019

Extensions

More terms from Joshua Zucker, May 10 2006

A336579 Sum of prime parts, counted without multiplicity, in all compositions of n.

Original entry on oeis.org

0, 0, 2, 7, 14, 38, 83, 193, 421, 917, 1969, 4210, 8908, 18763, 39287, 81940, 170270, 352726, 728663, 1501711, 3088326, 6339424, 12991312, 26583389, 54323352, 110876435, 226057023, 460432903, 936963134, 1905110662, 3870698364, 7858803605, 15945759386
Offset: 0

Views

Author

Alois P. Heinz, Jul 26 2020

Keywords

Examples

			a(4) = 2 + 2 + 2 + 2 + 3 + 3 = 14: 1111, 11(2), 1(2)1, (2)11, (2)2, 1(3), (3)1, 4.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, [p!, 0],
          `if`(i<1, 0, add((p-> [0, `if`(j>0 and isprime(i),
           p[1]*i, 0)]+p)(b(n-i*j, i-1, p+j)/j!), j=0..n/i)))
        end:
    a:= n-> b(n$2, 0)[2]:
    seq(a(n), n=0..38);
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[n == 0, {p!, 0},
         If[i < 1, {0, 0}, Sum[Function[q, {0, If[j > 0 && PrimeQ[i],
         q[[1]]*i, 0]} + q][b[n - i*j, i - 1, p + j]/j!], {j, 0, n/i}]]];
    a[n_] := b[n, n, 0][[2]];
    Table[a[n], {n, 0, 38}] (* Jean-François Alcover, Mar 17 2022, after Alois P Heinz *)
Showing 1-2 of 2 results.