You are not logged in.
hi guys
is there a formula for the number of numbers between a and b such that the sum of digits of each number is even?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
What kind of numbers can a and b be?
Offline
they're natural numbers between 1 and 2^30 and a<b.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
One last question. You want for a single sum, for example 317 --> 3+1+7 = 11, or until there is a single digit, 11 --> 1+1 = 2 ?
Offline
just the single sum. 317-->11
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Hi anonimnystefy;
Yes, there are generating functions for that. Please show an example so that I can clearly understand what you want.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
for 6 and 12 we have:
6,8,11 so the number would be 3.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
You want [1, 2^30) or [1,2^30]?
Let's worry about that later. This is one idea to solve the problem, there are others.
We start with the generating functions:
For computation we will use the expanded forms because there is a nice theoretical result using them.
What does f(x) represent. It represents all the two digit numbers! The following technique uses the roots of unity to only extract the even numbers.
So there are 45 two digits numbers. We continue the process for all 3 digit numbers.
So there are 450 three digit numbers.
One more and we will be able to conjecture a pattern.
There are 4500 four digit numbers.
So are sequence looks like this 4, 45, 450 ,4500 ...
Can you take it from here?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
i don't think so.i want the numbers with even sum of digits between a and b not between 1 and 2^30.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
What is a and b? Variables? Cause we will use the same technique.
Where did he go? I hope he was not abducted by aliens?!
Are you saying you want the number of solutions to this diophantine equation?
With the constraints that a < b and 1 ≤a,b ≤ 2^30 and n = 0,2,4,6,8,10,12...?
We will use the techniques of experimental math:
Using this formula and taking a = 1 and b = 2^30 the number of soultions to that is:
288230375614840832
If you want say a = 10 to b = 2^30 do you see how to get that answer?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
As you count they generally alternate odd, even, odd, even etc. But for every 10 numbers (starting with 1) they repeat. E.g. 9 (odd) , 1+0 (odd), and 3+9 (even) , 4+0 (even)
Generally it looks like for every 10^(n) for odd n there is a repeat. E.g. 9+9+9 (odd) 1+0+0+0 (odd). But 9+9 (even) and 1+0+0 (odd).
It remains for it to be proven, then apply iteration and modular arithmetic and get the algorithm.
Offline
hi bobbym
no still not what i want
hi Alex23
that's what i thought of too but the code would then look...i'm sure there is a better way.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
no still not what i want
Please clarify.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Hi anonimnystefy,
As an example, are these the numbers you want in [6,188] ?
6, 8, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 110, 112, 114, 116, 118, 121, 123, 125, 127, 129, 130, 132, 134, 136, 138, 141, 143, 145, 147, 149, 150, 152, 154, 156, 158, 161, 163, 165, 167, 169, 170, 172, 174, 176, 178, 181, 183, 185, 187
total: 91
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?
"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
Offline
Hi gAr;
That is what I am getting now but still no formula for a and b.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Hi bobbym,
Okay, I was waiting to get it clarified.
Your g.f is good!
But I too don't have a formula yet for any [a, b]
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?
"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
Offline
Hi gAr;
I agree about getting it clarified. He will be up in a few hours and then we will know.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
hi gAr
those would be the numbers.
to both of you,
i noticed that that number is always either (b-a) div 2,(b-a) div 2 +1 or (b-a) div 2 -1.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Hi anonimnystefy;
If that is correct it is better than what I was working on.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
i don't understand your sentence.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Hi anonimnystefy;
Poor typing. Left out a than.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
well i'm sure it's true.you can notice in every ten numbers(1-10,11-20,21-30,...) exactly five numbers have an even sum of digits.i'm just not sure if it can be (a-b) div 2 -1.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Hi;
(1-10) has 4.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
hi gAr
those would be the numbers.
to both of you,
i noticed that that number is always either (b-a) div 2,(b-a) div 2 +1 or (b-a) div 2 -1.
That seems to be true. I didn't find any counter example yet after 10. Those repeats offset each other. If I didn't have exam tomorrow I would work with it. Modular arithmetic seems to do the trick and hopefully we can prove also why the formula works to be sure.
Last edited by Alex23 (2012-02-07 09:27:15)
Offline
hi bobbym
yes,you are right.but still...i think it's always true.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline