python3 - <<'PY' p=996979 f=[] n=p i=2 while i*i<=n: while n%i==0: f.append(i); n//=i i+=1 if n>1: f.append(n) print(f) PY