OFFSET
1,5
COMMENTS
Let d(m)...d(2)d(1)d(0) be the base-n representation of n+p. The relation a(n)=d(1) holds, if n is a prime index. For this reason there are infinitely many terms which are equal to 1.
LINKS
Ray Chandler, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, order 58060800.
FORMULA
a(n) = binomial(n+p,p) mod n.
a(n) = 1 if n is a prime > p, since binomial(n+p,n)==(1+floor(p/n))(mod n), provided n is a prime.
For n > 58060802, a(n) = 2*a(n-29030400) - a(n-58060800). - Ray Chandler, Apr 29 2023
MATHEMATICA
Table[Mod[Binomial[n + 10, n], n], {n, 90}] (* Harvey P. Dale, Apr 04 2015 *)
PROG
(PARI) a(n) = binomial(n+10, n) % n \\ Michel Marcus, Jul 15 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Sep 30 2007
STATUS
approved