%I #21 Jul 16 2022 11:57:17
%S 3,15,21,171,1711
%N Triangular numbers for which the product of the digits is a prime number.
%C None of the digits can be 0,4,6,8 or 9. All the digits must be 1 or, just one digit can be 2,3,5 or 7 and all the others are 1.
%C There are no more terms less than 10^2580. - _Hans Havermann_, May 07 2006
%e 1711 is in the sequence because (1)it is a triangular number and (2)the product of its digits is 1*7*1*1=7, which is a prime number.
%t Select[Accumulate[Range[100000]], PrimeQ[Times@@IntegerDigits[#]]&] (* _Harvey Dale_, Dec 04 2010 *)
%t Select[Table[n(n + 1)/2, {n, 10^3}], PrimeQ[Times@@IntegerDigits[#]]&] (* _Zak Seidov_, Dec 04 2010 *)
%o (PARI) isok(t) = ispolygonal(t, 3) && isprime(vecprod(digits(t))); \\ _Michel Marcus_, Jul 16 2022
%Y Cf. A000217.
%K more,nonn,base
%O 1,1
%A Luc Stevens (lms022(AT)yahoo.com), Apr 29 2006
|