login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A352462 Numbers k with the property that k ends in the sum of the digits of k. 3
1, 2, 3, 4, 5, 6, 7, 8, 9, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 4510, 4511, 4512, 4513, 4514, 4515, 4516 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
a(10) = 910, which ends in 10 = 9 + 1 + 0.
a(20) = 1810, which ends in 10 = 1 + 8 + 1 + 0.
a(39) = 2719, which ends in 19 = 2 + 7 + 1 + 9.
MATHEMATICA
q[n_] := Module[{d = IntegerDigits[n], s, ds, nds}, s = Plus @@ d; s = IntegerDigits[s]; nds = Length[ds]; ds == d[[-nds ;; -1]]]; Select[Range[4516], q] (* Amiram Eldar, Mar 17 2022 *)
Select[Range[4516], StringEndsQ[ToString[#], ToString[Plus@@IntegerDigits[#]]]&] (* Ivan N. Ianakiev, Mar 18 2022 *)
sdkQ[n_]:=Module[{idn=IntegerDigits[n], d}, d=IntegerDigits[Total[idn]]; d==Take[idn, -Length[d]]]; Select[Range[5000], sdkQ] (* Harvey P. Dale, Apr 19 2022 *)
PROG
(Python)
def ok(n): s = str(n); return s.endswith(str(sum(map(int, s))))
print([k for k in range(1, 4517) if ok(k)]) # Michael S. Branicky, Mar 17 2022
CROSSREFS
Sequence in context: A145461 A075154 A187924 * A070938 A070594 A121939
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Mar 17 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 24 07:54 EDT 2024. Contains 375409 sequences. (Running on oeis4.)