login
Smallest number m such that m*(m+1)*(m+2)*(m+3) has exactly n distinct prime factors.
3

%I #32 May 15 2026 05:31:08

%S 1,2,4,10,19,55,130,284,712,1768,5795,17017,68263,195545,545258,

%T 1698179,11990404,28003819,99712613,452419979,1990586012,5313193818,

%U 22323360772

%N Smallest number m such that m*(m+1)*(m+2)*(m+3) has exactly n distinct prime factors.

%e For n = 9, a(9)*(a(9) + 1)*(a(9) + 2)*(a(9) + 3) = 284*285*286*287 = (2*2*71)*(3*5*19)*(2*11*13)*(7*41) with 9 distinct prime factors.

%t a[n_] :=(k=1; While[PrimeNu[Times @@ {k, k + 1, k + 2, k + 3}] != n, k++];k);

%t Table[a[n], {n, 2, 10}]

%o (Python)

%o from itertools import count, islice

%o from sympy import factorint

%o def agen(): # generator of terms

%o wlst, adict, n = [set(factorint(1+i)) for i in range(4)], dict(), 2

%o for m in count(1):

%o v = len(wlst[0] | wlst[1] | wlst[2] | wlst[3])

%o if v >= n and v not in adict:

%o adict[v] = m

%o while n in adict:

%o yield adict[n]

%o n += 1

%o wlst = wlst[1:] + [set(factorint(m+4))]

%o print(list(islice(agen(), 15))) # _Michael S. Branicky_, May 05 2026

%Y Cf. A002110, A059958, A392672.

%K nonn,more

%O 2,2

%A _Zhining Yang_, May 01 2026

%E a(21) and a(23) corrected by _Chai Wah Wu_, May 05 2026