Talk:First perfect square in base n with n unique digits: Difference between revisions
Content added Content deleted
m (→any ideas of optimizations ?: speed up adding to base x <127) |
m (→any ideas of optimizations ?: precheck if last n digits lead do multiple same digits) |
||
Line 90: | Line 90: | ||
= $0901 -> 91</pre> |
= $0901 -> 91</pre> |
||
: it speeds up additions by a factor of 3, but checking the used digits takes ~ 40% of runtime - 60%/3+40% = 60% |
: it speeds up additions by a factor of 3, but checking the used digits takes ~ 40% of runtime - 60%/3+40% = 60% |
||
:: think of base 10 and the square of the last 2-digits. of a number.If the last 2 digits of the square are the same you need not to test the complete number. |
|||
<pre> 0 10 12 20 30 38 40 50 60 62 70 80 88 90 |
|||
86 of 100 are left over not that impressive</pre> |
|||
::using more digits increases the proportion even more 4 digits -> 4660 of 10000 are left over to test. |
|||
::but 4 digits to base 37 lead to 1542240 of 1874161 need to be checked.Not that useful. |
|||
==Space compression and proof ?== |
==Space compression and proof ?== |