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.

User: Russell Walsmith

Russell Walsmith's wiki page.

Russell Walsmith has authored 25 sequences. Here are the ten most recent ones:

A254308 a(n) = a(n-1) + (if a(n-1) is odd a(n-2) else a(n-3)) with a(0) = 0, a(1) = 1.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 11, 19, 30, 41, 71, 112, 153, 265, 418, 571, 989, 1560, 2131, 3691, 5822, 7953, 13775, 21728, 29681, 51409, 81090, 110771, 191861, 302632, 413403, 716035, 1129438, 1542841, 2672279, 4215120, 5757961, 9973081, 15731042, 21489003, 37220045
Offset: 0

Author

Russell Walsmith, Feb 23 2015

Keywords

Comments

Every third iteration is a tribonacci-type recursion: a(n) = a(n-1) + a(n-3) otherwise it is Fibonacci-type a(n) = a(n-1) + a(n-2).

Examples

			For n = 7, a(n-1) is even so 8 + 3 = 11.
G.f. = x + x^2 + 2*x^3 + 3*x^4 + 5*x^5 + 8*x^6 + 11*x^7 + 19*x^8 + 30*x^9 + ...
		

Crossrefs

Programs

  • Haskell
    a254308 n = a254308_list !! n
    a254308_list = 0 : 1 : 1 : zipWith3 (\u v w -> u + if odd u then v else w)
                   (drop 2 a254308_list) (tail a254308_list) a254308_list
    -- Reinhard Zumkeller, Feb 24 2015
    
  • Magma
    m:=60; R:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!(x*(1+x+2*x^2-x^3+x^4)/(1-4*x^3+x^6))); // G. C. Greubel, Aug 03 2018
  • Mathematica
    CoefficientList[Series[x*(1+x+2*x^2-x^3+x^4)/(1-4*x^3+x^6), {x, 0, 60}], x] (* G. C. Greubel, Aug 03 2018 *)
    nxt[{a_,b_,c_}]:={b,c,If[OddQ[c],c+b,c+a]}; NestList[nxt,{0,1,1},50][[All,1]] (* or *) LinearRecurrence[{0,0,4,0,0,-1},{0,1,1,2,3,5},50] (* Harvey P. Dale, May 12 2022 *)
  • PARI
    {a(n) = polcoeff( x * if( n<0, n=-n; -(1 - x + 2*x^2 + x^3 + x^4), (1 + x + 2*x^2 - x^3 + x^4)) / (1 - 4*x^3 + x^6) + x * O(x^n), n)}; /* Michael Somos, Feb 23 2015 */
    

Formula

Two identities: a(3n)/2 + a(3n-3)/2 = a(3n-1); a(3n)/2 - a(3n-3)/2 = a(3n-2).
G.f.: x * (1 + x + 2*x^2 - x^3 + x^4) / (1 - 4*x^3 + x^6). - Michael Somos, Feb 23 2015
0 = a(n) - 4*a(n+3) + a(n+6) for all n in Z. - Michael Somos, Feb 23 2015
a(3*n) = A052530(n). a(3*n-2) = A001835(n). a(3*n+2) = A001834(n). - Michael Somos, Feb 23 2015

A249580 List of quadruples (r,s,t,u): the matrix M = [[4,12,9][2,5,3][1,2,1]] is raised to successive negative powers, then (r,s,t,u) are the square roots of M[1,3], M[1,1], M[3,3], M[3,1] respectively.

Original entry on oeis.org

3, -1, -2, 1, -9, 4, 7, -3, 30, -13, -23, 10, -99, 43, 76, -33, 327, -142, -251, 109, -1080, 469, 829, -360, 3567, -1549, -2738, 1189, -11781, 5116, 9043, -3927, 38910, -16897, -29867, 12970, -128511, 55807, 98644, -42837
Offset: 1

Author

Russell Walsmith, Nov 02 2014

Keywords

Comments

The sequence, in reverse order, comprises numbers to the left of a(0) in A249579, where the terms would be labeled a(-1), a(-2), a(-3), ... .
This sequence 'factors' into four sequences with alternating signs. Ignoring signage, they are A052906, A003688, A052924 and A006190 (listed as crossrefs below).

Examples

			M^-1 = [[1,-6,9][-1,5,-6][1,-4,4]]. sqrt(M[1,3]) = 3, sqrt(M[1,1]) = -1, sqrt(M[3,3]) = -2, sqrt(M[3,1]) = 1. Then r = 3; s = -1; t = -2; ; u = 1.
M^-2 = [[16,-72,81][-12,55,-63][9,-42,49]]. sqrt(M[1,3]) = -9, sqrt(M[1,1]) = 4, sqrt(M[3,3]) = 7, sqrt(M[3,1]) = -3. Then r = -9; s = 4; t = 7; ; u = -3.
		

Crossrefs

Cf. A249579. Disregarding signage, a(4n) = A052906; a(4n+1) = A003688; a(4n+2) = A052924; a(4n+3) = A006190.

Programs

  • Mathematica
    m[e_] := MatrixPower[{{4, 12, 9}, {2, 5, 3}, {1, 2, 1}}, -e]; g[e_, x_, y_] := (-1)^If[x == y, e, e + 1] Sqrt@ m[e][[x, y]]; f[e_] := {g[e, 1, 3], g[e, 1, 1], g[e, 3, 3], g[e, 3, 1]}; Array[f, 10] // Flatten (* Robert G. Wilson v, Dec 19 2014 *)
  • PARI
    Vec(-x*(x^6+x^5+x^3-2*x^2-x+3)/(x^8-3*x^4-1) + O(x^100)) \\ Colin Barker, Nov 06 2014

Formula

a(n) = -3*a(n-4)+a(n-8). - Colin Barker, Nov 06 2014
G.f.: -x*(x^6+x^5+x^3-2*x^2-x+3) / (x^8-3*x^4-1). - Colin Barker, Nov 06 2014

A249579 List of quadruples (r,s,t,u): the matrix M = [[4,12,9][2,5,3][1,2,1]] is raised to successive powers, then (r,s,t,u) are the square roots of M[3,1], M[3,3], M[1,1], M[1,3] respectively.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 2, 3, 3, 4, 7, 9, 10, 13, 23, 30, 33, 43, 76, 99, 109, 142, 251, 327, 360, 469, 829, 1080, 1189, 1549, 2738, 3567, 3927, 5116, 9043, 11781, 12970, 16897, 29867, 38910, 42837, 55807, 98644, 128511, 141481, 184318, 325799, 424443, 467280
Offset: 0

Author

Russell Walsmith, Nov 02 2014

Keywords

Examples

			M^0 = [[1,0,0][0,1,0][0,0,1]]: r = sqrt(M[3,1]) = a(0) = 0, s = sqrt(M[3,3]) = a(1) = 1, t = sqrt(M[1,1]) = a(2) = 1, u = sqrt(M[1,3])u = a(3) = 0.
M^2 = [[49, 126, 81][21, 55, 36][9, 24, 16]]: r = sqrt(M[3, 1]) = a(8) = 3, s = sqrt(M[3, 3]) = a(9) = 4, t = sqrt(M[1, 1]) = a(10) = 7, u = sqrt(M[1, 3]) = a(11) = 9.
		

Crossrefs

a(4n) = A006190
a(4n+2) = A052924.

Programs

  • Magma
    I:=[0,1,1,0,1,1,2,3]; [n le 8 select I[n] else 3*Self(n-4)+Self(n-8): n in [1..50]]; // Vincenzo Librandi, Nov 14 2014
  • Mathematica
    CoefficientList[Series[- x (3 x^6 - x^5 - 2 x^4 + x^3 + x + 1) / (x^8 + 3 x^4 - 1), {x, 0, 50}], x] (* Vincenzo Librandi, Nov 14 2014 *)
  • PARI
    concat(0, Vec(-x*(3*x^6-x^5-2*x^4+x^3+x+1)/(x^8+3*x^4-1) + O(x^100))) \\ Colin Barker, Nov 13 2014
    

Formula

Some identities:
a4(n-1) + a(4n) = a(4n+1),
a(4n) + a(4n+1) = a(4n+2),
3a(4n) = a(4n+3).
a(n) = 3*a(n-4)+a(n-8). - Colin Barker, Nov 13 2014
G.f.: -x*(3*x^6-x^5-2*x^4+x^3+x+1) / (x^8+3*x^4-1). - Colin Barker, Nov 13 2014

Extensions

More terms from Colin Barker, Nov 13 2014

A249581 List of quadruples (r,s,t,u): the matrix M = [[9,24,16][3,10,8][1,4,4]] is raised to successive powers, then (r,s,t,u) are the square roots of M[3,1], M[3,3], M[1,1], M[1,3] respectively.

Original entry on oeis.org

0, 1, 1, 0, 1, 2, 3, 4, 5, 8, 13, 20, 23, 36, 59, 92, 105, 164, 269, 420, 479, 748, 1227, 1916, 2185, 3412, 5597, 8740, 9967, 15564, 25531, 39868, 45465, 70996, 116461, 181860, 207391, 323852, 531243, 829564, 946025, 1477268, 2423293, 3784100
Offset: 0

Author

Russell Walsmith, Nov 03 2014

Keywords

Comments

The general form of these matrices is [[t^2,2tu,u^2][rt,st+ru,su][r^2,2rs,s^2]]. Different symmetries have different properties.
Iff |r * u - s * t| = 1 then terms to the left of a(0) are all integers.

Examples

			M^0 = [[1,0,0][0,1,0][0,0,1]]. r = sqrt(M[3,1]) = a(0) = 0; s = sqrt(M[3,3]) = a(1) = 1; t = sqrt(M[1,1]) = a(2) = 1; u = sqrt(M[1,3]) = a(3) = 0.
M^1 = [[9,24,16][3,10,8][1,4,4]]. r = sqrt(M[3,1]) = a(4) = 1; s = sqrt(M[3,3]) = a(5) = 2; t = sqrt(M[1,1]) = a(6) = 3; u = sqrt(M[1,3]) = a(7) = 4.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0,0,0,5,0,0,0,-2},{0,1,1,0,1,2,3,4},50] (* Harvey P. Dale, Aug 01 2016 *)
  • PARI
    concat(0, Vec(x*(4*x^6-2*x^5-3*x^4+x^3+x+1)/(2*x^8-5*x^4+1) + O(x^100))) \\ Colin Barker, Nov 04 2014

Formula

a(4n) + a(4n + 1) = a(4n + 2).
a(4n + 1) + a(4n + 2) + a(4n + 3) - a(4n) = a(4n + 5)
4a(4n) = a(4n+3).
a(4n+1) = A147722(n), a(4n+2) = A052984(n).
a(n) = 5*a(n-4)-2*a(n-8). - Colin Barker, Nov 04 2014
G.f.: x*(4*x^6-2*x^5-3*x^4+x^3+x+1) / (2*x^8-5*x^4+1). - Colin Barker, Nov 04 2014

A249578 List of triples (r,s,t): the matrix M = [[4,12,9][2,7,6][1,4,4]] is raised to successive powers, then (r,s,t) are the square roots of M[3,1], M[1,1], M[1,3] respectively.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 4, 7, 12, 15, 26, 45, 56, 97, 168, 209, 362, 627, 780, 1351, 2340, 2911, 5042, 8733, 10864, 18817, 32592, 40545, 70226, 121635, 151316, 262087, 453948, 564719, 978122, 1694157, 2107560, 3650401, 6322680
Offset: 0

Author

Russell Walsmith, Nov 03 2014

Keywords

Comments

M is the 'Fibonacci matrix' F = [[1,2,1][1,1,0][1,0,0]] taken to the third power and flipped on a vertical axis.
Sequence identities:
2a(3n-2) + a(3n-1) = a(3n+1)
2a(3n) + a(3n+1) = a(3n+3)
a(3n-2) + a(3n-1) + a(3n+1) = a(3n+2)
a(3n) + a(3n+1) + a(3n-3) = a(3n+2)
a(3n-1) * a(3n) + a(3n+1) * a(3n-2) = a(6n-2).

Examples

			M^0 = the 3 X 3 identity matrix = [[1,0,0][0,1,0][0,0,1]]. M[3,1] = 0; M[1,1] = 1; M[1,3] = 0. So the first triple is r = a(0) = 0; s = a(1) = 1; t = a(2) = 0.
M^1 = [[4,12,9][2,7,6][1,4,4]], so r = a(3) = 1; s = a(4) = 2; t = a(5) = 3.
		

Crossrefs

a(3n) = the n-th term of A001353.
a(3n+1) = n-th term of A001075.
a(3n+2) = n-th term of A005320.

Programs

  • Magma
    I:=[0,1,0,1,2,3]; [n le 6 select I[n] else 4*Self(n-3)-Self(n-6): n in [1..40]]; // Vincenzo Librandi, Nov 04 2014
  • Mathematica
    CoefficientList[Series[x (3 x^4 - 2 x^3 + x^2 + 1) / (x^6 - 4 x^3 + 1), {x, 0, 70}], x] (* Vincenzo Librandi, Nov 04 2014 *)
    LinearRecurrence[{0,0,4,0,0,-1},{0,1,0,1,2,3},40] (* Harvey P. Dale, Jan 17 2017 *)
  • PARI
    concat(0, Vec(x*(3*x^4-2*x^3+x^2+1)/(x^6-4*x^3+1) + O(x^100))) \\ Colin Barker, Nov 04 2014
    

Formula

a(n) = 4*a(n-3)-a(n-6).
G.f.: x*(3*x^4-2*x^3+x^2+1) / (x^6-4*x^3+1). - Colin Barker, Nov 04 2014

A249577 List of triples (r,s,t): the matrix M = [[1,4,4][1,3,2][1,2,1]] is raised to successive negative powers, then (r,s,t) are the square roots of M[3,1], M[1,1], M[1,3] respectively.

Original entry on oeis.org

2, -1, 1, -4, 3, -2, 10, -7, 5, -24, 17, -12, 58, -41, 29, -140, 99, -70, 338, -239, 169, -816, 577, -408, 1970, -1393, 985, -4756, 3363, -2378, 11482, -8119, 5741, -27720, 19601, -13860, 66922, -47321, 33461, -161564, 114243, -80782, 390050, -275807, 195025, -941664, 665857, -470832
Offset: 0

Author

Russell Walsmith, Nov 01 2014

Keywords

Comments

The sequence comprises, in reverse order, numbers to the right of a(0) in A249576.

Examples

			M^-1 = [[1,-4,4][-1,3,-2][1,-2,1]]. sqrt(M[1,3]) = 2; M[3,3] = M[1,1] = -1; M[3,1] = 1. Hence a(0) = 2; a(1) = -1; a(2) = 1.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0,0,-2,0,0,1},{2,-1,1,-4,3,-2},50] (* Harvey P. Dale, Aug 02 2024 *)
  • PARI
    Vec(-(x^4+x^2-x+2)/(x^6-2*x^3-1) + O(x^100)) \\ Colin Barker, Nov 02 2014

Formula

a(n) = -2*a(n-3)+a(n-6); G.f.: -(x^4+x^2-x+2) / (x^6-2*x^3-1). - Colin Barker, Nov 02 2014

A249576 List of triples (r,s,t): the matrix M = [[1,4,4][1,3,2][1,2,1]] is raised to successive powers, then (r,s,t) are the square roots of M[3,1], M[1,1], M[1,3] respectively.

Original entry on oeis.org

0, 1, 0, 1, 1, 2, 2, 3, 4, 5, 7, 10, 12, 17, 24, 29, 41, 58, 70, 99, 140, 169, 239, 338, 408, 577, 816, 985, 1393, 1970, 2378, 3363, 4756, 5741, 8119, 11482, 13860, 19601, 27720, 33461, 47321, 66922, 80782, 114243, 161564, 195025, 275807, 390050, 470832, 665857, 941664
Offset: 0

Author

Russell Walsmith, Nov 01 2014

Keywords

Comments

Numbers to the left of a(0) are in A249577.
Some identities:
a(3n - 2) + a(3n - 1) = a(3n + 1).
a(3n) + a(3n + 1) = a(3(n + 1)).
a(3n - 2) + a(3n + 1) = a(3n + 2).
a(3n) + a(3n - 1) + a(3(n - 2)) = a(3n + 1).
a(3n - 1)a(3n) + a(3n + 2)a(3(n + 1)) = a(6n + 2).

Examples

			M^0 = the 3 X 3 identity matrix = [[1,0,0][0,1,0][0,0,1]]. M[3,1] = 0; M[1,1] = 1; M[1,3] = 0. So the first triple is r = a(0) = 0; s = a(1) = 1; t = a(2) = 0.
M^1 = [[1,4,4][1,3,2][1,2,1]], so r = a(3) = 1; s = a(4) = 1; t = a(5) = 2.
		

Crossrefs

a(3n) = the n-th term of A000129, the Pell numbers.
a(3n+1) = n-th term of A001333.
a(3n+2) = n-th term of A163271.

Programs

  • Mathematica
    LinearRecurrence[{0,0,2,0,0,1},{0,1,0,1,1,2},60] (* Harvey P. Dale, Dec 29 2021 *)
  • PARI
    concat(0, Vec(-x*(2*x^4-x^3+x^2+1)/(x^6+2*x^3-1) + O(x^100))) \\ Colin Barker, Nov 02 2014

Formula

a(n) = -2*a(n-3)+a(n-6); G.f.: -x*(2*x^4-x^3+x^2+1) / (x^6+2*x^3-1). - Colin Barker, Nov 02 2014

A229526 The c coefficients of the transform ax^2 + (4a/k - b)x + 4a/k^2 + 2b/k + c= 0 for a,b,c = 1,-1,-1, k = 1,2,3...

Original entry on oeis.org

5, 1, 1, -1, -11, -5, -31, -11, -59, -19, -95, -29, -139, -41, -191, -55, -251, -71, -319, -89, -395, -109, -479, -131, -571, -155, -671, -181, -779, -209, -895, -239, -1019, -271, -1151, -305, -1291, -341, -1439, -379, -1595, -419, -1759, -461, -1931, -505
Offset: 1

Author

Russell Walsmith, Sep 27 2013

Keywords

Comments

The positive/negative roots of ax^2 + bx + c = 0 combine with the negative/positive roots of (ck^2 - bk + c)x^2 +(2ck - b)x + c = 0 to define a point on the hyperbola kxy + x + y = 0. To shift such points (roots) to the hyperbola’s other line, put the coefficients of these equations into the formula ax^2 + (4a/k - b)x + 4a/k^2 + 2b/k + c = 0. Let a,b,c = 1,-1,-1 and k = 1,2,3... Then the coefficients given by this last equation are the sequence 1,5,5; 1,3,1; 1,7/3,1/9... Clearing fractions, the c coefficients are the sequence above.
The n-th term = the (positive) n-4th term of A229525.

Examples

			For k = 5, the coefficients are 1, 9/5, -11/25. Clearing fractions gives 25, 45, -11 and -11 = a[5].
		

Crossrefs

The a coefficients are A168077, b coefficients are A171621, the sum of a, b and c coefficients is A229525.

Programs

  • PARI
    Vec(-x*(x^5+x^4-4*x^3-14*x^2+x+5)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Nov 02 2014

Formula

ax^2 + (4a/k - b)x + 4a/k^2 + 2b/k + c; a,b,c = 1,-1,-1, k = 1,2,3..n.
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). G.f.: -x*(x^5+x^4-4*x^3-14*x^2+x+5) / ((x-1)^3*(x+1)^3). - Colin Barker, Nov 02 2014
a(n) = (-5+3*(-1)^n)*(-4-2*n+n^2)/8. - Colin Barker, Nov 03 2014

Extensions

More terms from Colin Barker, Nov 02 2014

A229525 Sum of coefficients of the transform ax^2 + (4a/k - b)x + 4a/k^2 + 2b/k + c = 0 for a,b,c = 1,-1,-1, k = 1,2,3...

Original entry on oeis.org

11, 5, 31, 11, 59, 19, 95, 29, 139, 41, 191, 55, 251, 71, 319, 89, 395, 109, 479, 131, 571, 155, 671, 181, 779, 209, 895, 239, 1019, 271, 1151, 305, 1291, 341, 1439, 379, 1595, 419, 1759, 461, 1931, 505, 2111, 551, 2299, 599, 2495, 649, 2699, 701, 2911, 755
Offset: 1

Author

Russell Walsmith, Sep 26 2013

Keywords

Comments

The positive/negative roots of ax^2 + bx + c = 0 combine with the negative/positive roots of (ck^2 - bk + c)x^2 +(2ck - b)x + c = 0 to define a point on the hyperbola kxy + x + y = 0. To shift such points (roots) to the hyperbola’s other line, put the coefficients of these equations into the formula Q = ax^2 + (4a/k - b)x + 4a/k^2 + 2b/k + c = 0. For a,b,c = 1,-1,-1 and k = 1,2,3..., the coefficients given by Q are the sequence 1,5,5; 1,3,1; 1,7/3,1/9... Clearing fractions and summing a+b+c gives the sequence.
The negative of the n-th term is the n+4th term of the c coefficient sequence A229526.

Examples

			For k = 5, the coefficients are 1, 9/5, -11/25. Clearing fractions, 25, 45, -11 and 25 + 45 -11 = 59 = a[5].
		

Crossrefs

The a coefficients are A168077, b coefficients are A171621, c coefficients are A229526.

Programs

  • PARI
    Vec(-x*(x^5-x^4-4*x^3-2*x^2+5*x+11)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Nov 02 2014

Formula

ax^2 + (4a/k - b)x + 4a/k^2 + 2b/k + c; a,b,c = 1,-1,-1, k = 1,2,3... n.
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). G.f.: -x*(x^5-x^4-4*x^3-2*x^2+5*x+11) / ((x-1)^3*(x+1)^3). - Colin Barker, Nov 02 2014
a(n) = -(-5+3*(-1)^n)*(4+6*n+n^2)/8. - Colin Barker, Nov 03 2014

Extensions

More terms from Colin Barker, Nov 02 2014

A226593 Largest period of a recurrence sequence of pairs of permutations of length n.

Original entry on oeis.org

1, 3, 8, 18, 96, 216, 2112, 9720, 39024, 194256, 1116240
Offset: 1

Author

Russell Walsmith, Jun 13 2013

Keywords

Comments

The n! permutations (p) of the numbers 1,2,3..n may be paired (allowing duplication) in n!^2 ways. For a pair of permutations (p, p'), let p'' = p x p', p''' = p' x p'', and so on until the starting pair (p, p') is obtained. If p = p', this iterative process gives the Pisano periods. For most other pairs the periods have different lengths. The sequence gives the longest period that (p, p') generates for any p, p' of length n.
Period is invariant with respect to simultaneous conjugation of both p, p'. - Max Alekseyev, Feb 09 2024

Examples

			For n = 4: 3142 x 2341 = 1423; 2341 x 1423 = 2134... the sequence thus generated is of period = 18.
		

Crossrefs

Cf. A001175 (Pisano periods: period of Fibonacci numbers (A000045) mod n).
Cf. A106291 (period of the Lucas sequence (A000032) mod n).

Programs

  • PARI
    period(a,b)=my(n=matsize(a)[2], v=vector(n), aa=vector(n,i,a[i]), bb=vector(n,i,b[i]), id, nsteps); while(id!=n, for(i=1,n, v[i]=a[b[i]]); id=sum(i=1,n, b[i]==aa[i] && v[i]==bb[i]); for(i=1,n, a[i]=b[i]; b[i]=v[i]); nsteps++); nsteps
    a(n)=my(a,b,m,p); for(k=1,n!, a=numtoperm(n,k); for(l=1,n!, b=numtoperm(n,l); p=period(a,b); if(p>m,m=p))); m \\ Ralf Stephan, Aug 13 2013

Extensions

a(6) from Ralf Stephan, Aug 13 2013
Edited and a(7)-a(11) added by Max Alekseyev, Feb 13 2024