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-4 of 4 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

A199936 Total sum of Fibonacci parts in all partitions of n.

Original entry on oeis.org

0, 1, 4, 9, 16, 31, 52, 80, 133, 197, 298, 428, 621, 879, 1230, 1696, 2329, 3142, 4231, 5619, 7447, 9781, 12771, 16553, 21391, 27440, 35089, 44600, 56510, 71232, 89538, 112011, 139759, 173679, 215279, 265840, 327527, 402162, 492703, 601830, 733550, 891634
Offset: 0

Views

Author

Omar E. Pol, Nov 21 2011

Keywords

Examples

			For n = 6 we have:
--------------------------------------
.                         Sum of
Partitions            Fibonacci parts
--------------------------------------
6 .......................... 0
3 + 3 ...................... 6
4 + 2 ...................... 2
2 + 2 + 2 .................. 6
5 + 1 ...................... 6
3 + 2 + 1 .................. 6
4 + 1 + 1 .................. 2
2 + 2 + 1 + 1 .............. 6
3 + 1 + 1 + 1 .............. 6
2 + 1 + 1 + 1 + 1 .......... 6
1 + 1 + 1 + 1 + 1 + 1 ...... 6
------------------------------------
Total ..................... 52
So a(6) = 52.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, [1, 0], `if`(i<1, 0,
          `if`(i>n, 0, ((p, m)-> p +`if`(issqr(m+4) or issqr(m-4),
          [0, p[1]*i], 0))(b(n-i, i), 5*i^2)) +b(n, i-1)))
        end:
    a:= n-> b(n$2)[2]:
    seq(a(n), n=0..50);  # Alois P. Heinz, Feb 01 2017
  • Mathematica
    max = 42; F = Fibonacci; gf = Sum[F[i]*x^F[i]/(1-x^F[i]), {i, 2, max}] / Product[1-x^j, {j, 1, max}] + O[x]^max; CoefficientList[gf, x] (* Jean-François Alcover, Feb 21 2017, after Ilya Gutkovskiy *)
    b[n_, i_] := b[n, i] = If[n==0, {1, 0}, If[i<1, 0, If[i>n, 0, Function[{p, m}, p+If[IntegerQ @ Sqrt[m+4] || IntegerQ @ Sqrt[m-4], {0, p[[1]]*i}, 0] ][b[n-i, i], 5*i^2]]+b[n, i-1]]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Feb 21 2017, after Alois P. Heinz *)

Formula

G.f.: Sum_{i>=2} Fibonacci(i)*x^Fibonacci(i)/(1 - x^Fibonacci(i)) / Product_{j>=1} (1 - x^j). - Ilya Gutkovskiy, Feb 01 2017

Extensions

More terms from Alois P. Heinz, Nov 21 2011

A326982 Total sum of composite parts in all partitions of n.

Original entry on oeis.org

0, 0, 0, 0, 4, 4, 14, 18, 44, 67, 117, 166, 283, 391, 603, 848, 1250, 1702, 2442, 3280, 4565, 6094, 8266, 10878, 14566, 18970, 24953, 32255, 41909, 53619, 68983, 87542, 111496, 140561, 177436, 222125, 278425, 346293, 430951, 533083, 659268, 810948, 997322
Offset: 0

Views

Author

Omar E. Pol, Aug 09 2019

Keywords

Examples

			For n = 6 we have:
--------------------------------------
Partitions                Sum of
of 6                  composite parts
--------------------------------------
6 .......................... 6
3 + 3 ...................... 0
4 + 2 ...................... 4
2 + 2 + 2 .................. 0
5 + 1 ...................... 0
3 + 2 + 1 .................. 0
4 + 1 + 1 .................. 4
2 + 2 + 1 + 1 .............. 0
3 + 1 + 1 + 1 .............. 0
2 + 1 + 1 + 1 + 1 .......... 0
1 + 1 + 1 + 1 + 1 + 1 ...... 0
--------------------------------------
Total ..................... 14
So a(6) = 14.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i=1, [1, 0], b(n, i-1)+
          (p-> p+[0, `if`(isprime(i), 0, p[1]*i)])(b(n-i, min(n-i, i))))
        end:
    a:= n-> b(n$2)[2]:
    seq(a(n), n=0..50);  # Alois P. Heinz, Aug 13 2019
  • Mathematica
    Table[Total[Select[Flatten[IntegerPartitions[n]],CompositeQ]],{n,0,50}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 19 2020 *)
    b[n_, i_] := b[n, i] = If[n == 0 || i == 1, {1, 0}, b[n, i - 1] +
         With[{p = b[n-i, Min[n-i, i]]}, p+{0, If[PrimeQ[i], 0, p[[1]]*i]}]];
    a[n_] := b[n, n][[2]];
    a /@ Range[0, 50] (* Jean-François Alcover, Jun 07 2021, after Alois P. Heinz *)

Formula

a(n) = A194545(n) - A000070(n-1), n >= 1.
a(n) = A066186(n) - A326958(n).

A326958 Total sum of noncomposite parts in all partitions of n.

Original entry on oeis.org

0, 1, 4, 9, 16, 31, 52, 87, 132, 203, 303, 450, 641, 922, 1287, 1792, 2446, 3347, 4488, 6030, 7975, 10538, 13778, 17987, 23234, 29980, 38383, 49015, 62195, 78766, 99137, 124560, 155672, 194158, 241104, 298780, 368747, 454276, 557619, 683132, 834252, 1016955
Offset: 0

Views

Author

Omar E. Pol, Aug 08 2019

Keywords

Examples

			For n = 6 we have:
--------------------------------------
.                         Sum of
Partitions             noncomposite
of 6                       parts
--------------------------------------
6 .......................... 0
3 + 3 ...................... 6
4 + 2 ...................... 2
2 + 2 + 2 .................. 6
5 + 1 ...................... 6
3 + 2 + 1 .................. 6
4 + 1 + 1 .................. 2
2 + 2 + 1 + 1 .............. 6
3 + 1 + 1 + 1 .............. 6
2 + 1 + 1 + 1 + 1 .......... 6
1 + 1 + 1 + 1 + 1 + 1 ...... 6
------------------------------------
Total ..................... 52
So a(6) = 52.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i=1, [1, n], b(n, i-1)+
          (p-> p+[0, `if`(isprime(i), p[1]*i, 0)])(b(n-i, min(n-i, i))))
        end:
    a:= n-> b(n$2)[2]:
    seq(a(n), n=0..50);  # Alois P. Heinz, Aug 13 2019
  • Mathematica
    b[n_, i_] := b[n, i] = If[n==0 || i==1, {1, n}, b[n, i-1] + # + {0, If[PrimeQ[i], #[[1]] i, 0]}&[b[n-i, Min[n-i, i]]]];
    a[n_] := b[n, n][[2]];
    a /@ Range[0, 50] (* Jean-François Alcover, Nov 17 2020, after Alois P. Heinz *)

Formula

a(n) = A073118(n) + A000070(n-1), n >= 1.
a(n) = A066186(n) - A326982(n).
Showing 1-4 of 4 results.