Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Totient-function/Jq/totient-function-2.jq
Normal file
19
Task/Totient-function/Jq/totient-function-2.jq
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
def task:
|
||||
def task1($n):
|
||||
range(1;$n)
|
||||
| totient as $totient
|
||||
| {i: ., $totient, isprime: ($totient == ( . - 1 ))};
|
||||
|
||||
task1(26);
|
||||
|
||||
def onepass:
|
||||
reduce (10000 | primes_via_totient) as $p ({};
|
||||
if $p < 10000
|
||||
then .["10^4"] += 1
|
||||
| if $p < 1000
|
||||
then .["10^3"] += 1
|
||||
| if $p < 100
|
||||
then .["10^2"] += 1
|
||||
else . end else . end else . end) ;
|
||||
|
||||
task, "\nCounts of primes up to the given limits:", onepass
|
||||
Loading…
Add table
Add a link
Reference in a new issue