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!)
A113035 Number of ways the set {1,2,...,n} can be split into two subsets of which the sum of one is twice the sum of the other. 1

%I #19 Nov 18 2020 08:48:04

%S 0,1,1,0,3,4,0,10,17,0,46,78,0,231,401,0,1233,2177,0,6869,12268,0,

%T 39502,71172,0,232686,422076,0,1396669,2547246,0,8512170,15593760,0,

%U 52534875,96598865,0,327669853,604405633,0,2062171364,3814087419,0,13078921499

%N Number of ways the set {1,2,...,n} can be split into two subsets of which the sum of one is twice the sum of the other.

%H Alois P. Heinz, <a href="/A113035/b113035.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) is the coefficient of x^0 in Product_{k=1..n} x^(-2k)+x^k.

%e For n=5 we have 5/1234, 14/532 and 23/541 so a(5)=3.

%p A113035:= proc(n) local i,j,p,t; t:= NULL; for j to n do p:=1; for i to j do p:=p*(x^(-2*i)+x^(i)); od; t:=t,coeff(p,x,0); od; t; end;

%p # second Maple program:

%p b:= proc(n, i) option remember; local m; m:= i*(i+1)/2;

%p `if`(n>m, 0, `if`(n=m, 1, b(abs(n-i), i-1) +b(n+i, i-1)))

%p end:

%p a:= n-> `if`(irem(n, 3)=1, 0, b(n*(n+1)/6, n)):

%p seq(a(n), n=1..60); # _Alois P. Heinz_, Oct 31 2011

%t b[n_, i_] := b[n, i] = Module[{m = i(i+1)/2}, If[n > m, 0, If[n == m, 1, b[Abs[n - i], i - 1] + b[n + i, i - 1]]]];

%t a[n_] := If[Mod[n, 3] == 1, 0, b[n(n+1)/6, n]];

%t Array[a, 60] (* _Jean-François Alcover_, Nov 18 2020, after _Alois P. Heinz_ *)

%Y Cf. A058377, A112972.

%K nonn

%O 1,5

%A _Floor van Lamoen_, Oct 11 2005

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 16 03:16 EDT 2024. Contains 371696 sequences. (Running on oeis4.)