MathGroup Archive 2006

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

Search the Archive

Re: Re: Finding the Number of Pythagorean Triples below a bound

Hello Dan and Andrzej,
>I'd say up to 10^6 or maybe 10^7 the way to go is by looking at the
>factorization of c2=c^2+k. This way you only need iterate over c. 
  Yes, turns out the problem was equivalent to counting the number of representations of N as 
  a^2+b^2 = N
  where 0<a<=b (I should have phrased it that way, but that is the benefit of high-sight) which I assume can be given by the function OrderedSumOfSquaresRepresentations[2,N]?  Hence the code you have given me, in essence, is, say for k = 5,
  roughly speaking? (With finer details of removing from consideration those c^2+5 that are of from 4m+3, etc.)
  >Here are some timings.
>Out[54]={0.591 Second,1154}
>Out[93]={8.562 Second,12115}
>Out[94]={131.91 Second,121054}

  There is something odd with the first value. James' count (up to m=5) vs this gives the sequences,
  {1219, 12115}
  {1154, 12115, 121054}
  Why the disparity? If the ratio S(N)/N would converge, it should start as 0.121... (Note however, that James' table has bound 10^m *not* 10^m-1.}

  • Prev by Date: Re: Minimize
  • Next by Date: Re: PiecewiseExpand bug?
  • Previous by thread: Re: Using Map with function that has options...
  • Next by thread: Re: Re: Finding the Number of Pythagorean Triples below a bound