login
Numbers k whose decimal expansion ends in the sum of the first two digits of k.
2

%I #17 Mar 29 2024 16:48:37

%S 101,112,123,134,145,156,167,178,189,202,213,224,235,246,257,268,279,

%T 303,314,325,336,347,358,369,404,415,426,437,448,459,505,516,527,538,

%U 549,606,617,628,639,707,718,729,808,819,909,910,1001,1011,1021,1031,1041,1051,1061,1071,1081,1091,1102,1112,1122,1132

%N Numbers k whose decimal expansion ends in the sum of the first two digits of k.

%e 101 is a term because "101" ends in "1" = 1 + 0;

%e 112 is a term because "112" ends in "2" = 1 + 1;

%e 1132 is a term because "1132" ends in "2" = 1 + 1; etc.

%t q[n_] := Module[{d = IntegerDigits[n], s, ds, nds}, s = Plus @@ d[[1 ;; 2]]; ds = IntegerDigits[s]; nds = Length[ds]; ds == d[[-nds ;; -1]]]; Select[Range[10, 1140], q] (* _Amiram Eldar_, Mar 16 2022 *)

%t Select[Range[100,1200],Total[Take[IntegerDigits[#],2]]==Mod[#,10]||Total[Take[IntegerDigits[#],2]]==Mod[#,100]&] (* _Harvey P. Dale_, Mar 29 2024 *)

%o (Python)

%o def ok(n):

%o s = str(n)

%o return n > 9 and s.endswith(str(int(s[0])+int(s[1])))

%o print([k for k in range(1140) if ok(k)]) # _Michael S. Branicky_, Mar 16 2022

%Y Cf. A352438.

%K base,nonn

%O 1,1

%A _Eric Angelini_ and _Carole Dubois_, Mar 16 2022