repl.it
@anonymous/

SorrowfulMeaslyUrial

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
from math import*
from fractions import*
p,n=[3,5],input()
while len(p)<n:
 for i in range(p[-1],p[-1]**2):
  v=sqrt(i**2+p[-1]**2)
  if v==int(v)and gcd(i,p[-1])==1:
   p.append(int(v));break
print p