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!)
A261489 Number of partitions of subsets of {1,...,n}, where consecutive integers and the elements in {1, n} are required to be in different parts. 5

%I #11 Feb 02 2017 03:43:54

%S 1,2,4,8,25,82,313,1318,6098,30603,165282,954065,5853242,37987146,

%T 259751877,1864926846,14016442573,109985575616,898948324164,

%U 7637000950875,67310106587314,614420757079213,5799709014601124,56530981389520624,568255134674637557

%N Number of partitions of subsets of {1,...,n}, where consecutive integers and the elements in {1, n} are required to be in different parts.

%H Alois P. Heinz, <a href="/A261489/b261489.txt">Table of n, a(n) for n = 0..250</a>

%e a(3) = 8: {}, 1, 2, 3, 1|2, 1|3, 2|3, 1|2|3.

%e a(4) = 25: {}, 1, 2, 3, 4, 1|2, 1|3, 13, 1|4, 2|3, 2|4, 24, 3|4, 1|2|3, 13|2, 1|2|4, 1|24, 1|3|4, 13|4, 2|3|4, 24|3, 1|2|3|4, 13|2|4, 1|3|24, 13|24.

%p g:= proc(n, l, t, f) option remember; `if`(n=0, 1,

%p add(`if`(l>0 and j=l or f=1 and n=1 and j=1, 0,

%p g(n-1, j, t+`if`(j=t, 1, 0), f)), j=0..t))

%p end:

%p a:= n-> `if`(n=0, 1, g(n-1, 0, 1, 0)+g(n-1, 1, 2, 1)):

%p seq(a(n), n=0..25);

%t g[n_, l_, t_, f_] := g[n, l, t, f] = If[n==0, 1, Sum[If[l>0 && j==l || f==1 && n==1 && j==1, 0, g[n-1, j, t+If[j==t, 1, 0], f]], {j, 0, t}]]; a[n_] := If[n==0, 1, g[n-1, 0, 1, 0]+g[n-1, 1, 2, 1]]; Table[a[n], {n, 0, 25}] (* _Jean-François Alcover_, Feb 02 2017, translated from Maple *)

%Y Cf. A247100, A261134, A261041, A261492.

%K nonn

%O 0,2

%A _Alois P. Heinz_, Aug 21 2015

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 09:49 EDT 2024. Contains 372504 sequences. (Running on oeis4.)