While playing with Pascal's triangle, I observed that $\binom{4}{k } \mod 2 =0$ for $k=1,2,3$,and $\binom{8}{k } \mod 2 =0$ for $k=1,2,3,4,5,6,7$ This made me curious about the values of $n>1$ and $m>1$ that satisfy $\binom{n}{k } \mod m =0$ for all $k=1,2,3,\dots,n-1$ I asked my friend to write a $C++$ code that could test this condition for $n$ up to $10000$ and $m$ up to $31$ and I found out that $\binom{n}{k } \mod m =0$ for all $k=1,2,3,\dots,n-1$ only when $m $ is a prime number and $n$ is a power of $m$.
#include <bits/stdc++.h>
using namespace std;`
typedef long long ll;
#define rep(i , st , ed) for(int i = st; i < ed; i++)
#define f first
#define s second
const int N = 10000;
const int mod = 31;
ll nCr[N][N] , frq[N];
void gen(){
nCr[0][0] = 1;
for (int i = 0; i < N; ++i) {
nCr[i][0] = nCr[i][i] = 1;
for (int j = 1; j < i; ++j) {
nCr[i][j] = (nCr[i-1][j] + nCr[i-1][j-1]) % mod;
if(nCr[i][j] == 0) frq[i]++;
}
}
}
ll get(int n , int r){ return (n >= r) ? nCr[n][r] : 0; }
int main(){
ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(0);
gen();
for(int i = 1; i < N; ++i) if(frq[i] == i - 1){
cout << i << '\n';
}
}
After many attempts to prove or disprove this conjecture, I couldn’t find a solution.
This statement is the same as $$\gcd\left( \binom{n}{1 }, \binom{n}{2 },\dots , \binom{n}{n-1 } \right)= \begin{cases} p, & \text{if $n$ is a power of a prime $p$} \\[2ex] 1, & \text{else. } \end{cases}$$