OFFSET
0,1
COMMENTS
By theorem 6 of the Granville-Ramaré link, a(n) exists for all n. - Robert Israel, Mar 01 2016
LINKS
Robert Israel, Table of n, a(n) for n = 0..477
A. Granville and O. Ramaré, Explicit bounds on exponential sums and the scarcity of squarefree binomial coefficients, Mathematika 43 (1996) 73-107.
MAPLE
F:= proc(n)
local F, k;
if numtheory:-issqrfree((n+2)*(n+1)/2) then return 2 fi;
F:= ifactor((n+2)*(n+1)/2);
for k from 3 do
F:= F * ifactor(n+k)/ifactor(k);
if not hastype(F, `^`) then return k fi
od:
end proc:
map(F, [$0..100]); # Robert Israel, Jan 26 2016
MATHEMATICA
Table[k = 2; While[! SquareFreeQ@ Binomial[n + k, n], k++]; k, {n, 0, 81}] (* Michael De Vlieger, Jan 27 2016 *)
PROG
(PARI) findk(n) = {my(k=2); while (! issquarefree(binomial(n+k, n)), k++); k; } \\ Michel Marcus, Jan 26 2016
(PARI) b(n, p)=my(s); while(n\=p, s+=n); s
ok(n, k)=forprime(p=2, sqrtint(n+k), if(b(n+k, p)-b(k, p)-b(n, p)>1, return(0))); 1
a(n)=my(k=1); while(!ok(n, k++), ); k \\ Charles R Greathouse IV, Feb 18 2016
(Python)
from __future__ import division
from collections import Counter
from sympy import factorint
def A268045(n):
if n == 0:
return 2
flist, k = Counter(factorint((n+2)*(n+1)//2)), 2
while max(flist.values()) >= 2:
k += 1
flist += Counter(factorint(n+k))
flist -= Counter(factorint(k))
return k # Chai Wah Wu, Feb 17 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Gionata Neri, Jan 25 2016
STATUS
approved