login
A336257
a(n) = Catalan(n) mod (2*n+1).
1
0, 1, 2, 5, 5, 9, 2, 9, 2, 17, 17, 21, 12, 22, 2, 29, 18, 30, 2, 30, 2, 41, 30, 45, 9, 21, 2, 54, 53, 57, 2, 28, 38, 65, 42, 69, 2, 64, 70, 77, 5, 81, 80, 33, 2, 14, 27, 45, 2, 36, 2, 101, 87, 105, 2, 78, 2, 34, 75, 6, 101, 45, 62, 125, 39, 129, 74, 60, 2, 137, 90
OFFSET
0,3
LINKS
Arturo Merino, Ondrej Micka, and Torsten Mütze, On a combinatorial generation problem of Knuth, arXiv:2007.07164 [math.CO], 2020. See p. 43.
FORMULA
a(n) = 2 for n in A104636.
a(n) = 2*n-1 for n in A104635.
MAPLE
a:= n-> binomial(2*n, n)/(n+1) mod (2*n+1):
seq(a(n), n=0..80); # Alois P. Heinz, Jul 16 2020
PROG
(PARI) C(n)=binomial(2*n, n)/(n+1);
a(n) = C(n) % (2*n+1);
(Python)
A336257_list, c = [0, 1], 1
for n in range(2, 10001):
c = c*(4*n-2)//(n+1)
A336257_list.append(c % (2*n+1)) # Chai Wah Wu, Jul 16 2020
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Michel Marcus, Jul 15 2020
STATUS
approved