RosettaCodeData/Task/Arithmetic-numbers/11l/arithmetic-numbers.11l
2023-07-01 13:44:08 -04:00

30 lines
731 B
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

F factors(Int n)
V f = Set([1, n])
V i = 2
L
V j = n I/ i
I j < i
L.break
I i * j == n
f.add(i)
f.add(j)
i++
R f
V arithmetic_count = 0
V composite_count = 0
V n = 1
L arithmetic_count <= 1000000
V f = factors(n)
I sum(f) % f.len == 0
arithmetic_count++
I f.len > 2
composite_count++
I arithmetic_count <= 100
print(f:{n:3} , end' )
I arithmetic_count % 10 == 0
print()
I arithmetic_count C (1000, 10000, 100000, 1000000)
print("\n"arithmetic_countth arithmetic number is n)
print(Number of composite arithmetic numbers <= n: composite_count)
n++