# [Python 3], 89 bytes <!-- language-all: lang-python --> lambda a,b:[i for i in range(a,b)if sum(map(int,str(i)[:-3]))==sum(map(int,str(i)[-3:]))] [Try it online!][TIO-jjtoayxx] The range is half-open. The output numbers does not contains leading zeros. Some tests results : Example 1 : a = 1000 b = 1100 Lucky numbers : [1001, 1010] Example 2 : a = 2000 b = 2100 Lucky numbers : [2002, 2011, 2020] Example 3 : a = 222000 b = 222100 Lucky numbers : [222006, 222015, 222024, 222033, 222042, 222051, 222060] [Python 3]: https://docs.python.org/3/ [TIO-jjtoayxx]: https://tio.run/##fcyxDoMgFAXQna94YYIEE4WNhLFb/0AdsNWWVNCgJvXrKaSxbdLW7eXe@864ztfBidCpKvTaNmcNmjWyNNANHgwYB167S0tiSk0H02KJ1SMxbmbT7ImhpcxETalSP6pMyFjVYfQxJBjjw13bsW@hAAlIg4Iiz3PUpCNe6Licbiu4xTatn0DGB9aRNGGppgxXDlOEvji@cXzj@F8uTRjf5cSL42@Q75D8ifJPNjwA "Python 3 – Try It Online"