OFFSET
0,3
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := a[n] = a[n - 2]^2 + a[n - 1] + 1; Array[a, 16, 0] (* Amiram Eldar, Jan 05 2023 *)
PROG
(Python)
# a generator
def agen_q():
a, b = 0, 1
while 1:
yield a
a, b = b, (a * a) + b + 1
f = agen_q(); print([next(f) for _ in range(20)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Wall, Jan 03 2023
STATUS
approved