%I #15 Sep 20 2023 14:34:51
%S 0,1,9,261,969,1350,6666,7944,10071,13299,17466,24486,33369,36159,
%T 39804,42846,46806,54375,57921,66309,75264,80484,111696,116754,128544,
%U 135339,153825,167316,175056,181374,204369,226950,235950,243276,252591,260169
%N Enneagonal numbers whose sum of digits is also enneagonal.
%H Robert Israel, <a href="/A117051/b117051.txt">Table of n, a(n) for n = 1..10000</a>
%e 1350 is in the sequence because (1) it is an enneagonal number and (2) the sum of its digits 1+3+5+0=9 is also an enneagonal number
%p enne:= proc(x) issqr(56*x+25) and sqrt(56*x+25) mod 7 = 2 end proc:
%p enne(0):= true:
%p select(t -> enne(convert(convert(t,base,10),`+`)), [seq(n*(7*n-5)/2, n=0..1000)]); # _Robert Israel_, Sep 20 2023
%t Join[{0},Select[Table[(n(7n-5))/2,{n,300}],IntegerQ[(5+Sqrt[25+ 56*Total[ IntegerDigits[#]]])/14]&]] (* _Harvey P. Dale_, Apr 28 2016 *)
%o (PARI) isok(n) = ispolygonal(n, 9) && ispolygonal(sumdigits(n), 9); \\ _Michel Marcus_, Feb 26 2014
%Y Cf. A001106.
%K base,nonn
%O 1,3
%A Luc Stevens (lms022(AT)yahoo.com), Apr 15 2006