Skip to content
sequences.py 281 B
Newer Older
import math
import helpers

def fibonacci(n):
    """return frist n elements of the fibonacci sequence with seeds 0 and 1"""
    res = [0, 1]
    for i in range(n-3):
        res.append(res[-1] + res[-2])
    return res


def naturalsquares(n):
    return [x**2 for x in range(n)]