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

 

Logo
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
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
Sequence in context: A077834 A325918 A307564 * A328658 A067675 A037512
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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 14:08 EDT 2024. Contains 371989 sequences. (Running on oeis4.)