The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A239833 Number of partitions of n having an ordering of parts in which no parts of equal parity are adjacent and the first and last terms have the same parity. 8
0, 1, 1, 1, 2, 2, 3, 4, 6, 7, 10, 13, 17, 22, 28, 36, 46, 58, 72, 92, 113, 141, 174, 216, 263, 324, 394, 481, 583, 707, 852, 1029, 1235, 1481, 1774, 2118, 2524, 3003, 3567, 4225, 5003, 5906, 6968, 8202, 9646, 11317, 13275, 15531, 18160, 21195, 24718, 28772 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
FORMULA
a(n) = A239832(n) + A239832(n+1) for n >= 0.
a(n) = A240009(n,-1) + A240009(n,1). - Alois P. Heinz, Apr 02 2014
EXAMPLE
a(10) counts these 10 partitions: [10], [1,8,1], [7,2,1], [3,6,1], [5,4,1], [5,3,2], [3,4,3], [4,1,2,1,2], [2,3,2,1,2], [1,2,1,2,1,2,1].
MAPLE
b:= proc(n, i, t) option remember; `if`(abs(t)>n, 0,
`if`(n=0, 1, `if`(i<1, 0, b(n, i-1, t)+
`if`(i>n, 0, b(n-i, i, t+(2*irem(i, 2)-1))))))
end:
a:= n-> b(n$2, -1) +b(n$2, 1):
seq(a(n), n=0..80); # Alois P. Heinz, Apr 02 2014
MATHEMATICA
p[n_] := p[n] = Select[IntegerPartitions[n], Abs[Count[#, _?OddQ] - Count[#, _?EvenQ]] == 1 &]; t = Table[p[n], {n, 0, 10}]
TableForm[t] (* shows the partitions*)
t = Table[Length[p[n]], {n, 0, 60}] (* A239833 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[Abs[t]>n, 0, If[n==0, 1, If[i<1, 0, b[n, i-1, t] + If[i>n, 0, b[n-i, i, t+(2*Mod[i, 2]-1)]]]]]; a[n_] := b[n, n, -1] + b[n, n, 1]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Oct 12 2015, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A027194 A039883 A024186 * A115593 A274312 A238861
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Mar 29 2014
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 May 13 18:50 EDT 2024. Contains 372522 sequences. (Running on oeis4.)