OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
MATHEMATICA
Table[Mod[CatalanNumber[n^2], Prime[n]], {n, 80}]
PROG
(Magma) [Catalan(n^2) mod NthPrime(n): n in [1..100]];
(Python)
from sympy import factorint, prime
A254746_list, c, s, s2 = [1], {}, 2, 4
for n in range(2, 10**3+1):
....for p, e in factorint(4*n-2).items():
........if p in c:
............c[p] += e
........else:
............c[p] = e
....for p, e in factorint(n+1).items():
........if c[p] == e:
............del c[p]
........else:
............c[p] -= e
....if n == s2:
........d, ps = 1, prime(s)
........for p, e in c.items():
............d = (d*pow(p, e, ps)) % ps
........A254746_list.append(d)
........s2 += 2*s+1
........s += 1 # Chai Wah Wu, Feb 14 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Vincenzo Librandi, Feb 07 2015
STATUS
approved