What A Mean Square

Find the least positive integer n > 1 n>1 such that the arithmetic mean of the first n n non-zero perfect squares is again a perfect square.


The answer is 337.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Mark Hennings
Mar 29, 2016

We are trying to find integers n > 1 n > 1 such that 1 n j = 1 n j 2 = 1 6 ( n + 1 ) ( 2 n + 1 ) = m 2 \tfrac{1}{n}\sum_{j=1}^n j^2 \,=\, \tfrac16(n+1)(2n+1) = m^2 is a perfect square. This condition rearranges to read ( 4 n + 3 ) 2 48 m 2 = 1 , (4n+3)^2 - 48m^2 \; = \; 1 \;, and so we are interested in the solutions of Pell's equation x 2 48 y 2 = 1 x^2 -48y^2 = 1 . Considering the continued fraction expansion of 48 = [ 6 , 1 , 12 ] \sqrt{48} = [6,\overline{1,12}] , the first few solutions in positive integers are ( x , y ) = ( 7 , 1 ) , ( 97 , 14 ) , ( 1351 , 195 ) (x,y) = (7,1)\,,\,(97,14)\,,\, (1351,195) . Note that these can be obtained as x + y 48 = ( 7 + 48 ) n x + y\sqrt{48} = (7 + \sqrt{48})^n for n = 1 , 2 , 3 n = 1,2,3 . Since 97 97 is not congruent to 3 3 modulo 4 4 , we are not interested in that solution, and so (since n > 1 n > 1 ) we want 4 n + 3 = 1351 4n+3 = 1351 , and hence n = 337 n = \boxed{337} .

Considering the continued fraction expansion of 48 = [ 6 , 1 , 12 ] \sqrt{48} = [6,\overline{1,12}]

What is the significance of this line? And how did you show that it is true in the first place?

Pi Han Goh - 5 years, 1 month ago

Log in to reply

The connection between the solution's of Pell's equation and the convergents of the associated continued fraction is a standard piece of Elementary Number Theory, but is too large to describe here. The notation [ 6 , 1 , 12 ] [6,\overline{1,12}] means that 48 = 6 + 1 1 + 1 12 + 1 1 + 1 12 + 1 1 + \sqrt{48} \; = \; 6 + \frac{1}{1 + \frac{1}{12 + \frac{1}{1 + \frac{1}{12 + \frac{1}{1 + \cdots}}}}} so that the 1 1 and 12 12 recur in the continued fraction expression.

Mark Hennings - 5 years, 1 month ago

Log in to reply

Oh, I know what that notation mean. Maybe I didn't clarify. Let me rephrase my question:

Why do you need to find the continued fraction for 48 \sqrt{48} in the first place (what is its significance)? Can't we solve this question without even knowing what continued fractions are to begin with?

And for my response to your last comment: It is too large to describe here? Is that so? What text/sites that can shed light on this matter?

Pi Han Goh - 5 years, 1 month ago

Log in to reply

@Pi Han Goh This document seems to cover the main ideas. If you want an more "official" version, try A.J Baker's "Elementary Number Theory". A slim paperback which covers the key basics of ENT.

Mark Hennings - 5 years, 1 month ago

Log in to reply

@Mark Hennings Thank you for the links.

This pdf ? It only has 66 pages, it feels too short. I thought most undergraduate books should be over 100 pages, especially when it covers so many different areas.

Unfortunately, by glancing through these two pdfs, I still can't determine how continued fractions plays a role in this question. Maybe I'll come back to it some other time.

And what do you mean by "official"? They both seem pretty good to me.

How did you managed to find all relevant articles so quickly anyway? It's like you know the entire library of articles and journals in your fingertips. How did you do that? I couldn't even remember where I last put my keys!

Pi Han Goh - 5 years, 1 month ago

Log in to reply

@Pi Han Goh Try theorems 1.43 and 1.44 in the Baker notes for the connection between Pell's equation and continued fractions.

I was thinking of this as a published book. The other two seem to be lecture notes or student summaries. Of course, Baker's lecture notes are pretty official.

As to finding documents on the web, my daughter calls it "Google Fu". It helps to have a good idea about what productive search parameters to put in...

Mark Hennings - 5 years, 1 month ago

Log in to reply

@Mark Hennings That connection would be a great addition to the pell's equation wiki :)

Perhaps start off with a brief intro of the explanation, and then add the details over time.

Calvin Lin Staff - 5 years, 1 month ago

@Mark Hennings How important is this book ? That is: Is Chapters 6 onwards (basically the stuffs I know little about) a great introduction with great examples to work with? Like about as good as Alan J Weir's one? Or much better?

Pi Han Goh - 4 years, 12 months ago

Log in to reply

@Pi Han Goh The Conciese Introduction is precisely that. It gives you the basics, but does not go into what comes next. If you want more than the basics, you need to upgrade.

Weir's book is a more detailed setting out of a complex theory.

Mark Hennings - 4 years, 12 months ago

Log in to reply

@Mark Hennings Wonderful. Concise introduction should do fine for now.

Then a natural follow-up question is: "Do you know any books that is/are an upgrade of Alan Baker's book?"

Pi Han Goh - 4 years, 12 months ago

Log in to reply

@Pi Han Goh Wait. Come to think of it, an upgrade isn't that important for now. Thanks again (as usual) Mr Mark Hennings!!

Pi Han Goh - 4 years, 12 months ago
Abhishek Sinha
Apr 7, 2016

Our objective is to find the least integer n n greater than 1 1 which satisfies the Diophantine equation ( n + 1 ) ( 2 n + 1 ) = 2.3 m 2 (n+1)(2n+1)=2.3m^2 Since 2 n + 1 2n+1 is odd, this immediately implies that 2 ( n + 1 ) 2|(n+1) , i.e. n n is odd. Writing n = 2 k 1 n=2k-1 , for some positive integer k > 1 k>1 , we have k ( 4 k 1 ) = 3 m 2 k(4k-1)=3m^2 Now note that gcd ( k , 4 k 1 ) = 1 \text{gcd}(k, 4k-1)=1 and 4 k 1 4k-1 can never be a perfect square. Hence the solution of the above equation is always of the form k = m 1 2 , 4 k 1 = 3 m 2 2 k=m_1^2, 4k-1=3m_2^2 For some positive integers m 1 , m 2 > 1 m_1,m_2>1 . Taking these two conditions together, we have 4 m 1 2 = 1 + 3 m 2 2 4m_1^2=1+3m_2^2 This immediately give us a necessary condition m 2 2 = 1 m o d ( 4 ) m_2^2=1 \mod(4) , i.e., m 2 = 1 , 3 m o d ( 4 ) m_2=1,3 \mod(4) . Since we are looking for the smallest solution m 2 > 1 m_2>1 , a simple search over the first few positive integer reveals that m 2 = 15 m_2=15 is the smallest integer satisfying the above Diophantine equation and hence m 1 = 13 m_1=13 . Thus n = 2 k 1 = 2 m 1 2 1 = 337 n=2k-1=2m_1^2-1=337

It is well known that k = 1 n k 2 = n ( n + 1 ) ( 2 n + 1 ) 6 . \sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}6. Divide this by n n to find the average; equate this to the square of a number a a . ( n + 1 ) ( 2 n + 1 ) = 6 a 2 . (n+1)(2n+1) = 6a^2. Both sides of the equation must be even, but 2 n + 1 2n+1 is odd. Therefore n + 1 n+1 must be even. This allows us to substitute n = 2 m 1 m ( 4 m 1 ) = 3 a 2 . n = 2m-1\ \ \therefore\ \ m(4m-1) = 3a^2. Assuming m > 1 m > 1 (easy to check), the two factors m m , 4 m 1 4m-1 have no common factors. Moreover, 4 m 1 4m-1 cannot be a perfect square (because it 3 \equiv 3 mod 4), so it must be 3 times a perfect square. Thus we split the square: a = b c m = b 2 , 4 m 1 = 3 c 2 3 c 2 = 4 b 2 1 3 c 2 = ( 2 b + 1 ) ( 2 b 1 ) . a = bc\ \ \therefore\ \ m = b^2,\ \ 4m-1 = 3c^2 \\ 3c^2 = 4b^2 - 1\ \ \therefore\ \ 3c^2 = (2b+1)(2b-1). Since b > 1 b > 1 the two factors on the right have no common factors. Again, split the square: c = p q b = 1 2 ( p 2 ± 1 ) = 1 2 ( 3 q 2 1 ) . p 2 3 q 2 = 2. c = pq\ \ \therefore\ \ b = \tfrac12(p^2 \pm 1) = \tfrac12(3q^2 \mp 1). \\ p^2 - 3q^2 = \mp 2. It is easy to see that p p and q q must both be odd. Substitute and divide by 4: p = 2 s 1 , q = 2 t 1 s ( s 1 ) 3 t ( t 1 ) = 0 or 1. p = 2s-1, q = 2t-1 \ \ \therefore\ \ s(s-1) - 3 t(t-1) = 0\ \text{or}\ 1. The smallest solution of this equation is s = 3 s = 3 and t = 2 t = 2 . Then, working backward p = 2 3 1 = 5 ; q = 2 2 1 = 3 ; c = 5 3 = 15 ; b = 1 2 ( 5 2 + 1 ) = 1 2 ( 3 3 2 1 ) = 13 ; a = 13 15 = 195 ; m = 1 3 2 = 169 ; ( check: 4 169 1 = 675 = 3 1 5 2 ) ; n = 2 169 1 = 337 . p = 2\cdot 3 - 1 = 5;\ \ q = 2\cdot 2 -1 = 3; \\ c = 5\cdot 3 = 15;\ \ b = \tfrac12(5^2+1) = \tfrac12(3\cdot 3^2 - 1) = 13; \\ a = 13\cdot 15 = 195;\ \ m = 13^2 = 169;\ \ (\text{check:}\ 4\cdot 169 - 1 = 675 = 3\cdot 15^2); \\ n = 2\cdot 169 - 1 = \boxed{337}.

This is similar to my solution that I posted earlier.

Abhishek Sinha - 5 years, 2 months ago

Log in to reply

The first half is-- I take a few more steps to reduce 3 c 2 = 4 b 2 1 3c^2 = 4b^2-1 even further, so that we don't have to a search over the first 15 integers.

The techniques used here (reduction using even/odd, reasoning mod 4, splitting a square based on lack of common factors) are standard for Diophantine equations. It is therefore not strange that we find similar solutions.

Arjen Vreugdenhil - 5 years, 2 months ago

Log in to reply

I need to test first 8 integers 1 , 3 m o d ( 4 ) 1,3 \mod(4) .

Abhishek Sinha - 5 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...