OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
100 is a term because "100" starts with "1" = 1 + 0 + 0;
109 is a term because "109" starts with "10" = 1 + 0 + 9;
1346 is a term because "1346" starts with "13" = 3 + 4 + 6; etc.
MATHEMATICA
q[n_] := Module[{d = IntegerDigits[n], s, ds, nds}, s = Plus @@ d[[-3 ;; -1]]; ds = IntegerDigits[s]; nds = Length[ds]; ds == d[[1 ;; nds]]]; Select[Range[100, 1400], q] (* Amiram Eldar, Mar 16 2022 *)
ltd[n_]:=Module[{idn=IntegerDigits[n], t3}, t3=IntegerDigits[Total[Take[idn, -3]]]; Take[idn, Length[t3]]==t3]; Select[Range[100, 1400], ltd] (* Harvey P. Dale, Oct 13 2025 *)
PROG
(Python)
def ok(n):
s = str(n)
return n > 99 and s.startswith(str(sum(map(int, s[-3:]))))
print([k for k in range(1347) if ok(k)]) # Michael S. Branicky, Mar 16 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Mar 16 2022
STATUS
approved
