login
Total number of nodes summed over all lattice paths from (0,0) to (n,n) that do not go above the diagonal x=y and consist of steps (h,v) with min(h,v) > 0 and gcd(h,v) = 1.
3

%I #17 Apr 05 2021 09:17:43

%S 1,2,3,7,26,92,314,1055,3589,12410,43356,152336,537721,1906063,

%T 6781737,24206994,86644157,310871212,1117741815,4026430097,

%U 14528792287,52504325068,189999731589,688411569408,2497081766875,9067028323162,32953990726244,119875216666167

%N Total number of nodes summed over all lattice paths from (0,0) to (n,n) that do not go above the diagonal x=y and consist of steps (h,v) with min(h,v) > 0 and gcd(h,v) = 1.

%H Alois P. Heinz, <a href="/A308114/b308114.txt">Table of n, a(n) for n = 0..550</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>

%F a(n) ~ c * d^n / sqrt(n), where d = 3.7137893481485186502229788321701955452444... and c = 0.243302622746026118665161170169985306... - _Vaclav Kotesovec_, May 24 2019

%p b:= proc(x, y) option remember; `if`(y=0, [1$2], (p-> p+

%p [0, p[1]])(add(add(`if`(x+v>y+h or igcd(h, v)>1, 0,

%p b(x-h, y-v)), v=1..y), h=1..x)))

%p end:

%p a:= n-> b(n$2)[2]:

%p seq(a(n), n=0..30);

%t f[p_List] := p + {0, p[[1]]}; f[0] = 0;

%t b[{x_, y_}] := b[{x, y}] = If[y == 0, {1, 1},

%t f[Sum[Sum[If[x + v > y + h || GCD[h, v] > 1, {0, 0},

%t b[{x - h, y - v}]], {v, 1, y}], {h, 1, x}]]];

%t a[n_] := b[{n, n}][[2]];

%t a /@ Range[0, 30] (* _Jean-François Alcover_, Apr 05 2021, after _Alois P. Heinz_ *)

%Y Cf. A308112, A308113.

%K nonn

%O 0,2

%A _Alois P. Heinz_, May 13 2019