All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
A square is a square (Posted on 2023-11-15) Difficulty: 3 of 5
Let S1= 1,4,9,16,…,n^2 and S2=1,5,14,30,…,n(n+1)(2n+1)/6

Clearly the first sequence represents the squares of positive integers while the second their interim sums.

For what smallest value of n (excluding the trivial n=1) will the average of the first n squares be a square number itself?

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 3
clc
n=1;
sq=1;
sumsq=1;
numsq=1;
solct=0;
for i=1:1000000
  avg=sumsq/numsq;
  if avg==round(avg)
    if round(sqrt(avg))^2==avg
      fprintf('%6d %15d %10d %6d\n',n, sumsq, sumsq/numsq, sqrt(sumsq/numsq))
    end
  end
  n=n+1;
  sq=n^2;
  sumsq=sumsq+sq;
  numsq=n;
end


   n    sum of squares     avg     square
                                    root
     1               1          1      1
   337        12814425      38025    195
 65521  93762728983561 1431033241  37829
         
         
so, excluding the trivial case of n = 1, we have the sum of the average of the first 337 squares is 38025 = 195^2.    

The next case is the average of the first 65521 squares is 1431033241 = 37829^2.


  Posted by Charlie on 2023-11-15 11:32:53
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information