A066965 Duplicate of A066966.
0, 2, 2, 10, 12, 30, 40, 82, 110, 190, 260, 422, 570, 860, 1160, 1690, 2252, 3170, 4190
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
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 *)
First 5 rows: 1 1 0 1 0 1 2 0 1 0 2 0 1 0 2 3 0 2 0 2 0. 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; sums of even parts are 0,4,2,0,4,2, respectively, so that the numbers of 0's, 1's, 2s, 3s, 4s, 5s are 0,3,0,2,0,2,0, which is row 5 of the array.
g:=1/product((1-x^(2*j-1))*(1-t^(2*j)*x^(2*j)),j=1..20): gser:=simplify(series(g,x=0,20)): P[0]:=1: for n from 1 to 13 do P[n]:=coeff(gser,x^n) od: for n from 0 to 13 do seq(coeff(P[n],t,j),j=0..n) od; # yields sequence in triangular form - Emeric Deutsch, Feb 17 2006
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 odd parts is (3+1)+(1+1)+(1+1+1+1) = 10.
g:=sum((2*i-1)*x^(2*i-1)/(1-x^(2*i-1)),i=1..50)/product(1-x^j,j=1..50): gser:=series(g,x=0,50): seq(coeff(gser,x^n),n=1..47); # Emeric Deutsch, Feb 19 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]*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*i-1)*x^(2*i-1)/(1-x^(2*i-1)), {i, 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[#]], OddQ]] &, Range[30]] (* Peter J. C. Moses, Mar 14 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+1) 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+1, 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 *)
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] +h[1]*i*(2*(i mod 2)-1)] fi end: a:= n-> b(n, n)[2]: seq(a(n), n=0..60); # Alois P. Heinz, Mar 10 2012
Map[Total[Select[#, OddQ]] - Total[Select[#, EvenQ]] &[Flatten[IntegerPartitions[#]]] &, -1 + Range[30]] (* Peter J. C. Moses, Mar 14 2014 *) max = 60; s = Sum[x^(2i) (x^(2i) - 2i (x-1) - 1)/(x + x^(4i) - (x+1) x^(2i) ), {i, 1, Floor[max/2]}]/QPochhammer[x] + O[x]^max; CoefficientList[s, x] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)
Comments