|
|
A352461
|
|
Numbers k whose decimal expansion starts with the sum of digits of k.
|
|
2
|
|
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 109, 119, 129, 139, 149, 159, 169, 179, 189, 199, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1009, 1018, 1027, 1036, 1045, 1054, 1063, 1072, 1081, 1090, 1109, 1118, 1127, 1136, 1145, 1154, 1163, 1172, 1181, 1190, 1209, 1218, 1227, 1236
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
10 is a term because "10" starts with "1", which is the sum 1 + 0.
119 is a term because "119" starts with "11", which is the sum 1 + 1 + 9.
1018 is a term because "1018" starts with "10", which is the sum 1 + 0 + 1 + 8.
|
|
MATHEMATICA
|
q[n_] := Module[{d = IntegerDigits[n], s, ds, nds}, s = Plus @@ d; ds = IntegerDigits[s]; nds = Length[ds]; ds == d[[1 ;; nds]]]; Select[Range[1240], q] (* Amiram Eldar, Mar 17 2022 *)
Select[Range[1236], StringStartsQ[ToString[#], ToString[Plus@@IntegerDigits[#]]]&] (* Ivan N. Ianakiev, Mar 18 2022 *)
|
|
PROG
|
(Python)
def ok(n): s = str(n); return s.startswith(str(sum(map(int, s))))
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|