A226324 Array by antidiagonals: D(m,n) = distance between m and n using the graph-metric of A226247.
0, 1, 1, 2, 0, 2, 2, 1, 1, 2, 3, 1, 0, 1, 3, 3, 2, 2, 2, 2, 3, 4, 2, 1, 0, 1, 2, 4, 4, 3, 1, 3, 3, 1, 3, 4, 4, 3, 2, 3, 0, 3, 2, 3, 4, 5, 3, 2, 4, 2, 2, 4, 2, 3, 5, 5, 4, 2, 4, 1, 0, 1, 4, 2, 4, 5, 5, 4, 3, 4, 1, 3, 3, 1, 4, 3, 4, 5, 5, 4, 3, 5, 3, 3, 0, 3
Offset: 1
Examples
Northwest corner of the distance table: 0 1 2 2 3 3 4 4 4 5 1 0 1 1 2 2 3 3 3 4 2 1 0 2 1 1 2 2 2 3 2 1 2 0 3 3 4 4 4 5 3 2 1 3 0 2 1 1 3 2 3 2 1 3 2 0 3 3 1 4 4 3 2 4 1 3 0 2 4 1 4 3 2 4 1 3 2 0 4 3 4 3 2 4 3 1 4 4 0 5 5 4 3 5 2 4 1 3 5 0 Row 5, column 4 is occupied by 3, meaning that D(5,4) = 3, a count of edges in the subgraph 5 -> 3 -> 2 -> 4.
Links
- Clark Kimberling, Antidiagonals n=1..60, flattened
Programs
-
Mathematica
$MaxExtraPrecision = Infinity; g[1] := {1}; g[2] := {1, 0}; g[3] := {1, 0, 0}; g[test_] := Module[{topRow, len, tmp = test, noOfTerms = Ceiling[Log[test]/Log[1.465571231876768026656731]] - 1}, topRow = Flatten[{1, LinearRecurrence[{1, 0, 1}, {2, 3, 5}, noOfTerms]}]; If[First[#] == 0, Rest[#], #] &[Table[If[# >= 0, tmp = #; 1, 0] &[tmp - topRow[[n]]], {n, noOfTerms, 1, -1}]]]; d[n1_, n2_] := Module[{z1 = g[n1], z2 = g[n2]}, Length[z1] + Length[z2] - 2(NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)]; (dArray = Table[d[m, n], {m, 1, #}, {n, 1, #}] &[15]) // TableForm Flatten[Table[d[k, n + 1 - k], {n, 1, 15}, {k, 1, n}]] ArrayPlot[dArray, ColorFunction -> "BlueGreenYellow"] (* Peter J. C. Moses, Jun 02 2013 *)
Comments