P-99: 2.11 Compare the two methods of calculating Euler's totient function
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます.
$ time ./p99_39a 4032 real 0m12.336s user 0m12.340s sys 0m0.005s $ time ./p99_39b 4032 real 0m1.221s user 0m1.216s sys 0m0.006s
2.10 の解法のほうが高速だった。
a)
b)
P-99: 2.10 Calculate Euler's totient function phi(m) (2)
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます.
4
P-99: 2.09 Calculate Euler's totient function phi(m)
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます.
4
P-99: 2.08 Determine whether two positive integer numbers are coprime
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます.
yes
P-99: 2.06 A list of Goldbach compositions
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます.
前半
10 = 3 + 7 12 = 5 + 7 14 = 3 + 11 16 = 3 + 13 18 = 5 + 13 20 = 3 + 17
後半
992 = 73 + 919 1382 = 61 + 1321 1856 = 67 + 1789 1928 = 61 + 1867 2078 = 61 + 2017 2438 = 61 + 2377 2512 = 53 + 2459 2530 = 53 + 2477 2618 = 61 + 2557 2642 = 103 + 2539
P-99: 2.05 Goldbach's conjecture
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます.
{5, 23}