A066964 Duplicate of A066967.
1, 2, 7, 10, 23, 36, 65, 94, 160, 230, 356, 502, 743, 1030, 1480, 2006, 2797, 3760
Offset: 1
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.
a(3)=9 because the partitions of 3 are: 3, 2+1 and 1+1+1; and (3) + (2+1) + (1+1+1) = 9. a(4)=20 because A000041(4)=5 and 4*5=20.
a066186 = sum . concat . ps 1 where ps _ 0 = [[]] ps i j = [t:ts | t <- [i..j], ts <- ps t (j - t)] -- Reinhard Zumkeller, Jul 13 2013
with(combinat): a:= n-> n*numbpart(n): seq(a(n), n=0..50); # Zerinvary Lajos, Apr 25 2007
PartitionsP[ Range[0, 60] ] * Range[0, 60]
a(n)=numbpart(n)*n \\ Charles R Greathouse IV, Mar 10 2012
from sympy import npartitions def A066186(n): return n*npartitions(n) # Chai Wah Wu, Oct 22 2023
[n*Partitions(n).cardinality() for n in range(41)] # Peter Luschny, Jul 29 2014
First 5 rows: 1; 0, 1; 1, 0, 1; 0, 1, 0, 2; 2, 0, 1, 0, 2; 0, 2, 0, 2, 0, 3. The partitions of 5 are 5, 1+4, 2+3, 1+1+3, 1+2+2, 1+1+1+2, 1+1+1+1+1. The sums of odd parts are 5,1,3,5,1,3,5, respectively, so that the numbers of 0's, 1's, 2s, 3s, 4s, 5s are 0,2,0,2,0,3, which is row 5 of the array.
g := 1/product((1-t^(2*j-1)*x^(2*j-1))*(1-x^(2*j)),j=1..20): gser := simplify(series(g,x=0,22)): P[0] := 1: for n from 1 to 14 do P[n] := coeff(gser,x^n) od: for n from 0 to 14 do seq(coeff(P[n],t,j),j=0..n) od; # yields sequence in triangular form - Emeric Deutsch, Feb 17 2006
The prime indices of 198 are {1,2,2,5}, so a(198) = 1+5 = 6.
Table[Total[Cases[FactorInteger[n], {p_?(OddQ@*PrimePi),k_}:>PrimePi[p]*k]],{n,100}]
a(4) = 8 because in the partitions of 4, namely [4],[3,1],[2,2],[2,1,1],[1,1,1,1], we have a total of 0+2+0+2+4=8 odd parts.
a066897 = p 0 1 where p o _ 0 = o p o k m | m < k = 0 | otherwise = p (o + mod k 2) k (m - k) + p o (k + 1) m -- Reinhard Zumkeller, Mar 09 2012
a066897 = length . filter odd . concat . ps 1 where ps _ 0 = [[]] ps i j = [t:ts | t <- [i..j], ts <- ps t (j - t)] -- Reinhard Zumkeller, Jul 13 2013
g:=sum(x^(2*j-1)/(1-x^(2*j-1)),j=1..70)/product(1-x^j,j=1..70): gser:=series(g,x=0,45): seq(coeff(gser,x^n),n=1..44); # Emeric Deutsch, Mar 13 2006 b:= proc(n, i) option remember; local f, g; if n=0 or i=1 then [1, n] else f:= b(n, i-1); g:= `if`(i>n, [0, 0], b(n-i, i)); [f[1]+g[1], f[2]+g[2]+ (i mod 2)*g[1]] fi end: a:= n-> b(n, n)[2]: seq(a(n), n=1..50); # Alois P. Heinz, Mar 22 2012
f[n_, i_] := Count[Flatten[IntegerPartitions[n]], i] o[n_] := Sum[f[n, i], {i, 1, n, 2}] e[n_] := Sum[f[n, i], {i, 2, n, 2}] Table[o[n], {n, 1, 45}] (* A066897 *) Table[e[n], {n, 1, 45}] (* A066898 *) %% - % (* A209423 *) (* Clark Kimberling, Mar 08 2012 *) b[n_, i_] := b[n, i] = Module[{f, g}, If[n==0 || i==1, {1, n}, f = b[n, i-1]; g = If[i>n, {0, 0}, b[n-i, i]]; {f[[1]] + g[[1]], f[[2]] + g[[2]] + Mod[i, 2]*g[[1]]}] ]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Sep 26 2015, after Alois P. Heinz *)
Triangle begins: 1 1 1 1 1 2 2 1 2 2 2 3 3 2 2 4 3 4 3 5 5 3 4 4 6 5 6 6 5 8 7 5 6 8 6 10 7 10 9 10 8 12 11 7 10 12 12 10 15 11 14 15 15 16 12 18 15 11 14 20 18 20 15 22 15 22 21 25 24 24 18 27 Row n = 8 counts the following partitions: (8) (611) (431) (521) (71) (62) (4211) (41111) (332) (53) (44) (22211) (3221) (32111) (5111) (422) (221111) (2111111) (3311) (2222) (311111) (11111111) Row n = 9 counts the following partitions: (81) (63) (54) (72) (9) (621) (6111) (522) (5211) (711) (441) (432) (4311) (3321) (531) (4221) (42111) (411111) (321111) (51111) (22221) (3222) (32211) (21111111) (333) (222111) (2211111) (33111) (3111111) (111111111)
Table[Length[Select[IntegerPartitions[n], Total[Select[#,OddQ]]==k&]],{n,0,15},{k,Mod[n,2],n,2}]
First few rows of the triangle = 1; 1; 1, 1; 2, 1; 2, 1, 2; 3, 2, 2; 4, 2, 2, 3; 5, 3, 4, 3; 6, 4, 4, 3, 5; 8, 5, 6, 6, 5; 10, 6, 8, 6, 5, 7; 12, 8, 10, 9, 10, 7; 15, 10, 12, 12, 10, 7, 11; 18, 12, 16, 15, 15, 14, 11; 22, 15, 20, 18, 20, 14, 11, 15; ... From _Gus Wiseman_, Oct 23 2023: (Start) Row n = 9 counts the following partitions: (9) (72) (54) (63) (81) (711) (5211) (522) (6111) (621) (531) (3321) (4311) (432) (441) (51111) (321111) (411111) (42111) (4221) (333) (21111111) (32211) (3222) (22221) (33111) (2211111) (222111) (3111111) (111111111) (End)
Table[Length[Select[IntegerPartitions[n],Total[Select[#,EvenQ]]==k&]],{n,0,15},{k,0,n,2}] (* Gus Wiseman, Oct 23 2023 *)
a(4) = 10 because in the partitions of 4, namely [4],[3,1],[2,2],[2,1,1],[1,1,1,1], the total sum of the even parts is 4+2+2+2 = 10.
g:=sum(2*j*x^(2*j)/(1-x^(2*j)),j=1..55)/product(1-x^j,j=1..55): gser:=series(g,x=0,45): seq(coeff(gser,x^n),n=1..41); # Emeric Deutsch, Feb 20 2006 b:= proc(n, i) option remember; local f, g; if n=0 or i=1 then [1, 0] else f:= b(n, i-1); g:= `if`(i>n, [0, 0], b(n-i, i)); [f[1]+g[1], f[2]+g[2]+ ((i+1) mod 2)*g[1]*i] fi end: a:= n-> b(n, n)[2]: seq(a(n), n=1..50); # Alois P. Heinz, Mar 22 2012
max = 50; g = Sum[2*j*x^(2*j)/(1 - x^(2*j)), {j, 1, max}]/Product[1 - x^j, {j, 1, max}]; gser = Series[g, {x, 0, max}]; a[n_] := SeriesCoefficient[gser, {x, 0, n}]; Table[a[n], {n, 1, max - 1}] (* Jean-François Alcover, Jan 24 2014, after Emeric Deutsch *) Map[Total[Select[Flatten[IntegerPartitions[#]], EvenQ]] &, Range[30]] (* Peter J. C. Moses, Mar 14 2014 *)
a(n) = 2*sum(k=1, floor(n/2), sigma(k)*numbpart(n-2*k) ); \\ Joerg Arndt, Jan 24 2014
b:= proc(n, i) option remember; local g, h; if n=0 then [1, 0] elif i<1 then [0, 0] else g:= b(n, i-1); h:= `if`(i>n, [0, 0], b(n-i, i)); [g[1]+h[1], g[2]+h[2] +(i mod 2)*h[1]*i] fi end: a:= n-> b(n, n)[2] -`if`(n=1, 0, b(n-1, n-1)[2]): seq(a(n), n=1..60); # Alois P. Heinz, Mar 16 2012
b[n_, i_] := b[n, i] = Module[{g, h}, Which[n == 0, {1, 0}, i < 1, {0, 0}, True, g = b[n, i-1]; h = If[i > n, {0, 0}, b[n-i, i]]; {g[[1]] + h[[1]], g[[2]] + h[[2]] + Mod[i, 2]*h[[1]]*i}]]; a[n_] := b[n, n][[2]] - If[n == 1, 0, b[n-1, n-1][[2]]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Feb 16 2017, after Alois P. Heinz *)
Triangle begins: 1; 2, 2; 7, 2, 3; 10, 10, 3, 4; 23, 12, 11, 4, 5; 36, 30, 17, 14, 5, 6;
p:= (f, g)-> zip((x, y)-> x+y, f, g, 0): b:= proc(n, i) option remember; local f, g; if n=0 then [1] elif i=1 then [1, n] else f:= b(n, i-1); g:= `if`(i>n, [0], b(n-i, i)); p (p (f, g), [0$i, g[1]]) fi end: T:= proc(n) local l; l:= b(n, n); seq (add (l[i+2*j+1]*(i+2*j), j=0..(n-i)/2), i=1..n) end: seq (T(n), n=1..14); # Alois P. Heinz, Mar 21 2012
p[f_, g_] := With[{m = Max[Length[f], Length[g]]}, PadRight[f, m, 0] + PadRight[g, m, 0]]; b[n_, i_] := b[n, i] = Module[{f, g}, Which[n == 0, {1}, i == 1, {1, n}, True, f = b[n, i-1]; g = If[i>n, {0}, b[n-i, i]]; p[p[f, g], Append[Array[0&, i], g[[1]]]]]]; T[n_] := Module[{l}, l = b[n, n]; Table[Sum[l[[i+2j+1]]*(i+2j), {j, 0, (n-i)/2}], {i, 1, n}]]; Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, Mar 11 2015, after Alois P. Heinz *)
Comments