Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Tau-function/Nim/tau-function.nim
Normal file
12
Task/Tau-function/Nim/tau-function.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import math, strutils
|
||||
|
||||
func divcount(n: Natural): Natural =
|
||||
for i in 1..sqrt(n.toFloat).int:
|
||||
if n mod i == 0:
|
||||
inc result
|
||||
if n div i != i: inc result
|
||||
|
||||
echo "Count of divisors for the first 100 positive integers:"
|
||||
for i in 1..100:
|
||||
stdout.write ($divcount(i)).align(3)
|
||||
if i mod 20 == 0: echo()
|
||||
Loading…
Add table
Add a link
Reference in a new issue