for x in range(4,10): print ' 3579'[:(1+x)/2]+'1468'[:x/2]+'2'
Standard input is empty
3142 3142 351462 351462 35714682 35714682
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!