The OEIS is supported by the many generous donors to the OEIS Foundation.

 Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 60th year, we have over 367,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”). Other ways to Give
 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A308240 Number of lattice paths from (0,0) to (n,n) that consist of steps (h,v) with h, v prime or one. 3
 1, 1, 2, 6, 19, 58, 184, 604, 2017, 6806, 23161, 79392, 273614, 946981, 3289364, 11460830, 40036253, 140175224, 491756763, 1728190792, 6082921479, 21440851774, 75669652513, 267362335333, 945656056754, 3347973882425, 11863501369311, 42072251661888 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 LINKS Alois P. Heinz, Table of n, a(n) for n = 0..600 Wikipedia, Counting lattice paths MAPLE b:= proc(x, y) option remember; `if`(y=0, 1, add(add( `if`((h=1 or isprime(h)) and (v=1 or isprime(v)), b(sort([x-h, y-v])[]), 0), v=1..y), h=1..x)) end: a:= n-> b(n\$2): seq(a(n), n=0..30); MATHEMATICA f[p_List] := p + {0, p[[1]]}; f[0] = 0; b[{x_, y_}] := b[{x, y}] = If[y == 0, {1, 1}, f[Sum[Sum[ If[(h == 1 || PrimeQ[h]) && (v == 1 || PrimeQ[v]), b[Sort@{x - h, y - v}], {0, 0}], {v, 1, y}], {h, 1, x}]]]; a[n_] := b[{n, n}][[1]]; a /@ Range[0, 30] (* Jean-François Alcover, Apr 05 2021, after Alois P. Heinz *) CROSSREFS Cf. A000040, A008578, A308241, A308273. Sequence in context: A077834 A325918 A307564 * A328658 A067675 A037512 Adjacent sequences: A308237 A308238 A308239 * A308241 A308242 A308243 KEYWORD nonn AUTHOR Alois P. Heinz, May 16 2019 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified December 11 10:47 EST 2023. Contains 367722 sequences. (Running on oeis4.)