This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A213421 #26 Jul 17 2019 17:14:04 %S A213421 1,2,1,-10,-47,-118,-143,254,2017,6290,11041,134,-76751,-307942, %T A213421 -694511,-622450,2371777,13844258,38774593,58188566,-38667887, %U A213421 -561991510,-1977290831,-3975222754,-2059855199,19587138482 %N A213421 Real part of Q^n, Q being the quaternion 2+i+j+k. %H A213421 Stanislav Sykora, <a href="/A213421/b213421.txt">Table of n, a(n) for n = 0..1000</a> %H A213421 Beata Bajorska-Harapińska, Barbara Smoleń, Roman Wituła, <a href="https://doi.org/10.1007/s00006-019-0969-9">On Quaternion Equivalents for Quasi-Fibonacci Numbers, Shortly Quaternaccis</a>, Advances in Applied Clifford Algebras Vol. 29, No. 3 (2019), Article 54. %H A213421 Wikipedia, <a href="http://en.wikipedia.org/wiki/Lucas_sequence">Lucas sequence</a> %F A213421 Conjecture: G.f. (1-2x)/(1-4x+7x^2). a(n) = A168175(n)-2*A168175(n-1). - _R. J. Mathar_, Jun 25 2012 %F A213421 From _Peter Bala_, Mar 29 2015: (Start) %F A213421 The above o.g.f. is correct; this is the Lucas sequence V_n(4,7). %F A213421 a(n) = Re( (2 + sqrt(3)*i)^n )= 1/2*( (2 + sqrt(3)*i)^n + (2 - sqrt(3)*i)^n ). %F A213421 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 ). %F A213421 a(n) = 4*a(n-1) - 7*a(n-2) with a(0) = 1, a(1) = 2. (End) %p A213421 #A213421 %p A213421 seq(simplify(1/2*((2+I*sqrt(3))^n+(2-I*sqrt(3))^n)), n = 0 .. 25); # _Peter Bala_, Mar 29 2015 %o A213421 (PARI) %o A213421 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);} %o A213421 Q=QuaternionToN(2,1,1,1,1000); %o A213421 for(n=1,#Q[,1],write("A213421.txt",n-1," ",Q[n,1])); %Y A213421 Cf. A168175, A087455, A088138, A128018, A146559. %K A213421 sign,easy %O A213421 0,2 %A A213421 _Stanislav Sykora_, Jun 11 2012