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.

A073118 Total sum of prime parts in all partitions of n.

Original entry on oeis.org

0, 2, 5, 9, 19, 33, 57, 87, 136, 206, 311, 446, 650, 914, 1284, 1762, 2432, 3276, 4433, 5888, 7824, 10272, 13479, 17471, 22642, 29087, 37283, 47453, 60306, 76112, 95931, 120201, 150338, 187141, 232507, 287591, 355143, 436849, 536347, 656282, 801647, 976095
Offset: 1

Views

Author

Vladeta Jovovic, Aug 24 2002

Keywords

Examples

			From _Omar E. Pol_, Nov 20 2011 (Start):
For n = 6 we have:
--------------------------------------
.                          Sum of
Partitions              prime parts
--------------------------------------
6 .......................... 0
3 + 3 ...................... 6
4 + 2 ...................... 2
2 + 2 + 2 .................. 6
5 + 1 ...................... 5
3 + 2 + 1 .................. 5
4 + 1 + 1 .................. 0
2 + 2 + 1 + 1 .............. 4
3 + 1 + 1 + 1 .............. 3
2 + 1 + 1 + 1 + 1 .......... 2
1 + 1 + 1 + 1 + 1 + 1 ...... 0
--------------------------------------
Total ..................... 33
So a(6) = 33. (End)
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; local h, j, t;
          if n<0 then [0, 0]
        elif n=0 then [1, 0]
        elif i<1 then [0, 0]
        else h:= [0, 0];
             for j from 0 to iquo(n, i) do
               t:= b(n-i*j, i-1);
               h:= [h[1]+t[1], h[2]+t[2]+`if`(isprime(i), t[1]*i*j, 0)]
             od; h
          fi
        end:
    a:= n-> b(n, n)[2]:
    seq(a(n), n=1..50);  # Alois P. Heinz, Nov 20 2011
  • Mathematica
    f[n_] := Apply[Plus, Select[ Flatten[ IntegerPartitions[n]], PrimeQ[ # ] & ]]; Table[ f[n], {n, 1, 41} ]
    a[n_] := Sum[Total[FactorInteger[k][[All, 1]]]*PartitionsP[n-k], {k, 1, n}] - PartitionsP[n-1]; Array[a, 50] (* Jean-François Alcover, Dec 27 2015 *)
  • PARI
    a(n)={sum(k=1, n, vecsum(factor(k)[, 1])*numbpart(n-k))} \\ Andrew Howroyd, Dec 28 2017

Formula

a(n) = Sum_{k=1..n} A008472(k)*A000041(n-k).
G.f.: Sum_{i>=1} prime(i)*x^prime(i)/(1 - x^prime(i)) / Product_{j>=1} (1 - x^j). - Ilya Gutkovskiy, Feb 01 2017

Extensions

Edited and extended by Robert G. Wilson v, Aug 26 2002

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.