MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: SumOfSquaresRepresentations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103485] Re: [mg103475] SumOfSquaresRepresentations
  • From: Carl Woll <carlw at wolfram.com>
  • Date: Thu, 24 Sep 2009 07:50:39 -0400 (EDT)
  • References: <200909240351.XAA13419@smc.vnet.net>

janos wrote:
> To be on the safe side:
> ClearAll[d, n, x, a, SumOfSquaresRepresentations];
>
> Take this from the help:
> SumOfSquaresRepresentations[d_, n_] :=
>  Module[{x,
>    a}, (a = Array[x, d]) /. {ToRules[Reduce[a.a == n, a, Integers]]}]
>
> Let's apply it:
> SumOfSquaresRepresentations[3, 15]
> {x$110[1], x$110[2], x$110[3]}
>
> And this is the only case that you get this funny result
> writing any integer between 1 and 200 in the place of 15.
>
> Any idea?
>
> Thank you.
>
> J=E1nos
>
>   
Things are going wrong because there are no such representations.

If you have version 6/7, then you can use the built in function 
PowersRepresentations instead. For example:

In[36]:= PowersRepresentations[15, 3, 2]

Out[36]= {}

showing you that there are no such representations.

Carl


  • Prev by Date: Re: SumOfSquaresRepresentations
  • Next by Date: Re: Precision of AiryAi[0.0]
  • Previous by thread: SumOfSquaresRepresentations
  • Next by thread: Re: SumOfSquaresRepresentations