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

 1-2-3 Square Settlement (Posted on 2015-11-27)
N is a perfect square containing precisely one 3, two 2’s and three 1’s. Any of the other seven digits may or may not occur in N.

Determine the smallest two values of N.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution -- smallest nine values | Comment 1 of 3
`sqrt(N)  N  3361  112963213483  121312893596  129312163623  131261293889  151243214373  191231294649  216132015489  301291215579  31125241`

`DefDbl A-Z  `
Dim crlf\$

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

For sr = 317 To 9999
DoEvents
sq\$ = LTrim(Str(sr * sr))
ReDim ct(9)
For i = 1 To Len(sq)
ct(Val(Mid(sq, i, 1))) = ct(Val(Mid(sq, i, 1))) + 1
Next
If ct(1) = 3 And ct(2) = 2 And ct(3) = 1 Then
Text1.Text = Text1.Text & sr & "  " & sq & crlf
End If
Next

Text1.Text = Text1.Text & crlf & " done"

End Sub

Edited on November 28, 2015, 8:56 am
 Posted by Charlie on 2015-11-27 15:30:18

 Search: Search body:
Forums (4)