OFFSET
1,3
COMMENTS
a(1) could = 2, because 1 is not divisible by any prime, but 1*2 = 2 is. This is the only case where a(n) > n. a(n) != [6..9] for all n. a(11)=5 is the last time a(n)=5, a(63)=4 is the last time a(n)=4, a(350)=3 is the last time a(n)=3, and a(633555)=2 is the last time a(n)=2. For n>633555, and a(n)!=1, a(n) is greater than the length of the largest prime gap starting before n, so no sequence of consecutive integers starting above 633555 can be prime free and produce a product that has a complete set of prime divisors up to its greatest prime divisor. - Ken Clements, Dec 08 2025
FORMULA
a(n) = A164798(n) - n + 1.
EXAMPLE
Consider the products of consecutive integers, (m+9)!/9!, m >= 1. First, 10 is divisible by 2 and 5, but there is a prime gap since 3 is missing from the factorization. 10*11 is divisible by 2, 5, and 11, but 3 and 7 are missing. 10*11*12 is divisible by 2, 3, 5, and 11, but 7 is missing. 10*11*12*13 is divisible by all primes up to 13, except 7. But 10*11*12*13*14 is indeed divisible by every prime from 2 to 13. So a(10) = 5 because 5 consecutive numbers are multiplied together.
MAPLE
A000040v := proc(pmax) L := {} ; for i from 1 do if ithprime(i) <= pmax then L := L union {ithprime(i)} ; else return L; end if end do ; end:
A164799 := proc(n) local k, p ; if n = 1 then return 1 ; end if; for k from 1 do p := ifactors(mul(n+i, i=0..k-1))[2] ; p := {seq(op(1, d), d=p)} ; pL := A000040v(max(op(p))) ; if p = pL then return k; end if; end do ; end proc:
seq(A164799(n), n=1..90) ; # R. J. Mathar, Feb 27 2010
PROG
(Python)
from sympy import prime, primefactors
def is_pi_complete(n):
if n < 2: return False
pf = primefactors(n)
omega = len(pf)
return prime(omega) == pf[-1]
results = [1] # Make a(1)=1 (else would be 2 by this algorithm)
for n in range(2, 1001):
k, product = 0, n
while not is_pi_complete(product):
k += 1
product *= n + k
results.append(k+1)
print(results) # Ken Clements, Dec 08 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Aug 26 2009
EXTENSIONS
Terms beyond a(13) from R. J. Mathar, Feb 27 2010
STATUS
approved
