OFFSET
0,3
LINKS
J. Conrad, Table of n, a(n) for n = 0..34
EXAMPLE
For n=2, a(2) = a(0) * a(1) + 1 = 2.
For n=3, a(3) = a(0) + 1 = 2.
For n=4, a(4) = a(3) * a(2) + 1 = 5.
MATHEMATICA
a[n_] := a[n] = If[EvenQ[n], a[n - 1]*a[n - 2], a[n - 3]] + 1; a[0] = a[1] = 1; Array[a, 22, 0] (* Amiram Eldar, Sep 10 2022 *)
PROG
(Python)
def A356891(length):
output = [1] * length
for n in range(2, length):
output[n] += output[n-3] if n % 2 else output[n-1] * output[n-2]
return output
CROSSREFS
KEYWORD
nonn
AUTHOR
J. Conrad, Sep 02 2022
STATUS
approved