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 15:17, 25 May 2019
, 4 years ago→analytically determine minimum start value: A few more small, mostly cosmetic fixes
Thundergnat (talk | contribs) (→analytically determine minimum start value: Argh. pasted in wrong version. fixed) |
Thundergnat (talk | contribs) m (→analytically determine minimum start value: A few more small, mostly cosmetic fixes) |
||
Line 190:
Note: I would not have figured this out without the above analysis by Hout and Nigel Galloway. Kudos to both of them.
Here is a Perl 6 script showing each step spelled out: [https://tio.run/##fVNNb9owGL7zK56iaARGoqaTWg1UOk277LDTtNNYKwfegKfEzuxkLULpj9p1t/4xZsdJIFRaDsQ47/s@H36ck0qvDwddxljzDS9YGigpC/he/eIaK5nvpph5MdM0xn4A87iPt@4drmQWhxnL/f3s3bXvPYyrcajLLLQdftP3uOUptfVbpjQWiObHYWFu9ig4aZkPqsHA8kq40kWgf5VMEfzPooAnWiKa7TCajPCEm/fzbmf40QwwVQgCfNOkUWwJudSax4ZErVPPhsf6bIcPumDKSkpSVmAUjaYYXZof/wpheG8RX/42goShdoRaik/ON9SeyMSASd2hYDitaw2EM81AnBrtw7/vDw9/Si6M4e1//AdOOzxyHlnFosxiMu5ygdiZcC7U9d3Cj4wwi2dPbvLyp17MsO/T8x46Yj1OqPqsvnDBszIzzUlCisSKLLW9J6qgnufcSZTMIAW9or3uiVo0yWqpW/NkkmiyB5Rx4TsR4UaRYTzp6g2twK0acrniNi5db7taWMy7O1zi4qLdPD9dnpyUXzZ56xQD/r5GetsUVS30EWa8FEvxVU5hEsUsb@vQtBauM5amZLTXseNig98sLQmPPE0hiNZgAvRUKNYOa6ywj8vq96iF/nGi7Pn1V9dYgVKThzMZjiGEbMBcaqG3skzXiMlwWZHWTO3ChkB1cuztobu7UyuwgW8o1EE2ZpqO8E3vEidSIboxFwtX0fxw@Ac Try it online!]
<pre>sub digital-root ($root is copy, :$base) {
Line 206:
say "\nDigital roots of the first $n numbers in base $n:";
say my @roots = (
say "\nMinimum difference of {$n}-digit root from one of the first $n digital roots >= $root:";
my $offset = min(@roots.grep: * >= $root ) - $root;
Line 235:
Digital roots of the first 17 numbers in base 17:
[1 4 9 16 9 4 1 16 1 4 9 16 9 4 1 16
Minimum difference of 17-digit root from one of the first 17 digital roots >= 8:
1 (9 - 8 = 1)
Line 249:
Digital roots of the first 18 numbers in base 18:
[1 4 9 16 8 2 15 13 13 15 2 8 16 9 4 1 17
Minimum difference of 18-digit root from one of the first 18 digital roots >= 17:
0
Line 263:
Digital roots of the first 19 numbers in base 19:
[1 4 9 16 7 18 13 10 9 10 13 18 7 16 9 4 1 18
Minimum difference of 19-digit root from one of the first 19 digital roots >= 9:
0
Line 277:
Digital roots of the first 20 numbers in base 20:
[1 4 9 16 6 17 11 7 5 5 7 11 17 6 16 9 4 1 19
Minimum difference of 20-digit root from one of the first 20 digital roots >= 19:
0
Line 291:
Digital roots of the first 21 numbers in base 21:
[1 4 9 16 5 16 9 4 1 20 1 4 9 16 5 16 9 4 1 20
Minimum difference of 21-digit root from one of the first 21 digital roots >= 10:
6 (16 - 10 = 6)
|