login
A356891
a(n) = a(n-1) * a(n-2) + 1 if n is even, otherwise a(n) = a(n-3) + 1, with a(0) = a(1) = 1.
1
1, 1, 2, 2, 5, 3, 16, 6, 97, 17, 1650, 98, 161701, 1651, 266968352, 161702, 43169316455105, 266968353, 11524841314155180292066, 43169316455106, 497519521785644682185076928856988997, 11524841314155180292067
OFFSET
0,3
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
Cf. A007660.
Sequence in context: A344507 A322786 A184243 * A135281 A068465 A217876
KEYWORD
nonn
AUTHOR
J. Conrad, Sep 02 2022
STATUS
approved