(MAGMAMagma) I:=[1, 1, 1, 1, 2]; [n le 5 select I[n] else (Self(n-1)*Self(n-4) - Self(n-2)*Self(n-3))/Self(n-5): n in [1..50]]; // G. C. Greubel, Aug 11 2018
(MAGMAMagma) I:=[1, 1, 1, 1, 2]; [n le 5 select I[n] else (Self(n-1)*Self(n-4) - Self(n-2)*Self(n-3))/Self(n-5): n in [1..50]]; // G. C. Greubel, Aug 11 2018
editing
approved
a(-n) = -a(-n). , a(n) * a(n-5) = a(n-1) * a(n-4) - a(n-2) * a(n-3) for all n in Z.
a(n+4) * a(n-4) = a(n+2) * a(n-2) - a(n) * a(n). , a(n+2) * a(n-2) = (2 - (-1)^n) * a(n+1) * a(n-1) - a(n) * a(n) for all n in Z.
(PARI) {a(n) = localmy(v, m); if( n==0, 0, m = abs(n); sign(n) * if( m<6, 1 + (m>4), v = vector( m, i, 1); v[5] = 2; for( i=6, m, v[i] = (v[i-1] * v[i-4] - v[i-2] * v[i-3]) / v[i-5]); v[m]))};
proposed
editing
editing
proposed
G.f. = x + x^2 + x^3 + x^4 + 2*x^5 + x^6 - x^7 - 3*x^8 - 5*x^9 - 4*x^10 + ...
(MAGMA) I:=[1, 1, 1, 1, 2]; [n le 5 select I[n] else (Self(n-1)*Self(n-4) - Self(n-2)*Self(n-3))/Self(n-5): n in [1..50]]; // G. C. Greubel, Aug 11 2018
approved
editing
editing
approved
<a href="/index/Di#divseq">Index to divisibility sequences</a>
(PARI) {a(n) = local(v, m); if( n==0, 0, m = abs(n); sign(n) * if( m<6, 1 + (m>4), v = vector( m, i, 1); v[5] = 2; for( i=6, m, v[i] = (v[i-1] * v[i-4] - v[i-2] * v[i-3]) / v[i-5]); v[m]))}
approved
editing
editing
approved
K. S. Brown, <a href="http://www.mathpages.com/home/kmath162/kmath162.htm">A Quasi-Periodic Sequence</a>
K. S. Brown, <a href="http://www.mathpages.com/home/kmath162/kmath162.htm">A Quasi-Periodic Sequence</a>
Alois P. Heinz, <a href="/A210098/b210098.txt">Table of n, a(n) for n = 0..200</a>
a:= proc(n) a(n):= `if`(n<6, [0, 1$4, 2][n+1],
(a(n-1)*a(n-4) -a(n-2)*a(n-3)) / a(n-5))
end:
seq (a(n), n=0..40); # Alois P. Heinz, Oct 20 2012