OFFSET
0,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..17
MATHEMATICA
RecurrenceTable[{a[0]==a[1]==2, a[n]==a[n-1]*a[n-2] +1}, a, {n, 0, 20}]
PROG
(Magma) [n le 2 select 2 else Self(n-1)*Self(n-2)+1: n in [1..20]];
(PARI) a(n) = if(n<2, 2, 1 + a(n-1)*a(n-2))
vector(20, n, a(n-1)) \\ Altug Alkan, Sep 30 2015
(PARI) {a(n) = if( n<2, 2 * (n>=0), self()(n-1) * self()(n-2) + 1)}; /* Michael Somos, Oct 02 2015 */
(Sage)
def a(n):
if (n==0 or n==1): return 2
else: return a(n-1)*a(n-2) +1
[a(n) for n in (0..20)] # G. C. Greubel, Jun 07 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Sep 30 2015
STATUS
approved