Anonymous user
Talk:First perfect square in base n with n unique digits: Difference between revisions
Talk:First perfect square in base n with n unique digits (view source)
Revision as of 14:42, 2 June 2019
, 4 years ago→Optimization when no extra digit required: possible improve of Digital root GO - Version
(Congratulations to Nigel Galloway on his latest optimization!) |
m (→Optimization when no extra digit required: possible improve of Digital root GO - Version) |
||
Line 382:
:I wouldn't spend too much time on optimizing for the cases where an additional digit is required as they take very little time to process anyway as a result of previous optimizations. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 10:58, 29 May 2019 (UTC)
::@PureFox your calculation of digital root is to much work [[wp:Digital_root#Congruence_formula|Digital_root]] is only one ( n MOD (Base-1) ) calculation.All numbers are >> 1 no need to check for one digit.Similary to this<lang go>func sumDigits(n, base *big.Int) *big.Int {
r := new(big.Int)
// decrement base by one ?
r := Rem(n,base-1)
return r
}</lang>
|