%I
%S 0,1,8,341,1160,4485,6816,9633,12936,16725,20501,25761,30401,36741,
%T 42960,64533,81345,90480,131880,143445,168033,181056,208560,238008,
%U 253461,269400,302736,338016,375240,414408,434721,455520,520833,590520
%N Octagonal numbers for which the sum of the digits is also a octagonal number.
%H Harvey P. Dale, <a href="/A117082/b117082.txt">Table of n, a(n) for n = 0..1000</a>
%e 1160 is in the sequence because (1) it is a octagonal number and (2)the sum of its digits 1+1+6+0=8 is also a octagonal number.
%t octQ[n_] := IntegerQ[(Sqrt[3 n + 1] + 1)/3]; t = {0}; Do[x = n*(3 n  2); If[octQ[Plus @@ IntegerDigits[x]], AppendTo[t, x]], {n, 450}]; t (* _Jayanta Basu_, Jul 13 2013 *)
%t With[{oct=PolygonalNumber[8,Range[0,500]]},Select[oct,MemberQ[oct, Total[ IntegerDigits[ #]]]&]] (* The program uses the PolygonalNumber function from Mathematica version 10 *) (* _Harvey P. Dale_, Mar 06 2016 *)
%Y Cf. A000567.
%K base,nonn
%O 0,3
%A Luc Stevens (lms022(AT)yahoo.com), Apr 17 2006
