Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

arithmetic progression in c

Name: Anonymous 2011-01-05 1:13

Hi guys do have any ideas on how to make this arithmetic progression in c?
n^2 - m^2 - k^2 = aaa (a is any number)
for example 53^2 - 37^2 - 21^2 = 999
I need to find all the possible aaa's here

Name: Anonymous 2011-01-05 2:33

>>3
long findaaa(long a){
int d=10;
while(1){
  if(a>=d){d*=10;break;} else return a*d+a*d*d+a*d*d*d;}}

long n,m,k,a,aaa=0;
for(n=1;n<256;n++)
 for(m=1;m<256;m++)
  for(k=1;k<256;k++)
   for(a=1,aaa;a<256;a++)
   { aaa=findaaa(a); assert((pow(n,2)-pow(m,2)-pow(k,2))!=aaa); }

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List