나의 풀이 수학문제와 재귀함수 문제다. 규칙이 피보나치 수열처럼 존재하는 것을 확인했다. 2의 n승만큼 더해진다. 먼저 한줄을 만드는 함수를 생성하고 결과를 제곱하면 줄의 개수가 나오도록 작성했다 import sys n = int(input()) # 0 = 4, 1 def line(n): oneLine = 2 index = 0 while (True): if n==0: break oneLine += 2 ** index # print(oneLine,"oneLine") n -= 1 index += 1 return oneLine*oneLine print(line(n))