cp's OEIS Frontend

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.

A158380 Number of solutions to +-1 +- 3 +- 6 +- ... +- n(n+1)/2 = 0.

This page as a plain text file.
%I A158380 #53 Feb 02 2022 09:40:14
%S A158380 1,0,0,0,2,0,2,2,4,0,12,16,26,0,66,104,210,0,620,970,1748,0,5948,
%T A158380 10480,18976,0,60836,111430,209460,0,704934,1284836,2387758,0,8331820,
%U A158380 15525814,28987902,0,101242982,190267598,358969426,0,1275032260,2404124188,4547419694
%N A158380 Number of solutions to +-1 +- 3 +- 6 +- ... +- n(n+1)/2 = 0.
%C A158380 Equivalently, number of partitions of the set of the first n triangular numbers {t(1),...,t(n)} into two classes with equal sums.
%C A158380 Constant term in the expansion of (x + 1/x)(x^3 + 1/x^3)...(x^t(n) + 1/x^t(n)).
%C A158380 a(n) = 0 for all n == 1 (mod 4).
%C A158380 Andrica & Tomescu give a more general integral formula than the one below. - _Jonathan Sondow_, Nov 11 2013
%H A158380 Ray Chandler, <a href="/A158380/b158380.txt">Table of n, a(n) for n = 0..633</a>
%H A158380 Dorin Andrica and Ioan Tomescu, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL5/Tomescu/tomescu4.html">On an Integer Sequence Related to a Product of Trigonometric Functions, and Its Combinatorial Relevance</a>, J. Integer Sequences, 5 (2002), Article 02.2.4.
%F A158380 a(n) = (2^n/Pi) * Integral_{x=0..Pi} cos(x)*cos(3x)*...*cos(n(n+1)x/2) dx.
%F A158380 a(n) ~ 2^(n+1)*sqrt(10/Pi)*n^(-5/2)*(1+o(1)) as n --> infinity, n !== 1 (mod 4).
%F A158380 a(n) = 2 * A058498(n) for n > 0. - _Alois P. Heinz_, Nov 01 2011
%e A158380 For n=6 the 2 solutions are +1-3+6-10-15+21 = 0 and -1+3-6+10+15-21 = 0.
%p A158380 N:=70: p:=1: a:=[]: for n from 0 to N do
%p A158380 p:=expand(p*(x^(n*(n+1)/2)+x^(-n*(n+1)/2))):
%p A158380 a:=[op(a), coeff(p, x, 0)]: od:a;
%p A158380 # second Maple program:
%p A158380 b:= proc(n, i) option remember; (m-> `if`(n>m, 0,
%p A158380       `if`(n=m, 1, b(abs(n-i*(i+1)/2), i-1)+
%p A158380       b(n+i*(i+1)/2, i-1))))((2+(3+i)*i)*i/6)
%p A158380     end:
%p A158380 a:= n-> `if`(irem(n, 4)=1, 0, b(0, n)):
%p A158380 seq(a(n), n=0..50);  # _Alois P. Heinz_, Sep 17 2017
%t A158380 a[n_] := With[{t = Table[k(k+1)/2, {k, 1, n}]}, Coefficient[Times @@ (x^t + 1/x^t), x, 0]];
%t A158380 Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 50}] (* _Jean-François Alcover_, Jun 16 2018 *)
%o A158380 (PARI) t(k) = k*(k+1)/2;
%o A158380 a(n) = polcoeff(prod(k=1, n, (x^t(k)+ 1/x^t(k))), 0); \\ _Michel Marcus_, May 19 2015
%Y A158380 Cf. A058498, A063865, A158092, A158118.
%K A158380 easy,nonn
%O A158380 0,5
%A A158380 _Pietro Majer_, Mar 17 2009
%E A158380 a(0) = 1 prepended by _Joerg Arndt_, Sep 17 2017
%E A158380 Example corrected by _Ilya Gutkovskiy_, Feb 02 2022