%I #17 Jul 08 2024 08:28:58
%S 0,1,10,1596,2775,3486,3828,4278,4656,5565,6555,7626,8256,9453,14196,
%T 15753,16653,17391,18336,21945,22791,23871,24753,28920,32385,34716,
%U 37128,38226,39621,40755,42195,43365,44850,46056,51681,54615,56280
%N Triangular numbers for which the sum of the digits is an octagonal number.
%H Michael De Vlieger, <a href="/A117523/b117523.txt">Table of n, a(n) for n = 1..3618</a>
%e 1596 is in the sequence because (1) it is a triangular number and (2) the sum of its digits 1+5+9+6=21 is an octagonal number.
%t Join[{0},Select[Accumulate[Range[400]],IntegerQ[(1+Sqrt[1+3*Total[ IntegerDigits[ #]]])/3]&]] (* _Harvey P. Dale_, May 06 2019 *)
%o (PARI) isok(n) = ispolygonal(n, 3) && ispolygonal(sumdigits(n), 8); \\ _Michel Marcus_, Feb 26 2014
%Y Cf. A000217, A000567.
%K base,nonn
%O 1,3
%A Luc Stevens (lms022(AT)yahoo.com), Apr 30 2006