Problem 788

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Post Reply
PeterBurbery
Posts: 6
Joined: Thu Feb 24, 2022 6:12 pm

Problem 788

Post by PeterBurbery »

Problem 788 (View Problem) has the following question:
A dominating number is a positive integer that has more than half of its digits equal.
For example, 2022 is a dominating number because three of its four digits are equal to 2. But 2021 is not a dominating number.
Let D(N) be how many dominating numbers are less than 10^N. For example, D(4)=603 and D(10)=21893256.
Find D(2022). Give your answer modulo 1000000007.
I am wondering about some edge cases.
If there is a number like 11, I think it is dominating.
I also think 131 is dominating.
I am wondering about the wording because I am getting there are only 441 dominating numbers from 1 to 10000. Are one digit numbers considered dominating?
Does there have to be more than two digits for the qualification of dominating number to be assessed because you can't have a half of one digit.
PeterBurbery
Posts: 6
Joined: Thu Feb 24, 2022 6:12 pm

Re: Problem 788 Dominating Numbers

Post by PeterBurbery »

I fixed my program. I have resolved the issue.
BinarySpike
Posts: 1
Joined: Wed Jun 22, 2022 2:34 am

Re: Problem 788

Post by BinarySpike »

My solution was off-by-one.

I've emphasized the portion of the description that I overlooked:
A dominating number is a positive integer that has more than half of its digits equal.
For example, $2022$ is a dominating number because three of its four digits are equal to $2$. But $2021$ is not a dominating number.
Let $D(N)$ be how many dominating numbers are less than $10^N$.
For example, $D(4) = 603$ and $D(10) = 21893256$.
Find $D(2022)$. Give your answer modulo $1\,000\,000\,007$.
Post Reply