Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 877 Bytes

README.md

File metadata and controls

11 lines (9 loc) · 877 Bytes

Torn-Numbers

Reddit Daily Programming Problem

Description: I had the other day in my possession a label bearing the number 3 0 2 5 in large figures. This got accidentally torn in half, so that 3 0 was on one piece and 2 5 on the other. On looking at these pieces I began to make a calculation, when I discovered this little peculiarity. If we add the 3 0 and the 2 5 together and square the sum we get as the result, the complete original number on the label! Thus, 30 added to 25 is 55, and 55 multiplied by 55 is 3025. Curious, is it not? Now, the challenge is to find another number, composed of four figures, all different, which may be divided in the middle and produce the same result. Bonus Create a program that verifies if a number is a valid torn number.

My code can handle any number. Just need to change one number. Right now code does 1 to 1000000.