Hong-Phuc Bui
2024-05-15 7df20ac74520ea7cbb38152e14f8bc4e8fb125e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env python
# -*-encoding utf-8-*-
 
import sys
 
n = int(sys.argv[1])
p = 2
 
iteration = 0
while n > 1:
    q, r = divmod(n, p)
    if r == 0:
        print(f"{p} ", end="")
        n = q
    else:
        p += 1
    iteration += 1
 
print(f"\niteration: {iteration}")