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.

A345708 a(n) is the least positive number starting an interval of consecutive integers whose product of elements is n.

Original entry on oeis.org

1, 1, 3, 4, 5, 1, 7, 8, 9, 10, 11, 3, 13, 14, 15, 16, 17, 18, 19, 4, 21, 22, 23, 1, 25, 26, 27, 28, 29, 5, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 6, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 7, 57, 58, 59, 3, 61, 62, 63, 64, 65, 66, 67, 68, 69
Offset: 1

Views

Author

Rémy Sigrist, Jun 24 2021

Keywords

Comments

This sequence is similar to A118235; here we multiply, there we add.
a(n) is the index of the first row of A068424 (interpreted as a square array) containing n.
If n is the product of k consecutive integers, then k! divides n.

Examples

			The square array A068424(n, k) begins:
  n\k|   1    2     3      4       5        6
  ---+---------------------------------------
    1|   1    2     6     24     120      720
    2|   2    6    24    120     720     5040
    3|   3   12    60    360    2520    20160
    4|   4   20   120    840    6720    60480
- so a(1) = a(2) = a(6) = a(24) = a(120) = a(720) = 1,
     a(3) = a(12) = a(60) = a(360) = 3,
     a(4) = a(20) = 4.
		

Crossrefs

Programs

  • PARI
    a(n) = { fordiv (n, d, my (r=n); for (k=d, oo, if (r==1, return (d), r%k, break, r/=k))) }
    
  • PARI
    a(n) = { for (i=2, oo, if (n%i!, forstep (j=i-1, 2, -1, my (d=sqrtnint(n,j)); while (d-1 && n%(d-1)==0, d--); while (n%d==0, my (r=n); for
    (k=d, oo, if (r==1, return (if (d==2, 1, d)), r%k, break, r/=k)); d++)); break)); return (n) }
    
  • Python
    from sympy import divisors
    def a(n):
        if n%2 == 0: return n
        divs = divisors(n)
        for i, d in enumerate(divs[:len(divs)//2]):
            p = lastj = d
            for j in divs[i+1:]:
                if p >= n or j - lastj > 1: break
                p, lastj = p*j, j
            if p == n: return d
        return n
    print([a(n) for n in range(1, 70)]) # Michael S. Branicky, Jun 29 2021

Formula

a(n) = 1 iff n is a factorial number (A000142).
a(n) <> 2.
a(n) = 3 iff n >= 3 and n belongs to A001710.
a(n) <= n.
a(p! / (n-1)!) = n for any n >= 3 and any prime number p >= n.
a(q) = q for any prime power q > 2.
a(n) = n for any odd number n.
a(n) < n iff n belongs to A045619.