Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Totient-function/11l/totient-function.11l
Normal file
13
Task/Totient-function/11l/totient-function.11l
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
F f(n)
|
||||
R sum((1..n).filter(k -> gcd(@n, k) == 1).map(k -> 1))
|
||||
|
||||
F is_prime(n)
|
||||
R f(n) == n - 1
|
||||
|
||||
L(n) 1..25
|
||||
print(‘ f(#.) == #.’.format(n, f(n))‘’(I is_prime(n) {‘, is prime’} E ‘’))
|
||||
V count = 0
|
||||
L(n) 1..10'000
|
||||
count += is_prime(n)
|
||||
I n C (100, 1000, 10'000)
|
||||
print(‘Primes up to #.: #.’.format(n, count))
|
||||
Loading…
Add table
Add a link
Reference in a new issue