login
A133907
Least prime number p such that binomial(n+p, p) mod p = 1.
4
2, 3, 5, 2, 2, 7, 11, 2, 2, 3, 3, 2, 2, 17, 17, 2, 2, 3, 3, 2, 2, 23, 29, 2, 2, 5, 3, 2, 2, 31, 37, 2, 2, 37, 37, 2, 2, 3, 41, 2, 2, 43, 47, 2, 2, 3, 3, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 59, 61, 2, 2, 67, 3, 2, 2, 67, 71, 2, 2, 71, 73, 2, 2, 3, 5, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 89, 89, 2, 2, 3, 3, 2, 2, 97
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
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
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Oct 20 2007
STATUS
approved