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!)
A158092 Number of solutions to +- 1 +- 2^2 +- 3^2 +- 4^2 +- ... +- n^2 = 0. 18
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, 55626, 100426, 0, 0, 696164, 1298600, 0, 0, 7826992, 14574366, 0, 0, 100061106, 187392994, 0, 0, 1223587084, 2322159814, 0, 0, 16019866270, 30353305134, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,7
COMMENTS
Twice A083527.
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
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
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
LINKS
Alois P. Heinz and Ray Chandler, Table of n, a(n) for n = 1..500 (first 240 terms from Alois P. Heinz)
D. Andrica and E. J. Ionascu, Variations on a result of Erdős and Surányi, INTEGERS 2013 slides.
Dorin Andrica and Ioan Tomescu, On an Integer Sequence Related to a Product of Trigonometric Functions, and Its Combinatorial Relevance, J. Integer Sequences, 5 (2002), Article 02.2.4.
P. Erdős and J. Surányi, Egy additív számelméleti probléma (in Hungarian; Russian and German summaries), Mat. Lapok 10 (1959), pp. 284-290.
FORMULA
Constant term in the expansion of (x + 1/x)(x^4 + 1/x^4)..(x^n^2 + 1/x^n^2).
a(n)=0 for any n == 1 or 2 (mod 4).
Integral representation: a(n)=((2^n)/pi)*int_0^pi prod_{k=1}^n cos(x*k^2) dx
Asymptotic formula: a(n) = (2^n)*sqrt(10/(pi*n^5))*(1+o(1)) as n-->infty; n == -1 or 0 (mod 4).
a(n) = 2 * A083527(n). - T. D. Noe, Mar 12 2009
min{n : a(n) > 0} = A231015(0) = 7. - Jonathan Sondow, Nov 06 2013
EXAMPLE
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.
MAPLE
From Pietro Majer, Mar 15 2009: (Start)
N:=60: p:=1: a:=[]: for n from 1 to N do p:=expand(p*(x^(n^2)+x^(-n^2))):
a:=[op(a), coeff(p, x, 0)]: od:a; (End)
# second Maple program:
b:= proc(n, i) option remember; local m; 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)))
end:
a:= n-> `if`(irem(n-1, 4)<2, 0, 2*b(n^2, n-1)):
seq(a(n), n=1..60); # Alois P. Heinz, Nov 05 2012
MATHEMATICA
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 *)
PROG
(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
(Python)
from itertools import count, islice
from collections import Counter
def A158092_gen(): # generator of terms
ccount = Counter({0:1})
for i in count(1):
bcount = Counter()
for a in ccount:
bcount[a+(j:=i**2)] += ccount[a]
bcount[a-j] += ccount[a]
ccount = bcount
yield(ccount[0])
A158092_list = list(islice(A158092_gen(), 20)) # Chai Wah Wu, Jan 29 2024
CROSSREFS
Sequence in context: A133388 A354643 A282516 * A145264 A300333 A357019
KEYWORD
nonn
AUTHOR
Pietro Majer, Mar 12 2009
EXTENSIONS
a(51)-a(56) from R. H. Hardin, Mar 12 2009
Edited by N. J. A. Sloane, Sep 15 2009
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 April 29 15:45 EDT 2024. Contains 372114 sequences. (Running on oeis4.)