OFFSET
1,1
COMMENTS
Also the least prime number p such that p divides floor(n/p) or p > n.
a(n) = 2 if and only if n is in A042948. - Robert Israel, May 11 2017
Conjecture: a(n) is the smallest prime p such that Sum_{k=1..n} k^(p-1) == n (mod p). Thus a(n) >= A317358(n). - Thomas Ordowski, Jul 29 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(2)=3, since binomial(2+3,3) mod 3 = 10 mod 3 = 1 and 3 is the minimal prime number with this property.
a(7)=11 because of binomial(7+11, 11) = 31824 = 2893*11 + 1, but binomial(7+k, k) mod k <> 1 for all primes < 11.
MAPLE
f:= proc(n) local m;
m:= 2:
while floor(n/m) mod m <> 0 do m:= nextprime(m) od:
m
end proc:
map(f, [$1..100]); # Robert Israel, May 11 2017
MATHEMATICA
a[n_] := Module[{p}, For[p = 2, True, p = NextPrime[p], If[Mod[Binomial[n+p, p], p] == 1, Return[p]]]];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 05 2023 *)
PROG
(PARI) a(n) = my(p=2); while (binomial(n+p, p) % p != 1, p = nextprime(p+1)); p; \\ Michel Marcus, Dec 17 2022
(Python)
from sympy import nextprime, ff
def A133907(n):
p, m = 2, (n+2)*(n+1)>>1
while m%p != 1:
q = nextprime(p)
m = m*ff(n+q, q-p)//ff(q, q-p)
p = q
return p # Chai Wah Wu, Feb 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Oct 20 2007
STATUS
approved