cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239278 Smallest k > 1 such that n*(n+1)*...*(n+k-1) / (n+(n+1)+...+(n+k-1)) is an integer.

Original entry on oeis.org

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

Views

Author

Derek Orr, Mar 13 2014

Keywords

Comments

a(n) = 7 for n == 8 (mod 15) (provided n != 53 (mod 105)).
a(n) = 5 for n == 2 (mod 3) (provided n != 8 (mod 15)).
a(n) = 9 for n == 53 (mod 105). - Jon E. Schoenfield, Mar 14 2014
a(n) = 3 for n == {0,1} (mod 3). - Zak Seidov, Mar 14 2014

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
		

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