 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Two Geometric Series (Posted on 2003-07-14) Find a geometric series of 3 or more positive integers, starting with 1, such that its sum is a perfect square.

See if you can find another such series.

 See The Solution Submitted by Brian Smith Rating: 3.6667 (6 votes) Comments: ( Back to comment list | You must be logged in to post comments.) Programming Solution | Comment 7 of 10 | Earlier, I quoted the rule for the sum of a number of terms in a geometric sequence, which I had hoped would lead to a 'clean' (not brute-force) method of solving the problem:

Sn = (1-r^n)/(1-r)

I could not come up with anything, so I wrote the following small javascript program to find the solutions:

var rlim=10
var nlim=10
for (r=2; r<=rlim; r++) {
for (n=3; n<=nlim; n++) {
test=Math.sqrt((Math.pow(r,n)-1)/(r-1));
if (test==Math.round(test)) {
document.write("r=" + r + ", n=" + n);
document.write(", root=" + test + "<br>");
}
}
}

The program will use values of the geometric ratio from 2 to rlim, and check the sum of the first 3 up to nlim terms.

The first time, I set both parameters to 10, and came up with:

r=3, n=5, root=11
r=7, n=4, root=20

These correspond to the series:

1+3+9+27+81 = 121 = 11²
1+7+49+343 = 400 = 20²

Then, I set both to 100, and came up with more solutions than I will bother posting.

Setting rlim to 15 and nlim to 30 yields:

r=3, n=5, root=11
r=7, n=4, root=20
r=11, n=30, root=1320961856712237
r=13, n=28, root=1136622658092180
r=13, n=29, root=4098151274605530
r=13, n=30, root=14776094555198342
r=14, n=29, root=11531474452649720
r=14, n=30, root=43146826566151816
r=15, n=28, root=7802137664603434
r=15, n=29, root=30217549239826724
r=15, n=30, root=117032064969051500

From this, I garner that there are an infinite number of solutions, or at least an exorbitant number, but the lowest two are the only ones with a reasulting square that is less than a million or so.

Lastly, I decided to try to find the least number of terms required for each ratio. I rewrote the program as follows:

var rlim=100
for (r=2; r<=rlim; r++) {
found=0;
for (n=3; found==0; n++) {
test=Math.sqrt((Math.pow(r,n)-1)/(r-1));
if (test==Math.round(test)) {
document.write("r=" + r + ", n=" + n);
document.write(", root=" + test + "<br>");
found=1;
}
}
}

This program will take the sums of each ratio, starting with 2, and go on the the next as soon as a solution is found. Here are the first 50 terms:

r=2, n=54, root=134217728
r=3, n=5, root=11
r=4, n=51, root=1300077228592327
r=5, n=46, root=5960464477539062
r=6, n=40, root=1635083761698081
r=7, n=4, root=20
r=8, n=35, root=2407275258974741
r=9, n=34, root=5896274135457212
r=10, n=33, root=10540925533894598
r=11, n=30, root=1320961856712237
r=12, n=31, root=16092109205777158
r=13, n=28, root=1136622658092180
r=14, n=29, root=11531474452649720
r=15, n=28, root=7802137664603434
r=16, n=27, root=4651297694611162
r=17, n=26, root=2476144508226484
r=18, n=25, root=1190369670978259
r=19, n=25, root=2273964913345265
r=20, n=24, root=939686845933821
r=21, n=26, root=34541073727069636
r=22, n=24, root=2805191553125691
r=23, n=22, root=203139722937865
r=24, n=23, root=1554409213026084
r=25, n=24, root=12166747166629524
r=26, n=23, root=3743031632151674
r=27, n=24, root=29435979779422724
r=28, n=23, root=8445696647005056
r=29, n=22, root=2305679622019467
r=30, n=23, root=18017537321387356
r=31, n=22, root=4638931982669926
r=32, n=23, root=36605294376580070
r=33, n=22, root=8934666562827252
r=34, n=22, root=12218309374749672
r=35, n=22, root=16558043886178964
r=36, n=20, root=618003572316160
r=37, n=21, root=4874912807386812
r=38, n=21, root=6362486918825504
r=39, n=22, root=51501381505130264
r=40, n=21, root=10619341945791228
r=41, n=21, root=13589406813041232
r=42, n=20, root=2667478794465129
r=43, n=20, root=3334724118586259
r=44, n=20, root=4147558659928599
r=45, n=20, root=5133325454093174
r=46, n=21, root=42889499254061090
r=47, n=19, root=1131229532544889
r=48, n=20, root=9470293632463196
r=49, n=20, root=11517021606544148
r=50, n=20, root=13950892857142858

The number of terms needed to add to find a square pretty steadily decreases as the base ratio increases.
Close to 100, it takes about 17 terms to find a perfect square sum;
around 1000, 12;
around 10000, 9;
around 100000, 8;
around a million, 6;
10 million, 6;
around 100 million, 5 (although exactly 100000000 is a local minimum of 4);
and there is not a series of three terms to be found with a ratio anywhere less than 1000000000000.
 Posted by DJ on 2003-07-14 18:10:12 Please log in:

 Search: Search body:
Forums (1)