OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1)=4, since binomial(1+4,4) mod 4 = 5 mod 4 = 1 and 4 is the minimal composite number with this property.
a(5)=26 because of binomial(5+26,26)=169911=6535*26+1, but binomial(5+k,k) mod k<>1 for all composite numbers <26.
MATHEMATICA
lcn[n_]:=Module[{m=4}, While[PrimeQ[m]||Mod[Binomial[n+m, m], m]!=1, m++]; m]; Array[lcn, 80] (* Harvey P. Dale, May 13 2022 *)
PROG
(PARI) a(n) = { my(m = 4, ok = 0); until (ok, if (! isprime(m) && (binomial(n+m, m) % m == 1), ok = 1, m++); ); return (m); } \\ Michel Marcus, Jul 15 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Oct 20 2007
STATUS
approved