A258127 Smallest k such that Sum_{i=0..k} binomial(n,i) is prime, or a(n)=0 if there is no such k.
1, 1, 2, 1, 4, 1, 2, 2, 0, 1, 2, 1, 4, 4, 6, 1, 16, 1, 2, 2, 4, 1, 2, 6, 8, 16, 2, 1, 0, 1, 4, 6, 0, 0, 2, 1, 0, 0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 10, 0, 48, 2, 1, 36, 20, 6, 2, 8, 1, 10, 1, 16, 13, 2, 2, 0, 1, 0, 2, 0, 1, 2, 1, 0, 0, 2, 2, 0, 1, 8, 74, 64, 1, 16
Offset: 1
Keywords
Links
- Peter J. C. Moses, Table of n, a(n) for n = 1..1000
Programs
-
PARI
a(n) = {my(k = 0); while(! isprime(sum(i=0, k, binomial(n,i))), k++; if ((k>n) && !isprime(binomial(n,k)), return (0);)); k;} \\ Michel Marcus, May 23 2015
Formula
a(n) <= n-1.
Extensions
More terms from Peter J. C. Moses, May 21 2015
Comments