login
A recurrence of order 3 : a(0)=a(1)=a(2)=1 ; a(n) = (a(n-1)^2 + a(n-2)^2 + a(n-1) + a(n-2) + 1)/a(n-3).
2

%I #21 Sep 16 2021 13:09:29

%S 1,1,1,5,33,1153,266337,2149605893,4007637093066433,

%T 60303882185826956720761345,

%U 1691732525726797389070758961468800814420801,714126272449521825808382965880022542720530687818734820147878380094981

%N A recurrence of order 3 : a(0)=a(1)=a(2)=1 ; a(n) = (a(n-1)^2 + a(n-2)^2 + a(n-1) + a(n-2) + 1)/a(n-3).

%H Seiichi Manyama, <a href="/A276160/b276160.txt">Table of n, a(n) for n = 0..16</a>

%F a(n) = 7*a(n-1)*a(n-2) - a(n-3) - 1.

%t 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 *)

%t 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 *)

%o (Ruby)

%o def A(m, n)

%o a = Array.new(m, 1)

%o ary = [1]

%o while ary.size < n + 1

%o i = a[1..-1].inject(0){|s, i| s + i * i} + a[1..-1].inject(:+) + 1

%o break if i % a[0] > 0

%o a = *a[1..-1], i / a[0]

%o ary << a[0]

%o end

%o ary

%o end

%o def A276160(n)

%o A(3, n)

%o end

%Y Cf. A101368, A276122.

%K nonn

%O 0,4

%A _Seiichi Manyama_, Aug 22 2016