Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #76 Sep 12 2022 11:05:16
%S 1,1,1,1,2,2,5,11,25,97,220,1396,6053,30467,249431,1381913,19850884,
%T 160799404,1942868797,36133524445,458473480079,13521902050025,
%U 220176552243482,7006033824529130,276364333237297549,7470025110120086101,460097285931623600317,17010560092754291510533,1372227474279446678113082
%N a(n) = (a(n-1) * a(n-5) + a(n-2) * a(n-4) + a(n-3)^2) / a(n-6), a(0) = a(1) = a(2) = a(3) = 1, a(4) = a(5) = 2.
%C David Speyer showed (modulo some empirical relations) that all terms are integer.
%H Seiichi Manyama, <a href="/A227999/b227999.txt">Table of n, a(n) for n = 0..172</a>
%H MathOverflow, <a href="https://mathoverflow.net/q/143609">Does this sequence always give an integer?</a>
%F For n>=6, a(n) = (a(n-1) * a(n-5) + a(n-2) * a(n-4) + a(n-3)^2) / a(n-6).
%F a(n) = a(3-n) for all n in Z. - _Michael Somos_, Apr 25 2017
%F 0 = a(n)*a(n+9) +a(n+1)*a(n+8) +a(n+2)*a(n+7) -a(n+3)*a(n+6) -32*a(n+4)*a(n+5) for all n in Z. - _Michael Somos_, Apr 25 2017
%F 0 = a(n)*a(n+10) -a(n+1)*a(n+9) -32*a(n+2)*a(n+8) +17*a(n+3)*a(n+7) +49*a(n+4)*a(n+6) for all n in Z. - _Michael Somos_, Apr 25 2017
%F 0 = +a(n)*a(n+11) -32*a(n+1)*a(n+10) -33*a(n+2)*a(n+9) -49*a(n+3)*a(n+8) +1007*a(n+5)*a(n+6) for all n in Z. - _Michael Somos_, Apr 25 2017
%t RecurrenceTable[{a[0]==a[1]==a[2]==a[3]==1,a[4]==a[5]==2,a[n]==(a[n-1] a[n-5]+ a[n-2]a[n-4]+a[n-3]^2)/a[n-6]},a,{n,30}] (* _Harvey P. Dale_, Nov 11 2014 *)
%t a[ n_] := Which[ Abs[n - 3/2] < 2, 1, Abs[n - 3/2] < 4, 2, n < 0, a[3 - n], True, (a[n - 1] a[n - 5] + a[n - 2] a[n - 4] + a[n - 3]^2) / a[n - 6]]; (* _Michael Somos_, Jul 24 2018 *)
%o (PARI) {a(n) = my(v); if( n<2, n = 3-n); n++; v = vector(n, i, 1+(i>4)); for(k=7, n, v[k] = (v[k-1]*v[k-5] + v[k-2]*v[k-4] + v[k-3]*v[k-3]) / v[k-6]); v[n]}; /* _Michael Somos_, Apr 25 2017 */
%o (Magma) I:=[1,1,1,1,2,2]; [n le 6 select I[n] else (Self(n-1)*Self(n-5) + Self(n-2)*Self(n-4) + Self(n-3)^2)/Self(n-6): n in [1..30]]; // _G. C. Greubel_, Aug 08 2018
%Y A variation of A006722.
%K nonn
%O 0,5
%A _Max Alekseyev_, Dec 04 2013