Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
table(+, +, nt)
|
||||
phi(X, 0, _) = X.
|
||||
phi(X, A, Primes) = phi(X, A - 1, Primes) - phi(X // Primes[A], A - 1, Primes).
|
||||
|
||||
pi(N) = Count, N < 2 => Count = 0.
|
||||
pi(N) = Count =>
|
||||
M = floor(sqrt(N)),
|
||||
A = pi(M),
|
||||
Count = phi(N, A, math.primes(M)) + A - 1.
|
||||
|
||||
main =>
|
||||
N = 1,
|
||||
foreach (K in 0..9)
|
||||
writef("10^%w %w%n", K, pi(N)),
|
||||
N := N * 10.
|
||||
Loading…
Add table
Add a link
Reference in a new issue