A239278 Smallest k > 1 such that n*(n+1)*...*(n+k-1) / (n+(n+1)+...+(n+k-1)) is an integer.
2, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3
Offset: 0
Keywords
Examples
1*2/(1+2) = 2/3 is not an integer. 1*2*3/(1+2+3) = 1 is an integer. Thus a(1) = 3. 2*3/(2+3) = 6/5 is not an integer. 2*3*4/(2+3+4) = 24/9 is not an integer. 2*3*4*5/(2+3+4+5) = 120/14 is not an integer. 2*3*4*5*6/(2+3+4+5+6) = 720/20 = 36 is an integer. Thus a(2) = 5. a(0) = 2 as 0*(0+(2-1)) / 0+(0+(2-1)) = 0/1 = 0 is an integer. - _Antti Karttunen_, Jan 18 2025
Links
- Antti Karttunen, Table of n, a(n) for n = 0..20000
Crossrefs
A284721 has the same start.
Programs
-
PARI
a(n) = {k = 2; while ( prod(i=0, k-1, n+i) % sum(i=0, k-1, n+i), k++); k;} \\ Michel Marcus, Mar 14 2014
-
PARI
A239278(n) = { my(m=n, s=n); for(k=2, oo, m *= (n+(k-1)); s += (n+(k-1)); if(!(m%s), return(k))); }; \\ Antti Karttunen, Jan 18 2025
-
Python
def A239278(n): (m, s, t) = (n, n, n+1) while 1: m *= t s += t if 0 == (m%s): return (1+t-n) else: t += 1 # Antti Karttunen, Jan 18 2025
Extensions
Term a(0)=2 prepended, original Python program replaced with one that works. - Antti Karttunen, Jan 18 2025
Comments