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.

A158092 Number of solutions to +- 1 +- 2^2 +- 3^2 +- 4^2 +- ... +- n^2 = 0.

This page as a plain text file.
%I A158092 #51 Jan 29 2024 18:06:27
%S A158092 0,0,0,0,0,0,2,2,0,0,2,10,0,0,86,114,0,0,478,860,0,0,5808,10838,0,0,
%T A158092 55626,100426,0,0,696164,1298600,0,0,7826992,14574366,0,0,100061106,
%U A158092 187392994,0,0,1223587084,2322159814,0,0,16019866270,30353305134,0,0
%N A158092 Number of solutions to +- 1 +- 2^2 +- 3^2 +- 4^2 +- ... +- n^2 = 0.
%C A158092 Twice A083527.
%C A158092 Number of partitions of the half of the n-th-square-pyramidal number into parts that are distinct square numbers in the range 1 to n^2. Example: a(7)=2 since, squarePyramidal(7)=140 and 70=1+4+16+49=9+25+36. - _Hieronymus Fischer_, Oct 20 2010
%C A158092 Erdős & Surányi prove that this sequence is unbounded. More generally, there are infinitely many ways to write a given number k as such a sum. - _Charles R Greathouse IV_, Nov 05 2012
%C A158092 The expansion and integral representation formulas below are due to Andrica & Tomescu. The asymptotic formula is a conjecture; see Andrica & Ionascu. - _Jonathan Sondow_, Nov 11 2013
%H A158092 Alois P. Heinz and Ray Chandler, <a href="/A158092/b158092.txt">Table of n, a(n) for n = 1..500</a> (first 240 terms from Alois P. Heinz)
%H A158092 D. Andrica and E. J. Ionascu, <a href="http://www.dorinandrica.ro/files/presentation-INTEGERS-2013.pdf">Variations on a result of Erdős and Surányi</a>, INTEGERS 2013 slides.
%H A158092 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.
%H A158092 P. Erdős and J. Surányi, <a href="http://www.renyi.hu/~p_erdos/1959-05.pdf">Egy additív számelméleti probléma</a> (in Hungarian; Russian and German summaries), Mat. Lapok 10 (1959), pp. 284-290.
%F A158092 Constant term in the expansion of (x + 1/x)(x^4 + 1/x^4)..(x^n^2 + 1/x^n^2).
%F A158092 a(n)=0 for any n == 1 or 2 (mod 4).
%F A158092 Integral representation: a(n)=((2^n)/pi)*int_0^pi prod_{k=1}^n cos(x*k^2) dx
%F A158092 Asymptotic formula: a(n) = (2^n)*sqrt(10/(pi*n^5))*(1+o(1)) as n-->infty; n == -1 or 0 (mod 4).
%F A158092 a(n) = 2 * A083527(n). - _T. D. Noe_, Mar 12 2009
%F A158092 min{n : a(n) > 0} = A231015(0) = 7. - _Jonathan Sondow_, Nov 06 2013
%e A158092 For n=8 the a(8)=2 solutions are: +1-4-9+16-25+36+49-64=0 and -1+4+9-16+25-36-49+64=0.
%p A158092 From _Pietro Majer_, Mar 15 2009: (Start)
%p A158092 N:=60: p:=1: a:=[]: for n from 1 to N do p:=expand(p*(x^(n^2)+x^(-n^2))):
%p A158092 a:=[op(a), coeff(p, x, 0)]: od:a; (End)
%p A158092 # second Maple program:
%p A158092 b:= proc(n, i) option remember; local m; m:= (1+(3+2*i)*i)*i/6;
%p A158092       `if`(n>m, 0, `if`(n=m, 1, b(abs(n-i^2), i-1) +b(n+i^2, i-1)))
%p A158092     end:
%p A158092 a:= n-> `if`(irem(n-1, 4)<2, 0, 2*b(n^2, n-1)):
%p A158092 seq(a(n), n=1..60);  # _Alois P. Heinz_, Nov 05 2012
%t A158092 b[n_, i_] := b[n, i] = With[{m = (1+(3+2*i)*i)*i/6}, If[n>m, 0, If[n == m, 1, b[ Abs[n-i^2], i-1] + b[n+i^2, i-1]]]]; a[n_] := If[Mod[n-1, 4]<2, 0, 2*b[n^2, n-1]]; Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, Mar 13 2015, after _Alois P. Heinz_ *)
%o A158092 (PARI) a(n)=2*sum(i=0,2^(n-1)-1,sum(j=1,n-1,(-1)^bittest(i,j-1)*j^2)==n^2) \\ _Charles R Greathouse IV_, Nov 05 2012
%o A158092 (Python)
%o A158092 from itertools import count, islice
%o A158092 from collections import Counter
%o A158092 def A158092_gen(): # generator of terms
%o A158092     ccount = Counter({0:1})
%o A158092     for i in count(1):
%o A158092         bcount = Counter()
%o A158092         for a in ccount:
%o A158092             bcount[a+(j:=i**2)] += ccount[a]
%o A158092             bcount[a-j] += ccount[a]
%o A158092         ccount = bcount
%o A158092         yield(ccount[0])
%o A158092 A158092_list = list(islice(A158092_gen(),20)) # _Chai Wah Wu_, Jan 29 2024
%Y A158092 Cf. A063865, A158118, A019568, A083527, A231015.
%K A158092 nonn
%O A158092 1,7
%A A158092 _Pietro Majer_, Mar 12 2009
%E A158092 a(51)-a(56) from _R. H. Hardin_, Mar 12 2009
%E A158092 Edited by _N. J. A. Sloane_, Sep 15 2009