Challenge
Write a program or function that takes a number \$n\$ and returns the smallest \$k\$ such that concatenation \$n'k\$ is a square. This sequence is described by A071176 on the OEIS.
I/O Examples
input --> output
1 --> 6 (4^2)
10 --> 0 (10^2)
35 --> 344 (188^2)
164 --> 836 (406^2)
284 --> 2596 (1686^2)
Rules
- Input will always be a positive decimal integer
- Output will be a positive decimal integer with no leading
0
's or0
- Standard I/O rules apply
- No standard loopholes
- This is code-golf, so shortest code in bytes wins
025
, no? \$\endgroup\$ – Xcali Jan 17 '20 at 21:210
's... \$\endgroup\$ – 640KB Jan 17 '20 at 21:300
s anyway. \$\endgroup\$ – Xcali Jan 17 '20 at 21:310
's aren't allowed. I'll update the question to clarify this. \$\endgroup\$ – mabel Jan 17 '20 at 22:4349 00
,64 00
and81 00
are not allowed but10 0
is. It seems0
is allowed but a zero with additional leading zeros is not. \$\endgroup\$ – Level River St Jan 17 '20 at 23:47