A322168 Sequence gives the values of the trace A+D of the 2 X 2 matrices [[A,B],[C,D]] in a binary tree of the special linear monoid, SL(2,Z+).
2, 2, 2, 2, 3, 3, 2, 2, 4, 4, 4, 4, 4, 4, 2, 2, 5, 5, 6, 5, 7, 6, 5, 5, 6, 7, 5, 6, 5, 5, 2, 2, 6, 6, 8, 6, 10, 8, 8, 6, 10, 10, 10, 8, 10, 8, 6, 6, 8, 10, 8, 10, 10, 10, 6, 8, 8, 10, 6, 8, 6, 6, 2, 2, 7, 7, 10, 7, 13, 10, 11, 7, 14, 13, 15, 10, 15, 11, 10, 7, 13, 14, 15, 13, 18, 15, 13, 10, 15, 15, 14, 11, 13, 10, 7, 7, 10, 13, 11, 14, 15, 15, 10, 13, 15, 18, 13, 15, 14, 13, 7, 10, 11, 15, 10, 15, 13, 14, 7, 11, 10, 13, 7, 10, 7, 7, 2
Offset: 1
Examples
row 1: [[1,0],[0,1]] trace = 2 row 2: [[1,0],[1,1]], [[1,1],[0,1]] trace = 2, 2 row 3: [[1,0],[2,1]], [[1,1],[1,2]], [[2,1],[1,1]], [[1,2],[0,1]] trace = 2, 3, 3, 2 ... Sum the matrix rows for the Stern-Brocot tree. row 1: 1/1 row 2: 1/2, 2/1 row 3: 1/3, 2/3, 3/2, 3/1 ...
Links
- James Kirk Winkler, Table of n, a(n) for n = 1..8191
Programs
-
Mathematica
row[n_] := Module[{v = Table[0, {2^(n-1)}], L = {{1, 0}, {1, 1}}}, For[k = 0, k <= Length[v]-1, k++, v[[k+1]] = Tr[Dot @@ Table[If[BitGet[k, b] == 1, Transpose[L], L], {b, 0, n-2}]]]; v]; row[1] = {2}; Array[row, 7] // Flatten (* Jean-François Alcover, Dec 17 2018, after Andrew Howroyd *)
-
PARI
row(n)={my(v=vector(2^(n-1)), L=[1,0;1,1]); for(k=0, #v-1, v[k+1]=trace(prod(b=0, n-2, if(bittest(k,b), L~, L)))); v} { for(n=1, 7, print(row(n))) } \\ Andrew Howroyd, Dec 12 2018
-
Python
def mul(A, B): a = A[0]*B[0] + A[1]*B[2] b = A[0]*B[1] + A[1]*B[3] c = A[2]*B[0] + A[3]*B[2] d = A[2]*B[1] + A[3]*B[3] return([a, b, c, d]) I = [1, 0, 0, 1] L = [1, 0, 1, 1] R = [1, 1, 0, 1] slg = [I] a_lst = slg for n in range(12): b_lst = [] for ele in a_lst: b_lst.append(mul(ele, L)) b_lst.append(mul(ele, R)) a_lst = b_lst for ele in b_lst: slg.append(ele) seq = [] for ele in slg: seq.append(ele[0]+ele[3])
Comments