Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is $$ \prod_{i=1}^n\prod_{j=1}^{n-i}i^2+j^2 $$ ?

It feels like there should be some way to simplify this or calculate it more efficiently than iterating over each of the $\sim n^2/2$ points.

The inner product is a special case of $$ \prod_{j=1}^Nj^2+k $$ for which a special form exists in terms of the hyperbolic sine and gamma function, but I don't know how hard it would be to use this to compute the exact (integer) product.

share|cite|improve this question
Well, (A) where does this come from, the endpoints are a little peculiar (when i=1 j goes from 1 to 0), (B) please give the values (with prime factorization) for n = 1,2,3,4,5. There are rules for sums of two squares. – Will Jagy May 1 '12 at 21:35
At least you could reduce the complexity to something like $n^2/4$, since pairs $(i,j)$ and $(j,i)$ give the same contribution to the product. – TMM May 1 '12 at 21:37
$1, 2, 50, 40000, 1953640000, 9508756608000000, 6842317022957520000000000$ isn't listed in the OEIS. – J. M. May 1 '12 at 21:40
@J.M., the exponents on prime factors may be entirely predictable. Three different behaviors, for the primes 2, $1 \pmod 4,$ then $3 \pmod 4.$ For example, for $n<6,$ no $3,$ then suddenly at $n=6$ we get a $3^2 + 3^2$ factor giving a 2 and a 9. – Will Jagy May 1 '12 at 22:22
@Will: Looks to be it, but I'm not sure how that brings us closer to a closed form representation... – J. M. May 1 '12 at 22:38
up vote 2 down vote accepted

Call your number $F(n)$. $F(n)/F(n-1) = \prod_{i=1}^n (i^2 + (n-i)^2)$. If $n$ is odd, this is an odd square because the factors pair up, $i^2 + (n-i)^2$ with $(n-i)^2 + i^2$, and all factors are odd. If $n$ is even, all factors pair up except $(n/2)^2 + (n/2)^2 = 2 (n/2)^2$, so the result is twice a square.

It looks to me like the $2$-adic order of $F(n)/F(n-1)$ is $3 n (1 - 1/2^m) - 2 m$ where $m$ is the $2$-adic order of $n$.

I suspect one may be able to identify the $p$-adic orders for odd primes as well. Note, by the way, that the primes $p \equiv 3 \mod 4$ only appear in $F(n)/F(n-1)$ when $n$ is divisible by $p$.

share|cite|improve this answer
I think you mean the primes $p \equiv 3 \pmod 4$ only appear when... – Will Jagy May 2 '12 at 19:11
Oops, yes. I don't know how that 3 became a 1. – Robert Israel May 2 '12 at 19:29
I think the expression does have a description in terms of the $p$-adic orders, I left a string of early comments to that effect. But the OP has resisted giving motivation or detail, just the expression itself. – Will Jagy May 2 '12 at 20:15
@WillJagy: I don't know what additional detail you want. I came across the expression in working out a program for A204044, but it seemed simple enough to state that I wondered if it had a nicer form. – Charles May 3 '12 at 15:57

If you want an exact answer, I suspect you're out of luck. If you'll settle for approximations/asymptotics, I suggest taking the logarithm, dividing by the number of terms in the resulting sum (roughly $(1/2)n^2$), and then seeing whether you can't relate it to some integral (maybe it's a Riemann sum for an integral, or a sampling over some uniformly distributed set).

share|cite|improve this answer
Yes, I want an exact answer. – Charles May 2 '12 at 7:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.