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

Home > Algorithms
Shared by squares (Posted on 2015-02-10) Difficulty: 3 of 5
Devise an efficient method of finding consecutive squares which have the same digits.

Find such pairs up to 1000000.

Feel free to go further.

No Solution Yet Submitted by Jer    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
A start | Comment 1 of 3
Well, if n^2 and (n+1)^2 have the same digits, then they have they same value mod 9, and their difference = 0 mod 9.

Their difference = 2n+1, so n = 4 mod 9.

So we only need to investigate every 9th n between 1 and 1000, starting with 4, for a possible 111 values.  Not very efficient, so I want to see what somebody else comes up with.

Using Excel on these 111 values, the only ones I notice are:

n  n^2  (n+1)^2
-- ------ ---------
13    169      196
157  24649   24964
913  833569 835396

This was based on manual inspection, so I might have missed some.

  Posted by Steve Herman on 2015-02-10 13:53:41
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 (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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