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

Home > Numbers
Four Digits (Posted on 2013-11-05) Difficulty: 2 of 5
You have a number where any digit appears at most twice. The sum of all neighboring four digits in this number is a square number.

What is the maximum possible value for this number?

Example: 205290 is such a number because no digit appears more than twice and 2+0+5+2, 0+5+2+9, and 5+2+9+0 are square numbers.

No Solution Yet Submitted by Danish Ahmed Khan    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): computer solution --- KUDOS Comment 4 of 4 |
(In reply to re: computer solution --- KUDOS by Ady TZIDON)

I tried to p&p this myself.  Then I realized brute force was the only way to go and waited to see what Charlie would come up with.

I didn't look too hard at Charlie's program but here was my approach:

Pick 4 digits that sum to a PS.  (I started with 9970)
this tends to give only 1 or 2 choices for each digit. 
You end up with a bit of a tree.
Look at the longest branch. (997002257 is the best for this start.)
Pick a new 4 digits and repeat.

I stopped after my second tree but I did get a longer result:

I'd like to see a more elegant approach.

  Posted by Jer on 2013-11-05 15:47:41

Please log in:
Remember me:
Sign up! | Forgot password

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

Copyright © 2002 - 2019 by Animus Pactum Consulting. All rights reserved. Privacy Information