Addition-chain exponentiation: Difference between revisions
Content added Content deleted
(→{{header|Go}}: Added a (hopefully) admissible solution for this task.) |
(→{{header|Go}}: Added code to generate the first 100 terms of A003313.) |
||
Line 570: | Line 570: | ||
{0, 0, 0, 0, 0, 1}, |
{0, 0, 0, 0, 0, 1}, |
||
{0, 0, 0, 0, 1, 0}, |
{0, 0, 0, 0, 1, 0}, |
||
} |
|||
fmt.Println("\nThe first 100 terms of A003313 are:") |
|||
for i := 1; i <= 100; i++ { |
|||
fmt.Printf("%d ", seqLen(i)) |
|||
if i%10 == 0 { |
|||
fmt.Println() |
|||
} |
|||
} |
} |
||
exs := [2]int{m, n} |
exs := [2]int{m, n} |
||
Line 597: | Line 604: | ||
Cached 29696 |
Cached 29696 |
||
Cached 30720 |
Cached 30720 |
||
The first 100 terms of A003313 are: |
|||
0 1 2 2 3 3 4 3 4 4 |
|||
5 4 5 5 5 4 5 5 6 5 |
|||
6 6 6 5 6 6 6 6 7 6 |
|||
7 5 6 6 7 6 7 7 7 6 |
|||
7 7 7 7 7 7 8 6 7 7 |
|||
7 7 8 7 8 7 8 8 8 7 |
|||
8 8 8 6 7 7 8 7 8 8 |
|||
9 7 8 8 8 8 8 8 9 7 |
|||
8 8 8 8 8 8 9 8 9 8 |
|||
9 8 9 9 9 7 8 8 8 8 |
|||
Exponent: 27182 |
Exponent: 27182 |