Please specify how many positive integers display the following features:
a. The number is below 10^12.
b. It is a multiple of 225.
c. Its decimal representation involves only two distinct digits.
Provide a justification of your result..
My computer solution found 2554 such integers.
I'm still working on the analytic solution, but since 225 = 3*3*5*5, solutions will be any number which ends in any of {00,25,50,75} and also has a digital root of 9, while being comprised of only 2 unique digits.
--------- code follows ---------
(as a check, I kept track of which pairs of integers occurred)
power = 12
big = 10**power + 1
my_list = []
count = 0
for i in range(225,big,225):
s = str(i)
if len(set(s)) != 2:
continue
x = sorted(list(set(s)))
if x not in my_list:
my_list.append(x)
# print(i/225,i)
count += 1
print(power,count)
print(my_list)
12 2554
[['2', '5'], ['0', '9'], ['0', '3'], ['5', '7'], ['0', '6'], ['0', '5'], ['0', '1'], ['0', '2'], ['0', '4'], ['0', '7'], ['0', '8']]
|
Posted by Larry
on 2022-04-12 09:59:01 |