%I #23 Sep 08 2019 03:11:28
%S 2,1,2,2,6,8,28,42,162,262,1076,1828,7852,13820,61388,110954,505878,
%T 933458,4345660,8152860,38608380,73424650,352686780,678390116,
%U 3298016912,6405031050,31461151108,61606881612,305327366988,602188541928,3007925909860,5969806669034
%N Number of ways that a directed line (or river) that starts in the south can cross an east-west road n times.
%C The difference between this and A005316 is that here the river can also end up in the southwest. In A005316 it was required to end up in the northeast or southeast.
%C Or, number of ways that an undirected line that starts and ends anywhere can cross an east-west road n times.
%H S. Legendre, <a href="http://arxiv.org/abs/1302.2025">Foldings and Meanders</a>, arXiv preprint arXiv:1302.2025 [math.CO], 2013.
%H S. Legendre, <a href="http://ajc.maths.uq.edu.au/pdf/58/ajc_v58_p275.pdf">Foldings and Meanders</a>, Australasian Journal of Combinatorics 58(2) (2014), 275-291.
%F Equals A005316(n) if n odd, or 2*A005316(n) if n even (because then each solution to A005316 can be reflected in a vertical mirror to give another solution).
%t A005316 = Cases[Import["https://oeis.org/A005316/b005316.txt", "Table"], {_, _}][[All, 2]];
%t a[n_] := If[OddQ[n], A005316[[n+1]], 2*A005316[[n+1]] ];
%t a /@ Range[0, 31] (* _Jean-François Alcover_, Sep 07 2019 *)
%K nonn
%O 0,1
%A _N. J. A. Sloane_ and _Jon Wild_, Nov 29 2002