Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2012-02-06 02:45:23

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Even sum of digits!!!

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

#2 2012-02-06 05:15:49

Alex23
Member
Registered: 2012-01-31
Posts: 19

Re: Even sum of digits!!!

What kind of numbers can a and b be?

Offline

#3 2012-02-06 05:47:49

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

#4 2012-02-06 06:02:42

Alex23
Member
Registered: 2012-01-31
Posts: 19

Re: Even sum of digits!!!

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

#5 2012-02-06 06:11:37

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

#6 2012-02-06 07:18:25

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#7 2012-02-06 07:39:35

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

#8 2012-02-06 07:46:42

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#9 2012-02-06 08:43:37

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

#10 2012-02-06 08:48:25

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#11 2012-02-06 09:24:30

Alex23
Member
Registered: 2012-01-31
Posts: 19

Re: Even sum of digits!!!

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

#12 2012-02-06 09:44:51

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

#13 2012-02-06 09:52:49

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#14 2012-02-06 17:46:28

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: Even sum of digits!!!

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

#15 2012-02-06 19:20:47

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#16 2012-02-06 19:32:39

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: Even sum of digits!!!

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

#17 2012-02-06 19:51:39

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#18 2012-02-07 08:57:59

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

#19 2012-02-07 09:10:38

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#20 2012-02-07 09:13:03

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

#21 2012-02-07 09:15:10

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#22 2012-02-07 09:20:56

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

#23 2012-02-07 09:24:25

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Even sum of digits!!!

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

#24 2012-02-07 09:24:56

Alex23
Member
Registered: 2012-01-31
Posts: 19

Re: Even sum of digits!!!

anonimnystefy wrote:

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

#25 2012-02-07 09:26:38

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: Even sum of digits!!!

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

Board footer

Powered by FluxBB