n=input()s=i=2c=1while s<n: s*=i+c;c+=1 if s==n:print range(i,i+c) if s/n:i+=1;s,c=i,1
120
[2, 3, 4, 5] [4, 5, 6]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!