solution_003b.py

#! /usr/bin/python3
# ===================================================================
# Sequence 
# ===================================================================

from math import sqrt

x0 = 0
x1 = 1

print(x0)
print(x1)

while(True):

    xx = (x0**2) + (x1**2)

    x = round(sqrt(xx))

    ##print(f'Debug: {xx} --> {x}')

    if x > 500:
        break

    print(x)

    x0,x1 = x1,xx