A086182 Duplicate of A035294.
1, 2, 4, 6, 10, 15, 22, 32, 46, 64, 89, 122, 165, 222, 296, 390, 512, 668, 864, 1113, 1426
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.
G.f. = 1 + x + x^2 + 2*x^3 + 2*x^4 + 3*x^5 + 4*x^6 + 5*x^7 + 6*x^8 + 8*x^9 + ... G.f. = q + q^25 + q^49 + 2*q^73 + 2*q^97 + 3*q^121 + 4*q^145 + 5*q^169 + ... The partitions of n into distinct parts (see A118457) for small n are: 1: 1 2: 2 3: 3, 21 4: 4, 31 5: 5, 41, 32 6: 6, 51, 42, 321 7: 7, 61, 52, 43, 421 8: 8, 71, 62, 53, 521, 431 ... From _Reinhard Zumkeller_, Jun 13 2009: (Start) a(8)=6, A140207(8)=#{5+2+1,4+3+1}=2, A003056(8)=3, A051162(8)=5; a(9)=8, A140207(9)=#{6+2+1,5+3+1,4+3+2}=3, A003056(9)=3, A051162(9)=6; a(10)=10, A140207(10)=#{4+3+2+1}=1, A003056(10)=4, A051162(10)=4. (End)
import Data.MemoCombinators (memo2, integral) a000009 n = a000009_list !! n a000009_list = map (pM 1) [0..] where pM = memo2 integral integral p p _ 0 = 1 p k m | m < k = 0 | otherwise = pM (k + 1) (m - k) + pM (k + 1) m -- Reinhard Zumkeller, Sep 09 2015, Nov 05 2013
# uses A010815 using Memoize @memoize function A000009(n) n == 0 && return 1 s = sum((-1)^k*A000009(n - k^2) for k in 1:isqrt(n)) A010815(n) - 2*s end # Peter Luschny, Sep 09 2021
Coefficients(&*[1+x^m:m in [1..100]])[1..100] where x is PolynomialRing(Integers()).1; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
N := 100; t1 := series(mul(1+x^k,k=1..N),x,N); A000009 := proc(n) coeff(t1,x,n); end; spec := [ P, {P=PowerSet(N), N=Sequence(Z,card>=1)} ]: [ seq(combstruct[count](spec, size=n), n=0..58) ]; spec := [ P, {P=PowerSet(N), N=Sequence(Z,card>=1)} ]: combstruct[allstructs](spec, size=10); # to get the actual partitions for n=10 A000009 := proc(n) local x,m; product(1+x^m,m=1..n+1) ; expand(%) ; coeff(%,x,n) ; end proc: # R. J. Mathar, Jun 18 2016 lim := 99; # Enlarge if more terms are needed. simplify(expand(QDifferenceEquations:-QPochhammer(-1, x, lim)/2, x)): seq(coeff(%, x, n), n=0..55); # Peter Luschny, Nov 17 2016 # Alternative: a:= proc(n) option remember; `if`(n=0, 1, add(a(n-j)*add( `if`(d::odd, d, 0), d=numtheory[divisors](j)), j=1..n)/n) end: seq(a(n), n=0..55); # Alois P. Heinz, Jun 24 2025
PartitionsQ[Range[0, 60]] (* Harvey Dale, Jul 27 2009 *) a[ n_] := SeriesCoefficient[ Product[ 1 + x^k, {k, n}], {x, 0, n}]; (* Michael Somos, Jul 06 2011 *) a[ n_] := SeriesCoefficient[ 1 / Product[ 1 - x^k, {k, 1, n, 2}], {x, 0, n}]; (* Michael Somos, Jul 06 2011 *) a[ n_] := With[ {t = Log[q] / (2 Pi I)}, SeriesCoefficient[ q^(-1/24) DedekindEta[2 t] / DedekindEta[ t], {q, 0, n}]]; (* Michael Somos, Jul 06 2011 *) a[ n_] := SeriesCoefficient[ 1 / QPochhammer[ x, x^2], {x, 0, n}]; (* Michael Somos, May 24 2013 *) a[ n_] := SeriesCoefficient[ Series[ QHypergeometricPFQ[ {q}, {q x}, q, - q x], {q, 0, n}] /. x -> 1, {q, 0, n}]; (* Michael Somos, Mar 04 2014 *) a[ n_] := SeriesCoefficient[ QHypergeometricPFQ[{}, {}, q, -1] / 2, {q, 0, n}]; (* Michael Somos, Mar 04 2014 *) nmax = 60; CoefficientList[Series[Exp[Sum[(-1)^(k+1)/k*x^k/(1-x^k), {k, 1, nmax}]], {x, 0, nmax}], x] (* Vaclav Kotesovec, Aug 25 2015 *) nmax = 100; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = 1; Do[Do[poly[[j + 1]] += poly[[j - k + 1]], {j, nmax, k, -1}];, {k, 2, nmax}]; poly (* Vaclav Kotesovec, Jan 14 2017 *)
num_distinct_partitions(60,list); /* Emanuele Munarini, Feb 24 2014 */
h(n):=if oddp(n)=true then 1 else 0; S(n,m):=if n=0 then 1 else if nVladimir Kruchinin, Sep 07 2014 */
{a(n) = if( n<0, 0, polcoeff( prod( k=1, n, 1 + x^k, 1 + x * O(x^n)), n))}; /* Michael Somos, Nov 17 1999 */
{a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A) / eta(x + A), n))};
{a(n) = my(c); forpart(p=n, if( n<1 || p[1]<2, c++; for(i=1, #p-1, if( p[i+1] > p[i]+1, c--; break)))); c}; /* Michael Somos, Aug 13 2017 */
lista(nn) = {q='q+O('q^nn); Vec(eta(q^2)/eta(q))} \\ Altug Alkan, Mar 20 2018
# uses A010815 from functools import lru_cache from math import isqrt @lru_cache(maxsize=None) def A000009(n): return 1 if n == 0 else A010815(n)+2*sum((-1)**(k+1)*A000009(n-k**2) for k in range(1,isqrt(n)+1)) # Chai Wah Wu, Sep 08 2021
import numpy as np n = 1000 arr = np.zeros(n,dtype=object) arr[0] = 1 for i in range(1,n): arr[i:] += arr[:n-i] print(arr) # Yigit Oktar, Jul 12 2025
# uses[EulerTransform from A166861] a = BinaryRecurrenceSequence(0, 1) b = EulerTransform(a) print([b(n) for n in range(56)]) # Peter Luschny, Nov 11 2020
G.f. = 1 + 2*x + 5*x^2 + 11*x^3 + 22*x^4 + 42*x^5 + 77*x^6 + 135*x^7 + ... G.f. = q^-1 + 2*q^47 + 5*q^95 + 11*q^143 + 22*q^191 + 42*q^239 + 77*q^287 + ...
a:= n-> combinat[numbpart](2*n): seq(a(n), n=0..42); # Alois P. Heinz, Jan 29 2020
nn=100;Table[CoefficientList[Series[Product[1/(1-x^i),{i,1,nn}],{x,0,nn}],x][[2i-1]],{i,1,nn/2}] (* Geoffrey Critzer, Sep 28 2013 *) (* also *) Table[PartitionsP[2 n], {n, 0, 40}] (* Clark Kimberling, Mar 02 2014 *) (* also *) Table[Count[IntegerPartitions[3 n - 2], p_ /; MemberQ[p, n]], {n, 20}] (* Clark Kimberling, Mar 02 2014 *) nmax = 60; CoefficientList[Series[Product[(1 + x^(8*k-4))*(1 + x^(8*k))*(1 + x^k)^2/((1 + x^(8*k-1))*(1 + x^(8*k-7))*(1 - x^k)), {k, 1, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Nov 17 2016 *)
combinat::partitions::count(2*i) $i=0..54 // Zerinvary Lajos, Apr 16 2007
{a(n) = if( n<0, 0, polcoeff( 1 / eta(x + O(x^(2*n + 1))), 2*n))}; /* Michael Somos, Apr 25 2003 */
a(n) = numbpart(2*n); \\ Michel Marcus, Sep 28 2013
a(3) = 5 because 7 = 1+6 = 2+5 = 3+4 = 1+2+4 (partitions into distinct parts) and 7 = 1+1+5 = 1+3+3 = 1+1+1+1+3 = 1+1+1+1+1+1+1 (partitions into odd parts). [_Wolfdieter Lang_, Jul 08 2012] G.f. = 1 + 2*x + 3*x^2 + 5*x^3 + 8*x^4 + 12*x^5 + 18*x^6 + 27*x^7 + 38*x^8 + ... G.f. = q^25 + 2*q^73 + 3*q^121 + 5*q^169 + 8*q^217 + 12*q^265 + 18*q^313 + ...
import Data.MemoCombinators (memo2, integral) a078408 n = a078408_list !! n a078408_list = f 1 where f x = (p' 1 x) : f (x + 2) p' = memo2 integral integral p p _ 0 = 1 p k m = if m < k then 0 else p' k (m - k) + p' (k + 2) m -- Reinhard Zumkeller, Nov 27 2015
G := 1/(1 - x)*add(x^floor(3*n/2)/mul(1 - x^k, k = 1..n), n = 0..50): S := series(G, x, 76): seq(coeff(S, x, j), j = 0..75); # Peter Bala, Feb 04 2021
a[ n_] := SeriesCoefficient[ QPochhammer[ x^2] / QPochhammer[ x], {x, 0, 2 n + 1}]; (* Michael Somos, Oct 06 2015 *)
{a(n) = my(A); if( n<0, 0, n = 2*n + 1; A = x * O(x^n); polcoeff( eta(x^2 + A) / eta(x + A), n))};
a(10)=3 because we have [10], [6,2,2] and [2,2,2,2,2].
g:=product(1+x^(2*j),j=1..45): gser:=series(g,x=0,85): seq(coeff(gser,x,n),n=0..79); # Emeric Deutsch, Feb 22 2006; a(0) added by Georg Fischer, Dec 10 2020
nn=80;CoefficientList[Series[Product[1+ x^(2i),{i,1,nn}],{x,0,nn}],x] (* Geoffrey Critzer, Jun 20 2014 *) nmax = 50; kmax = nmax/4; s = Range[0, kmax]*4 + 2; Table[Count[IntegerPartitions@n, x_ /; SubsetQ[s, x]], {n, 0, nmax}] (* Robert Price, Aug 03 2020 *)
N=166; S=2+sqrtint(N); x='x+O('x^N); gf=sum(n=0, S, x^(n^2+n)/prod(k=1,n, 1-x^(2*k)) ); Vec(gf) \\ Joerg Arndt, Feb 18 2014
f:=func; [0] cat [f(n*m): m in [-1,1], n in [1..25]]; // Bruno Berselli, Nov 13 2012
a:=n->(2*n+1)*floor((n+1)/2): seq(a(n),n=0..50); # Muniru A Asiru, Feb 01 2019
1/2 * Select[PolygonalNumber@ Range[0, 100], EvenQ] (* Michael De Vlieger, Jun 01 2017, Version 10.4 *) Select[Accumulate[Range[0,100]],EvenQ]/2 (* Harvey P. Dale, Feb 15 2025 *)
a(n)=(2*n+1)*(n-n\2)
a(6) counts these partitions: 51, 42, 2211 which all have an even number of parts, and their medians 3, 3 and 1.5 are not present. Note that the partitions 33 and 3111, although having an even number of parts, are not included in the count of a(6), but instead in that of A238478(6), as their medians, 3 for the former and 1 for the latter, are present in those partitions.
Table[Count[IntegerPartitions[n], p_ /; !MemberQ[p, Median[p]]], {n, 40}] (* also *) Table[Count[IntegerPartitions[n], p_ /; MemberQ[p, Max[p]/2]], {n, 50}]
my(q='q+O('q^50)); concat([0,0], Vec(sum(n=1,17,q^(3*n)/prod(k=1,2*n,1-q^k)))) \\ David Radcliffe, Jun 25 2025
from sympy.utilities.iterables import partitions def A238479(n): return sum(1 for p in partitions(n) if (m:=max(p,default=0))&1^1 and m>>1 in p) # Chai Wah Wu, Sep 21 2023
The a(1) = 1 through a(8) = 16 partitions: (2) (4) (6) (8) (10) (12) (14) (16) (3,2,1) (4,3,1) (5,3,2) (5,4,3) (6,5,3) (7,5,4) (5,2,1) (5,4,1) (6,4,2) (7,4,3) (7,6,3) (6,3,1) (6,5,1) (7,5,2) (8,5,3) (7,2,1) (7,3,2) (7,6,1) (8,6,2) (7,4,1) (8,4,2) (8,7,1) (8,3,1) (8,5,1) (9,4,3) (9,2,1) (9,3,2) (9,5,2) (9,4,1) (9,6,1) (10,3,1) (10,4,2) (11,2,1) (10,5,1) (11,3,2) (11,4,1) (12,3,1) (13,2,1) (6,4,3,2,1)
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, t, add(b(n-i*j, i-1, abs(t-j)), j=0..min(n/i, 1)))) end: a:= n-> b(2*n$2, 0): seq(a(n), n=0..80); # Alois P. Heinz, Aug 05 2021
Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&OddQ[Length[#]]&]],{n,0,30,2}]
For n=3 the partitions of 2n are 6 ....................... does not contains odd parts 3 + 3 ................... contains odd parts ........... * 4 + 2 ................... does not contains odd parts 2 + 2 + 2 ............... does not contains odd parts 5 + 1 ................... contains odd parts ........... * 3 + 2 + 1 ............... contains odd parts ........... * 4 + 1 + 1 ............... contains odd parts ........... * 2 + 2 + 1 + 1 ........... contains odd parts ........... * 3 + 1 + 1 + 1 ........... contains odd parts ........... * 2 + 1 + 1 + 1 + 1 ....... contains odd parts ........... * 1 + 1 + 1 + 1 + 1 + 1 ... contains odd parts ........... * There are 8 partitions of 2n that contain odd parts. Also p(2n)-p(n) = p(6)-p(3) = 11-3 = 8, where p(n) is the number of partitions of n, so a(3)=8. From _Gus Wiseman_, Oct 18 2023: (Start) For n > 0, also the number of integer partitions of 2n that do not contain n, ranked by A366321. For example, the a(1) = 1 through a(4) = 17 partitions are: (2) (4) (6) (8) (31) (42) (53) (1111) (51) (62) (222) (71) (411) (332) (2211) (521) (21111) (611) (111111) (2222) (3221) (3311) (5111) (22211) (32111) (221111) (311111) (2111111) (11111111) (End)
with(combinat): a:= n-> numbpart(2*n) -numbpart(n): seq(a(n), n=0..35);
Table[Length[Select[IntegerPartitions[2n],n>0&&FreeQ[#,n]&]],{n,0,15}] (* Gus Wiseman, Oct 11 2023 *) Table[Length[Select[IntegerPartitions[2n],Or@@OddQ/@#&]],{n,0,15}] (* Gus Wiseman, Oct 11 2023 *)
Triangle begins: 1 0 1 0 1 1 0 2 1 1 0 2 2 1 1 0 3 3 2 1 1 0 3 5 3 2 1 1 0 4 6 5 3 2 1 1 0 4 9 7 5 3 2 1 1 0 5 11 11 7 5 3 2 1 1 0 5 15 14 11 7 5 3 2 1 1 0 6 18 20 15 11 7 5 3 2 1 1 0 6 23 26 22 15 11 7 5 3 2 1 1 0 7 27 35 29 22 15 11 7 5 3 2 1 1 0 7 34 44 40 30 22 15 11 7 5 3 2 1 1 0 8 39 58 52 42 30 22 15 11 7 5 3 2 1 1 0 8 47 71 70 55 42 30 22 15 11 7 5 3 2 1 1 0 9 54 90 89 75 56 42 30 22 15 11 7 5 3 2 1 1 0 9 64 110 116 97 77 56 42 30 22 15 11 7 5 3 2 1 1 0 10 72 136 146 128 100 77 56 42 30 22 15 11 7 5 3 2 1 1 From _Gus Wiseman_, Jun 20 2021: (Start) For example, row n = 6 counts the following partitions (B = 11): (75) (3333) (333111) (33111111) (3111111111) (111111111111) (93) (5331) (531111) (51111111) (B1) (5511) (711111) (7311) (9111) The corresponding strict partitions are: (7,5) (8,4) (9,3) (10,2) (11,1) (12) (6,5,1) (5,4,3) (7,3,2) (9,2,1) (5,4,2,1) (6,4,2) (8,3,1) (7,4,1) (6,3,2,1) The corresponding normal partitions are: 43221 33321 3321111 321111111 21111111111 111111111111 322221 332211 32211111 2211111111 2222211 432111 222111111 3222111 22221111 (End)
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, b(n, i-2)+`if`(i>n, 0, expand(sqrt(x)*b(n-i, i))))) end: T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(2*n, 2*n-1)): seq(T(n), n=0..12); # Alois P. Heinz, Jun 21 2021
ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}]; Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&ats[#]==k&]],{n,0,30,2},{k,0,n,2}] (* Gus Wiseman, Jun 20 2021 *)
Comments