26 lines
503 B
Plaintext
26 lines
503 B
Plaintext
func print_i64[x: I64] : I64
|
|
printf("%ld\n", x)
|
|
|
|
func num_divisors[n: I64] : I64
|
|
let end: I64 = isqrt(n)
|
|
|
|
let result: I64 = 0
|
|
let i: I64 = 1
|
|
while i < end + 1
|
|
if n % i == 0
|
|
result = result + 2
|
|
i = i + 1
|
|
|
|
if end * end == n
|
|
result = result - 1
|
|
return result
|
|
|
|
func main[] : I64
|
|
let n: I64 = 0
|
|
let i: I64 = 1
|
|
while 1
|
|
n = n + i
|
|
if num_divisors(n) > 500
|
|
print_i64(n)
|
|
return 0
|
|
i = i + 1 |