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.
%I A156238 #14 Feb 16 2025 08:33:09 %S A156238 7,18,286,3010,32890,769230,3333330,159189030,16015883940, %T A156238 477463360374,21643407275490,1148540321999070,18489352726664820, %U A156238 4561561662153109614,71000485538666794110,14440652550858108745170,927869754030522488795610 %N A156238 Smallest heptagonal number with n distinct prime factors. %C A156238 a(18) <= 150849873309136386205130310. - _Donovan Johnson_, Feb 15 2012 %H A156238 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HeptagonalNumber.html">Heptagonal Numbers</a>. %e A156238 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. %o A156238 (Python) %o A156238 from sympy import primefactors %o A156238 def A000566(n): return n*(5*n-3)//2 %o A156238 def a(n): %o A156238 k = 1 %o A156238 while len(primefactors(A000566(k))) != n: k += 1 %o A156238 return A000566(k) %o A156238 print([a(n) for n in range(1, 9)]) # _Michael S. Branicky_, Jul 18 2021 %o A156238 (Python) # faster version using heptagonal structure %o A156238 from sympy import primefactors %o A156238 def A000566(n): return n*(5*n-3)//2 %o A156238 def A000566_distinct_factors(n): %o A156238 pf1 = primefactors(n) %o A156238 pf2 = primefactors(5*n-3) %o A156238 combined = set(pf1) | set(pf2) %o A156238 return len(combined) if n%4 == 0 or (5*n-3)%4 == 0 else len(combined)-1 %o A156238 def a(n): %o A156238 k = 1 %o A156238 while A000566_distinct_factors(k) != n: k += 1 %o A156238 return A000566(k) %o A156238 print([a(n) for n in range(1, 10)]) # _Michael S. Branicky_, Jul 18 2021 %Y A156238 Cf. A000566, A076551, A156236, A156237, A156239. %K A156238 nonn %O A156238 1,1 %A A156238 _Donovan Johnson_, Feb 07 2009 %E A156238 a(17) from _Donovan Johnson_, Jul 02 2011