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

Home > Numbers
Squarely chained (Posted on 2019-05-21) Difficulty: 3 of 5
N is an integer below 10,000.
N's square is a concatenation of two consecutive numbers.

Find all possible values of N.

No Solution Yet 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
 For n = 1 To 10000
   n2 = n * n
   tst$ = LTrim(Str(n2))
   halfway = Int(Len(tst) / 2)
   p1 = Val(Left(tst, halfway))
   p2 = Val(Mid(tst, halfway + 1))
   If p2 = p1 + 1 Then
     Text1.Text = Text1.Text & n & "    " & n2 & crlf
   End If
 Next
 
produces 

1    1
155    24025
274    75076
428    183184
573    328329
727    528529
846    715716
2191    4800481
7810    60996100

where the first line is obviously spurious, due to a null length string representing zero as the integer prior to 1.  But of course if we concatenate 01, it is 1^2.

Also spurious are 155, 274 and 2191 as they each require a leading zero to be attached to the second of the two consecutive numbers.

That leaves  428, 573, 727, 846 and 7810.

  Posted by Charlie on 2019-05-21 16:17:35
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 (14)
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