login
A352441
Numbers k whose decimal expansion ends in the sum of the first three digits of k.
0
910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 1001, 1012, 1023, 1034, 1045, 1056, 1067, 1078, 1089, 1102, 1113, 1124, 1135, 1146, 1157, 1168, 1179, 1203, 1214, 1225, 1236, 1247, 1258, 1269, 1304, 1315, 1326, 1337, 1348, 1359, 1405, 1416, 1427, 1438, 1449, 1506, 1517, 1528, 1539, 1607, 1618, 1629
OFFSET
1,1
EXAMPLE
910 is a term because "910" ends with "10" = 9 + 1 + 0;
911 is a term because "911" ends with "11" = 9 + 1 + 1;
1629 is a term because "1629" ends with "9" = 1 + 6 + 2; etc.
MATHEMATICA
q[n_] := Module[{d = IntegerDigits[n], s, ds, nds}, s = Plus @@ d[[1 ;; 3]]; ds = IntegerDigits[s]; nds = Length[ds]; ds == d[[-nds ;; -1]]]; Select[Range[100, 1700], q] (* Amiram Eldar, Mar 16 2022 *)
PROG
(Python)
def ok(n):
s = str(n)
return n > 99 and s.endswith(str(sum(map(int, s[:3]))))
print([k for k in range(1630) if ok(k)]) # Michael S. Branicky, Mar 16 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Mar 16 2022
STATUS
approved