A156238 Smallest heptagonal number with n distinct prime factors.
7, 18, 286, 3010, 32890, 769230, 3333330, 159189030, 16015883940, 477463360374, 21643407275490, 1148540321999070, 18489352726664820, 4561561662153109614, 71000485538666794110, 14440652550858108745170, 927869754030522488795610
Offset: 1
Keywords
Examples
a(9) = 16015883940 = 2^2*3^2*5*7*17*19*23*29*59. 16015883940 is the smallest heptagonal number with 9 distinct prime factors.
Links
- Eric Weisstein's World of Mathematics, Heptagonal Numbers.
Programs
-
Python
from sympy import primefactors def A000566(n): return n*(5*n-3)//2 def a(n): k = 1 while len(primefactors(A000566(k))) != n: k += 1 return A000566(k) print([a(n) for n in range(1, 9)]) # Michael S. Branicky, Jul 18 2021
-
Python
# faster version using heptagonal structure from sympy import primefactors def A000566(n): return n*(5*n-3)//2 def A000566_distinct_factors(n): pf1 = primefactors(n) pf2 = primefactors(5*n-3) combined = set(pf1) | set(pf2) return len(combined) if n%4 == 0 or (5*n-3)%4 == 0 else len(combined)-1 def a(n): k = 1 while A000566_distinct_factors(k) != n: k += 1 return A000566(k) print([a(n) for n in range(1, 10)]) # Michael S. Branicky, Jul 18 2021
Extensions
a(17) from Donovan Johnson, Jul 02 2011
Comments