OFFSET
0,4
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..16
FORMULA
a(n) = 7*a(n-1)*a(n-2) - a(n-3) - 1.
MATHEMATICA
RecurrenceTable[{a[n] == (a[n - 1]^2 + a[n - 2]^2 + a[n - 1] + a[n - 2] + 1)/a[n - 3], a[0] == a[1] == a[2] == 1}, a, {n, 0, 12}] (* Michael De Vlieger, Aug 22 2016 *)
nxt[{a_, b_, c_}]:={b, c, (c^2+b^2+c+b+1)/a}; NestList[nxt, {1, 1, 1}, 15][[All, 1]] (* Harvey P. Dale, Sep 16 2021 *)
PROG
(Ruby)
def A(m, n)
a = Array.new(m, 1)
ary = [1]
while ary.size < n + 1
i = a[1..-1].inject(0){|s, i| s + i * i} + a[1..-1].inject(:+) + 1
break if i % a[0] > 0
a = *a[1..-1], i / a[0]
ary << a[0]
end
ary
end
def A276160(n)
A(3, n)
end
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Aug 22 2016
STATUS
approved