Determine the minimum value of P for which the
root mean square (RMS) of the first P positive integers (that is; 1, 2,..., P) is an integer, where P is a positive integer > 1.
The answer is 337, based on ignoring the value of 1 in the list of the first four solutions:
P RMS
1 1.0
337 195.0
65521 37829.0
12710881 7338631.0
list
10 for P=1 to 99999999
20 Tot=Tot+P*P
30 Avg=Tot//P
40 Rms=sqrt(Avg)
50 Irms=int(Rms+0.5)
60 if Irms*Irms=Avg then print P,Rms
70 next
OK
run
1 1.0
337 195.0
65521 37829.0
12710881 7338631.0
OK
|
Posted by Charlie
on 2009-12-29 14:58:11 |