Talk:First perfect square in base n with n unique digits: Difference between revisions

Added section about a minor optimization.
(→‎analytically determine minimum start value: Ah. My mishandling of square root calculations.)
(Added section about a minor optimization.)
Line 344:
</lang>
rSet(20) -> {0, 1, 4, 5, 9, 16}<br>--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 17:02, 25 May 2019 (UTC)
 
==Trailing zero==
A minor optimization has occurred to me namely that N cannot end with '0', whatever the base, because if it did, then N² would end with '00'.
 
However, this is impossible because:
 
* if N² has 'base' digits, it can't then be pandigital; or
* if N² has 'base+1' digits then the repeated digit would be zero and so the digital root would be unchanged.
<br>
As checking for this is very cheap, it may knock about 4 or 5% from the run time for bases >= 20.
--[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 16:27, 27 May 2019 (UTC)
9,476

edits