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}")
|
|