OFFSET
0,4
COMMENTS
The symbol '*' in the name refers to the noncommutative multiplication in Hamilton's division algebra. Traditionally Q(a, b, c, d) is written a + b*i + c*j + d*k.
LINKS
Wikipedia, Quaternion
EXAMPLE
The list of polynomials starts 1, x, x^2 - 3, x^3 - 9*x, x^4 - 18*x^2 + 9, ... and the list of coefficients of the polynomials starts:
[0] [ 1]
[1] [ 0, 1]
[2] [ -3, 0, 1]
[3] [ 0, -9, 0, 1]
[4] [ 9, 0, -18, 0, 1]
[5] [ 0, 45, 0, -30, 0, 1]
[6] [-27, 0, 135, 0, -45, 0, 1]
[7] [ 0, -189, 0, 315, 0, -63, 0, 1]
[8] [ 81, 0, -756, 0, 630, 0, -84, 0, 1]
[9] [ 0, 729, 0, -2268, 0, 1134, 0, -108, 0, 1]
MATHEMATICA
Needs["Quaternions`"]
P[x_, 0 ] := Quaternion[1, 0, 0, 0];
P[x_, n_] := P[x, n] = Quaternion[x, 1, 1, 1] ** P[x, n - 1];
Table[CoefficientList[P[x, n][[1]], x], {n, 0, 10}] // Flatten
PROG
(Sage)
R.<x> = QQ[]
K = R.fraction_field()
H.<i, j, k> = QuaternionAlgebra(K, -1, -1)
def Q(a, b, c, d): return H(a + b*i + c*j + d*k)
@cached_function
def P(n):
return Q(x, 1, 1, 1)*P(n-1) if n > 0 else Q(1, 0, 0, 0)
def p(n): return P(n)[0].numerator().list()
flatten([p(n) for n in (0..10)]) # Kudos to William Stein
CROSSREFS
KEYWORD
sign,tabl
AUTHOR
Peter Luschny, Sep 14 2018
STATUS
approved