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\$0
's... \$\endgroup\$0
s anyway. \$\endgroup\$0
's aren't allowed. I'll update the question to clarify this. \$\endgroup\$49 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\$