cp's OEIS Frontend

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.

Showing 1-5 of 5 results.

A168175 Expansion of 1/(1 - 4*x + 7*x^2).

Original entry on oeis.org

1, 4, 9, 8, -31, -180, -503, -752, 513, 7316, 25673, 51480, 26209, -255524, -1205559, -3033568, -3695359, 6453540, 51681673, 161551912, 284435937, 6880364, -1963530103, -7902282960, -17864421119, -16141703756, 60484132809
Offset: 0

Views

Author

Roger L. Bagula, Nov 19 2009

Keywords

Comments

Also the coefficient of i of Q^(n+1), Q being the quaternion 2+i+j+k. The real part of the quaternion power is A213421, see also A087455, A088138, A128018. - Stanislav Sykora, Jun 11 2012
a(n)*(-1)^n gives the coefficient c(7^n) of (eta(z^6))^4, a modular cusp form of weight 2, when expanded in powers of q = exp(2*Pi*i*z), Im(z) > 0, assuming alpha-multiplicativity (but not for primes 2 and 3) with alpha(x) = x (weight 2) and input c(7) = -4. Eta is the Dedekind function. See the Apostol reference, p. 138, eq. (54) for alpha-multiplicativity and p. 130, eq. (39) with k=2. See also A000727(n) = b(n) where c(7^n) = b((7^n-1)/6) = b(A023000(n)), n >= 0. Proof: The alpha-multiplicity with alpha(1) = 1 and c(1) = 1 leads from p^n = p^(n-1)*p to the recurrence c_n = c*c_(n-1) - a*c(n-2), with c_n = c(p^n), c = c(p) and a = alpha(p). Inputs are c_{-1} = 0 and c_0 = c(1) = 1. This gives the polynomial c_n = sqrt(a)^n * S(n,c/sqrt(a)), with Chebyshev's S-polynomials (A049310). See the Apostol reference, Exercise 6., p. 139. Here p = 7, c = -4. - Wolfdieter Lang, Apr 27 2016

Examples

			G.f. = 1 + 4*x + 9*x^2 + 8*x^3 - 31*x^4 - 180*x^5 - 503*x^6 - 752*x^7 + ... - _Michael Somos_, Feb 23 2020
		

References

  • Tom M. Apostol, Modular Functions and Dirichlet Series in Number Theory, Second edition, Springer, 1990, pp. 130, 138 - 139.

Crossrefs

Programs

  • Magma
    I:=[1,4]; [n le 2 select I[n] else 4*Self(n-1)-7*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jun 25 2012
    
  • Mathematica
    CoefficientList[Series[1/(1-4x+7x^2),{x,0,30}],x] (* or *) LinearRecurrence[ {4,-7},{1,4},30] (* Harvey P. Dale, Nov 28 2014 *)
  • PARI
    {a(n) = my(s=1, t=1); if( n<0, n=-2-n; s=-1; t=1/7); s * t^(n+1) * polcoeff(1 / (1 - 4*x + 7*x^2) + x * O(x^n), n)}; /* Michael Somos, Feb 23 2020 */

Formula

a(n) = (1/2 - i/sqrt(3))*(2 + i*sqrt(3))^n + (1/2 + i/sqrt(3))*(2 - i*sqrt(3))^n (Binet formula), where i is the imaginary unit.
a(n) = 4*a(n-1) - 7*a(n-2).
a(n) = sqrt(7)^n * S(n, 4/sqrt(7)), n >= 0, with Chebyshev's S polynomials (A049310). - Wolfdieter Lang, Apr 27 2016
E.g.f.: (2*sqrt(3)*sin(sqrt(3)*x) + 3*cos(sqrt(3)*x))*exp(2*x)/3. - Ilya Gutkovskiy, Apr 27 2016
a(n) = (-1) * 7^(n+1) * a(-2-n) for all n in Z. - Michael Somos, Feb 23 2020

A190965 a(n) = 4*a(n-1) - 6*a(n-2), with a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 4, 10, 16, 4, -80, -344, -896, -1520, -704, 6304, 29440, 79936, 143104, 92800, -487424, -2506496, -7101440, -13366784, -10858496, 36766720, 212217856, 628271104, 1239777280, 1189482496, -2680733696, -17859829760, -55354916864, -114260688896
Offset: 0

Views

Author

Keywords

Comments

For the quaternion Q = 2+j+k, Q^n = r(n) + a(n)*(j+k). The sequence of real-parts r(n) is A266046. - Stanislav Sykora, Dec 20 2015

Crossrefs

Cf. A190958 (index to generalized Fibonacci sequences).
Cf. A088137 (Inv. Bin. Trans.), A168175, A213421, A266046.

Programs

  • Magma
    [n le 2 select n-1 else 4*Self(n-1) -6*Self(n-2): n in [1..41]]; // G. C. Greubel, Jan 10 2024
    
  • Maple
    w := I*sqrt(2): a := n -> (w/4)*((2 - w)^n - (2 + w)^n):
    seq(simplify(a(n)), n = 0..20);  # (after Taras Goy), Peter Luschny, Jan 03 2025
  • Mathematica
    LinearRecurrence[{4,-6}, {0,1}, 50]
  • PARI
    a(n)=([0,1;0,0]*[0,-6;1,4]^n)[1,1] \\ Charles R Greathouse IV, May 31 2011
    
  • SageMath
    A190965=BinaryRecurrenceSequence(4,-6,0,1)
    [A190965(n) for n in range(41)] # G. C. Greubel, Jan 10 2024

Formula

G.f.: x/(1-4*x+6*x^2). - Philippe Deléham, Oct 12 2011
2*a(n)^2 + A266046(n)^2 = 6^n. - Stanislav Sykora, Dec 20 2015
From G. C. Greubel, Jan 10 2024: (Start)
a(n) = 6^((n-1)/2)*ChebyshevU(n-1, sqrt(2/3)).
E.g.f.: (1/sqrt(2))*exp(2*x)*sin(sqrt(2)*x). (End)
a(n) = (i*sqrt(2)/4)*((2 - i*sqrt(2))^n - (2 + i*sqrt(2))^n), where i = sqrt(-1). - Taras Goy, Jan 03 2025

A181738 T(n, k) is the coefficient of x^k of the polynomial p(n) which is defined as the scalar part of P(n) = Q(x+1, 1, 1, 1) * P(n-1) for n > 0 and P(0) = Q(1, 0, 0, 0) where Q(a, b, c, d) is a quaternion, triangle read by rows.

Original entry on oeis.org

1, 1, 1, -2, 2, 1, -8, -6, 3, 1, -8, -32, -12, 4, 1, 16, -40, -80, -20, 5, 1, 64, 96, -120, -160, -30, 6, 1, 64, 448, 336, -280, -280, -42, 7, 1, -128, 512, 1792, 896, -560, -448, -56, 8, 1, -512, -1152, 2304, 5376, 2016, -1008, -672, -72, 9, 1, -512, -5120, -5760, 7680, 13440, 4032, -1680, -960, -90, 10, 1
Offset: 0

Views

Author

Keywords

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.

Examples

			The list of polynomials starts 1, 1 + x, -2 + 2*x + x^2, -8 - 6*x + 3*x^2 + x^3, ... and the list of coefficients of the polynomials starts:
{   1},
{   1,     1},
{  -2,     2,     1},
{  -8,    -6,     3,    1},
{  -8,   -32,   -12,    4,     1},
{  16,   -40,   -80,  -20,     5,     1},
{  64,    96,  -120, -160,   -30,     6,     1},
{  64,   448,   336, -280,  -280,   -42,     7,    1},
{-128,   512,  1792,  896,  -560,  -448,   -56,    8,   1},
{-512, -1152,  2304, 5376,  2016, -1008,  -672,  -72,   9,  1},
{-512, -5120, -5760, 7680, 13440,  4032, -1680, -960, -90, 10, 1}.
		

Crossrefs

Cf. T(n,0) = A138230, A213421 (row sums).

Programs

  • Mathematica
    Needs["Quaternions`"]
    P[x_, 0 ] := Quaternion[1, 0, 0, 0];
    P[x_, n_] := P[x, n] = Quaternion[x + 1, 1, 1, 1] ** P[x, n - 1];
    Table[CoefficientList[P[x, n][[1]], x], {n, 0, 10}] // Flatten
  • Sage
    R. = QQ[]
    K = R.fraction_field()
    H. = 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,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, Peter Luschny, Sep 14 2018

Extensions

Edited by Peter Luschny, Sep 14 2018

A266046 Real part of Q^n, where Q is the quaternion 2 + j + k.

Original entry on oeis.org

1, 2, 2, -4, -28, -88, -184, -208, 272, 2336, 7712, 16832, 21056, -16768, -193408, -673024, -1531648, -2088448, 836096, 15875072, 58483712, 138684416, 203835392, -16764928, -1290072064, -5059698688, -12498362368, -19635257344, -3550855168, 103608123392
Offset: 0

Views

Author

Stanislav Sykora, Dec 20 2015

Keywords

Comments

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.
When Q has a symmetry with respect to permutations and/or inversions of the imaginary axes, the four sequences become even more interdependent.
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.
The following OEIS sequences can be also cast as quaternion powers:
Q = 1+i+j+k: Q^n = A128018(n)+A088138(n)*(i+j+k), P = 6.000,
Q = 1+j+k : Q^n = A087455(n)+A088137(n)*(j+k), P = 6.577071086...,
Q = 2+i+j+k: Q^n = A213421(n)+A168175(n)*(i+j+k), P = 8.803377735...

Crossrefs

Cf. A087455 (Inv. Bin. Transf.), A088137, A088138, A128018, A168175, A190965, A213421.

Programs

  • Magma
    [n le 2 select n else  4*Self(n-1)-6*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Dec 22 2015
  • Mathematica
    LinearRecurrence[{4, -6}, {1, 2}, 30] (* Bruno Berselli, Dec 22 2015 *)
  • PARI
    \\ A simple function to generate quaternion powers:
    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); }
    a=QuaternionToN(2, 0, 1, 1, 1000)[,1]; \\ Select the real parts
    
  • PARI
    Vec((1-2*x)/(1-4*x+6*x^2) + O(x^40)) \\ Colin Barker, Dec 21 2015
    

Formula

a(n)^2 + 2*A190965(n)^2 = 6^n.
From Colin Barker, Dec 21 2015: (Start)
a(n) = ((2-i*sqrt(2))^n+(2+i*sqrt(2))^n)/2, where i=sqrt(-1).
a(n) = 4*a(n-1) - 6*a(n-2) for n>1.
G.f.: (1-2*x) / (1-4*x+6*x^2). (End)

A094944 A sequence with a(n)/a(n-1) converging to 7, generated from a semi-magic square.

Original entry on oeis.org

1, 17, 121, 769, 5681, 39121, 274345, 1922945, 13447009, 94165777, 659108825, 4613711233, 32296542097, 226073894609, 1582520918281, 11077645104385, 77543495432897, 542804558486545, 3799631689665337, 26597422073425409
Offset: 1

Views

Author

Gary W. Adamson, May 25 2004

Keywords

Comments

3 rows: 1 4 2, 2 1 4, 4 2 1 form a semi-magic square: row sums and columns and the diagonal = 7, the convergent of the sequence.

Examples

			a(4) = 769 since M^4 * [1 0 0] = [769 824 808].
		

Crossrefs

Cf. A094943 uses the same format and operations but with different terms.

Programs

  • Mathematica
    a[n_] := (MatrixPower[{{1, 4, 2}, {2, 1, 4}, {4, 2, 1}}, n].{{1}, {0}, {0}})[[1, 1]]; Table[ a[n], {n, 10}] (* Robert G. Wilson v, May 29 2004 *)

Formula

Let M = the 3 X 3 matrix [1 4 2 / 2 1 4 / 4 2 1], then with M^n * [1 0 0] = [p q r], a(n) = p.
G.f.: -x*(7*x+1)^2 / ((7*x-1)*(7*x^2+4*x+1)). [Colin Barker, Dec 06 2012]
3*a(n) = 7^n +2 *(-1)^n *A213421(n). - R. J. Mathar, Nov 15 2019

Extensions

Edited and extended by Robert G. Wilson v, May 29 2004
Showing 1-5 of 5 results.