Skip to content

Ruby script to solve a number puzzle in the 24/11/2012 edition of New Scientist.

Notifications You must be signed in to change notification settings

CharlesHarley/SquareBasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

The 24/11/2012 edition of New Scientist had the following puzzle:

"I have in mind a list of consecutive positive integers. A second list of numbers is generated by squaring each of the numbers in my original list. The sum of the first 2500 of these squares is equal to the sum of the next 2499 in the list.

What is the smallest number in my original list?"

I've been learning Ruby so figured I'd write a script to solve it for me. The script uses something akin to the binary search algorithm to find the answer.

Turns out it is 12502500.

About

Ruby script to solve a number puzzle in the 24/11/2012 edition of New Scientist.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages