login
A359854
a(n) is the least n-gonal number that is the product of n distinct primes, or 0 if there are none.
1
6, 66, 0, 11310, 303810, 28962934, 557221665, 15529888374, 1219300152070, 23900058257790, 1231931106828345, 500402553453949510, 14990069451769732194, 610385355391371697410
OFFSET
2,1
EXAMPLE
a(3) = 66 because 66 = 11*12/2 is the 11th triangular number and is the product of 3 distinct primes 2*3*11.
a(4) = 0 because a 4-gonal number is a square, and thus not the product of distinct primes.
MAPLE
f:= proc(s) local n, p, F;
for n from 1 do
p:= (s-2)*n*(n-1)/2 + n;
F:= ifactors(p)[2];
if nops(F) = s and andmap(t -> t[2]=1, F) then return p fi
od
end proc:
f(2):= 0:
map(f, [$2..11]);
MATHEMATICA
f[s_] := f[s] = Module[{n, p, F}, For[n = 1, True, n++, p = (s - 2)*n*(n-1)/2 + n; F = FactorInteger[p]; If[Length[F] == s && AllTrue[F, #[[2]] == 1&], Return[ p]]]];
f[4] = 0;
Table[Print[n, " ", f[n]]; f[n], {n, 2, 11}] (* Jean-François Alcover, Jan 24 2023, after Maple program *)
PROG
(PARI)
squarefree_omega_polygonals(A, B, n, k) = A=max(A, vecprod(primes(n))); (f(m, p, j) = my(list=List()); my(s=sqrtnint(B\m, j)); if(j==1, forprime(q=max(p, ceil(A/m)), s, if(ispolygonal(m*q, k), listput(list, m*q))), forprime(q=p, s, my(t=m*q); if(ceil(A/t) <= B\t, list=concat(list, f(t, q+1, j-1))))); list); vecsort(Vec(f(1, 2, n)));
a(n, k=n) = if(n < 2, return()); if(n==2, return(6)); if(n==4, return(0)); my(x=vecprod(primes(n)), y=2*x); while(1, my(v=squarefree_omega_polygonals(x, y, n, k)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, Jan 18 2023
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Robert Israel, Jan 15 2023
EXTENSIONS
a(11)-a(15) from Daniel Suteu, Jan 18 2023
STATUS
approved