OFFSET
1,1
COMMENTS
Infinite subsequences include 2 * 10^(2*k) + 13 * 10^k + 21, 2 * 10^(2*k) + 31 * 10^k + 120, 32 * 10^(2*k) + 4 * 10^k, and 32 * 10^(2*k) + 12 * 10^k + 1.
Conjecture: the last term not of one of those subsequences is a(53) = 210010000005.
LINKS
Robert Israel, Table of n, a(n) for n = 1..95
EXAMPLE
a(4) = 153 is a term because 153 = 17 * 18/2 is a triangular number and 1 + 5 + 3 = 9.
MAPLE
F:= proc(d, s) option remember;
# d-digit numbers with sum of digits s
local R, i;
R:= {};
for i from 0 to min(s, 9) do
R:= R union map(t -> 10*t+i, procname(d-1, s-i))
od;
R
end proc:
F(1, 0):= {}:
for i from 1 to 9 do F(1, i):= {i} od:
sort(convert(`union`(seq(select(t -> issqr(1+8*t), F(d, 9)), d=1..12)), list));
MATHEMATICA
Select[Range[10000](Range[10000]+1)/2, DigitSum[#]==9 &] (* Stefano Spezia, Sep 01 2024 *)
PROG
(PARI) select(x->(sumdigits(x)==9), vector(10000, n, n*(n+1)/2)) \\ Michel Marcus, Aug 31 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Aug 30 2024
STATUS
approved