login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A092306 Number of partitions of n such that the set of parts has an even number of elements. 3
1, 0, 0, 1, 2, 5, 6, 11, 13, 17, 23, 29, 34, 47, 64, 74, 107, 136, 185, 233, 308, 392, 518, 637, 814, 1002, 1272, 1560, 1912, 2339, 2863, 3475, 4212, 5123, 6147, 7398, 8935, 10734, 12843, 15464, 18382, 22041, 26249, 31326, 37213, 44273, 52375, 62103, 73376 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
FORMULA
a(n) = b(n, 1, 0, 1) with b(n, i, j, f) = if i<n then b(n-i, i, i, 1-f-(1-2*f)*0^(i-j)) + b(n, i+1, j, f) else (1-f-(1-2*f)*0^(i-j))*0^(i-n). - Reinhard Zumkeller, Feb 19 2004
G.f.: F(x)*G(x)/2, where F(x) = 1+Product(1-2*x^i, i=1..infinity) and G(x) = 1/Product(1-x^i, i=1..infinity).
a(n) = (A000041(n)+A104575(n))/2.
G.f. A(x) equals the main diagonal entries in the 2 X 2 matrix Product_{n >= 1} [1, x^n/(1 - x^n); x^n/(1 - x^n), 1] = [A(x), B(x); B(x), A(x)], where B(x) is the g.f. of A090794. - Peter Bala, Feb 10 2021
EXAMPLE
The partitions of five are: {{5}, {4, 1}, {3, 2}, {3, 1, 1}, {2, 2, 1}, {2, 1, 1, 1}, {1, 1, 1, 1, 1}}, The seven partitions have 1, 2, 2, 2, 2, 2 and 1 distinct parts respectively.
n=6 has A000041(6)=11 partitions: 6, 5+1, 4+2, 4+1+1, 3+3, 3+2+1, 3+1+1+1, 2+2+2, 2+2+1+1, 2+1+1+1+1 and 1+1+1+1+1+1 with partition sets: {6}, {1,5}, {2,4}, {1,4}, {3}, {1,2,3}, {1,3}, {2}, {1,2}, {1,2} and {1}, six of them have an even number of elements, therefore a(6)=6.
MAPLE
b:= proc(n, i, t) option remember; `if`(n=0, t, `if`(i<1, 0,
b(n, i-1, t) +add(b(n-i*j, i-1, 1-t), j=1..n/i)))
end:
a:= n-> b(n, n, 1):
seq(a(n), n=0..50); # Alois P. Heinz, Jan 29 2014
MATHEMATICA
f[n_] := Count[ Mod[ Length /@ Union /@ IntegerPartitions[n], 2], 0]; Table[ f[n], {n, 0, 49}] (* Robert G. Wilson v, Feb 16 2004, updated by Jean-François Alcover, Jan 29 2014 *)
PROG
(Haskell)
import Data.List (group)
a092306 = length . filter even . map (length . group) . ps 1 where
ps x 0 = [[]]
ps x y = [t:ts | t <- [x..y], ts <- ps t (y - t)]
-- Reinhard Zumkeller, Dec 19 2013
CROSSREFS
Sequence in context: A337498 A045845 A002133 * A349158 A319242 A323398
KEYWORD
nonn,easy
AUTHOR
Vladeta Jovovic, Feb 12 2004
EXTENSIONS
More terms from Robert G. Wilson v, Feb 16 2004
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)