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

Home > Numbers
The number n in n^2 (Posted on 2019-04-11) Difficulty: 3 of 5
5 is in 52=25, but 5 is at the end of 25. 10 is in 102=100, but 100 ends in 0. What is the smallest positive integer n such that n is in n2, and there is at least one nonzero digit after n in n2?

No Solution Yet Submitted by Math Man    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
in Basic | Comment 2 of 3 |
 For n = 1 To 1000000
    n2 = n * n
    ns$ = LTrim(Str(n))
    n2s$ = LTrim(Str(n2))
    ix = InStr(n2s, ns)
    If ix > 1 And ix + Len(ns) <= Len(n2s) Then
      good = 0
      For i = ix + Len(ns) To Len(n2s)
        If Mid(n2s, i, 1) > "0" Then good = 1: Exit For
      Next
      If good Then Text1.Text = Text1.Text & n & Str(n2) & crlf: ct = ct + 1
    End If
    If ct >= 100 Then Exit For
    DoEvents
 Next


  Posted by Charlie on 2019-04-11 15:27:08
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 (0)
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