First perfect square in base n with n unique digits: Difference between revisions
Content added Content deleted
Line 554: | Line 554: | ||
base @ 17 2 do |
base @ 17 2 do |
||
i base ! |
i base ! |
||
cr i 2 d. 3 spaces panroot dup |
cr i 2 d. 3 spaces panroot dup 8 .r ." ² = " sq . |
||
loop base ! ; |
loop base ! ; |
||
</lang> |
</lang> |
||
Line 560: | Line 560: | ||
<pre> |
<pre> |
||
showsquares |
showsquares |
||
2 |
2 10² = 100 |
||
3 |
3 22² = 2101 |
||
4 |
4 33² = 3201 |
||
5 |
5 243² = 132304 |
||
6 |
6 523² = 452013 |
||
7 |
7 1431² = 2450361 |
||
8 |
8 3344² = 13675420 |
||
9 |
9 11642² = 136802574 |
||
10 |
10 32043² = 1026753849 |
||
11 |
11 111453² = 1240A536789 |
||
12 |
12 3966B9² = 124A7B538609 |
||
13 |
13 3828943² = 10254773CA86B9 |
||
14 |
14 3A9DB7C² = 10269B8C57D3A4 |
||
15 |
15 1012B857² = 102597BACE836D4 |
||
16 |
16 404A9D9B² = 1025648CFEA37BD9 ok |
||
</pre> |
</pre> |
||
=={{header|Go}}== |
=={{header|Go}}== |
||
This takes advantage of major optimizations described by Nigel Galloway and Thundergnat (inspired by initial pattern analysis by Hout) in the Discussion page and a minor optimization contributed by myself. |
This takes advantage of major optimizations described by Nigel Galloway and Thundergnat (inspired by initial pattern analysis by Hout) in the Discussion page and a minor optimization contributed by myself. |