OFFSET
0,2
LINKS
Stanislav Sykora, Table of n, a(n) for n = 0..1000
Beata Bajorska-Harapińska, Barbara Smoleń, Roman Wituła, On Quaternion Equivalents for Quasi-Fibonacci Numbers, Shortly Quaternaccis, Advances in Applied Clifford Algebras Vol. 29, No. 3 (2019), Article 54.
Wikipedia, Lucas sequence
FORMULA
From Peter Bala, Mar 29 2015: (Start)
The above o.g.f. is correct; this is the Lucas sequence V_n(4,7).
a(n) = Re( (2 + sqrt(3)*i)^n )= 1/2*( (2 + sqrt(3)*i)^n + (2 - sqrt(3)*i)^n ).
a(n) = 1/2 * trace( [ 2 + i, 1 + i; -1 + i, 2 - i ]^n ) = 1/2 * trace( [ 2 , sqrt(3)*i ; sqrt(3)*i, 2 ]^n ).
a(n) = 4*a(n-1) - 7*a(n-2) with a(0) = 1, a(1) = 2. (End)
MAPLE
seq(simplify(1/2*((2+I*sqrt(3))^n+(2-I*sqrt(3))^n)), n = 0 .. 25); # Peter Bala, Mar 29 2015
PROG
(PARI)
QuaternionToN(a, b, c, d, nmax) = {local (C); C = matrix(nmax+1, 4); C[1, 1]=1; for(n=2, nmax+1, C[n, 1]=a*C[n-1, 1]-b*C[n-1, 2]-c*C[n-1, 3]-d*C[n-1, 4]; C[n, 2]=b*C[n-1, 1]+a*C[n-1, 2]+d*C[n-1, 3]-c*C[n-1, 4]; C[n, 3]=c*C[n-1, 1]-d*C[n-1, 2]+a*C[n-1, 3]+b*C[n-1, 4]; C[n, 4]=d*C[n-1, 1]+c*C[n-1, 2]-b*C[n-1, 3]+a*C[n-1, 4]; ); return (C); }
Q=QuaternionToN(2, 1, 1, 1, 1000);
for(n=1, #Q[, 1], write("A213421.txt", n-1, " ", Q[n, 1]));
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Stanislav Sykora, Jun 11 2012
STATUS
approved