repl.it
@jjallan/

PalegreenTastyArkshell

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
def f(n,p={()}):
 m=n*n;g=['']+[[i,''][any(i>n and i%n<1for n in p)]for i in range(2,m+1)];x=min(set(g)-p);i=0
 while i<m+n:print' '.join('%%%ds'%-len(`m`)%v for v in g[i:i+n]);i+=n
 if x<=n:f(n,p|{x})

f(4)