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 A266046 #29 Sep 08 2022 08:46:15 %S A266046 1,2,2,-4,-28,-88,-184,-208,272,2336,7712,16832,21056,-16768,-193408, %T A266046 -673024,-1531648,-2088448,836096,15875072,58483712,138684416, %U A266046 203835392,-16764928,-1290072064,-5059698688,-12498362368,-19635257344,-3550855168,103608123392 %N A266046 Real part of Q^n, where Q is the quaternion 2 + j + k. %C A266046 In general, given a quaternion Q = r+u*i+v*j+w*k with integer coefficients [r,u,v,w], its powers Q^n = R(n)+U(n)*i+V(n)*j+W(n)*k define four integer sequences R(n),U(n),V(n),W(n). The process can be also transcribed as a four-term, first order recurrence for the elements of the four sequences. Since |Q^n| = |Q|^n, we have, for any n, R(n)^2+U(n)^2+V(n)^2+W(n)^2 = (L^2)^n, where L^2 = r^2+u^2+v^2+w^2 is a constant. The normalized sequence Q^n/L^n describes a unitary quaternion undergoing stepwise rotations by the angle phi = arctan(sqrt(u^2+v^2+w^2)/r). Consequently, the four sequences exhibit sign changes with the mean period of P = 2*Pi/phi steps. %C A266046 When Q has a symmetry with respect to permutations and/or inversions of the imaginary axes, the four sequences become even more interdependent. %C A266046 In this particular case Q = 2+j+k, and Q^n = a(n)+b(n)*(j+k), where b(n) is the sequence A190965. The first-order recurrence reduces to two-terms, namely a(n+1)=2*a(n)-2*b(n), b(n+1)=2*b(n)+a(n). This implies further a single-term, second order recurrence a(n+2)=4*a(n+1)-6*a(n), shared by both a(n) and b(n), but with different starting terms. The mean period of sign changes is P = 10.208598624... steps. %C A266046 The following OEIS sequences can be also cast as quaternion powers: %C A266046 Q = 1+i+j+k: Q^n = A128018(n)+A088138(n)*(i+j+k), P = 6.000, %C A266046 Q = 1+j+k : Q^n = A087455(n)+A088137(n)*(j+k), P = 6.577071086..., %C A266046 Q = 2+i+j+k: Q^n = A213421(n)+A168175(n)*(i+j+k), P = 8.803377735... %H A266046 Stanislav Sykora, <a href="/A266046/b266046.txt">Table of n, a(n) for n = 0..1000</a> %H A266046 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 A266046 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6). %F A266046 a(n)^2 + 2*A190965(n)^2 = 6^n. %F A266046 From _Colin Barker_, Dec 21 2015: (Start) %F A266046 a(n) = ((2-i*sqrt(2))^n+(2+i*sqrt(2))^n)/2, where i=sqrt(-1). %F A266046 a(n) = 4*a(n-1) - 6*a(n-2) for n>1. %F A266046 G.f.: (1-2*x) / (1-4*x+6*x^2). (End) %t A266046 LinearRecurrence[{4, -6}, {1, 2}, 30] (* _Bruno Berselli_, Dec 22 2015 *) %o A266046 (PARI) \\ A simple function to generate quaternion powers: %o A266046 QuaternionToN(r, u, v, w, nmax) = {local (M); M = matrix(nmax+1, 4); M[1, 1]=1; for(n=2, nmax+1, M[n, 1]=r*M[n-1, 1]-u*M[n-1, 2]-v*M[n-1, 3]-w*M[n-1, 4]; M[n, 2]=u*M[n-1, 1]+r*M[n-1, 2]+w*M[n-1, 3]-v*M[n-1, 4]; M[n, 3]=v*M[n-1, 1]-w*M[n-1, 2]+r*M[n-1, 3]+u*M[n-1, 4]; M[n, 4]=w*M[n-1, 1]+v*M[n-1, 2]-u*M[n-1, 3]+r*M[n-1, 4]; ); return (M); } %o A266046 a=QuaternionToN(2, 0, 1, 1, 1000)[,1]; \\ Select the real parts %o A266046 (PARI) Vec((1-2*x)/(1-4*x+6*x^2) + O(x^40)) \\ _Colin Barker_, Dec 21 2015 %o A266046 (Magma) [n le 2 select n else 4*Self(n-1)-6*Self(n-2): n in [1..40]]; // _Vincenzo Librandi_, Dec 22 2015 %Y A266046 Cf. A087455 (Inv. Bin. Transf.), A088137, A088138, A128018, A168175, A190965, A213421. %K A266046 sign,easy %O A266046 0,2 %A A266046 _Stanislav Sykora_, Dec 20 2015