The Math Help Topic

For everything not related to either Rayman or Pirate-Community.
Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
DesLife
Foutch
Posts: 19946
Joined: Sat Jun 12, 2004 12:42 pm
Tings: 186263

Re: The Math Help Topic

Post by DesLife »

Hey mat, I have a game for you (and for others as well, but I guess you'll be the only one interested) ! It's about auto-referent numbers (couldn't find anything in English about those, so I don't even know how they're called).

Let's consider numbers made of 4 digits, like 1230. The referent of a 4 digits number is a 4 digits number as well. To find it, you count the zeros in it : that number will be the first digit of the referent. Then the number of 1, the number of 2, and the number of 3. So the referent of 1230 is 1111.
Here are some examples (the referent of a number is below it) :

1111 - 3000 - 3213 - 4444
0400 - 3001 - 0112 - 0000

An auto-referent is obviously a number equal to its referent.

Can you find all the auto-referent numbers made of 8 digits or less ? :P
Matyuv
Gangsta Globox
Posts: 21362
Joined: Thu Apr 29, 2004 10:22 am
Tings: 54431

Re: The Math Help Topic

Post by Matyuv »

Interesting. Can't think of a clever algorithm just yet, but I'll look into it.
1210 is the lowest auto-referent, right?
DesLife
Foutch
Posts: 19946
Joined: Sat Jun 12, 2004 12:42 pm
Tings: 186263

Re: The Math Help Topic

Post by DesLife »

Indeed. Well stupid algorithms work too.
Matyuv
Gangsta Globox
Posts: 21362
Joined: Thu Apr 29, 2004 10:22 am
Tings: 54431

Re: The Math Help Topic

Post by Matyuv »

They suck though.
Anyways I can prove that sum of digits must be equal to the length of the number, and that the digits must be less than (length/2). It also seems that consecutive digits can't be the same, but I'm yet to prove that. If that's so (gonna look into it soon) it really shouldn't leave many numbers to check. If it isn't, I'll look for other properties.
DesLife
Foutch
Posts: 19946
Joined: Sat Jun 12, 2004 12:42 pm
Tings: 186263

Re: The Math Help Topic

Post by DesLife »

Your program will be longer than if you just tested every number.
Matyuv
Gangsta Globox
Posts: 21362
Joined: Thu Apr 29, 2004 10:22 am
Tings: 54431

Re: The Math Help Topic

Post by Matyuv »

I thought this was a pen&paper problem actually. lal
how many such numbers are there?
DesLife
Foutch
Posts: 19946
Joined: Sat Jun 12, 2004 12:42 pm
Tings: 186263

Re: The Math Help Topic

Post by DesLife »

! Obviously not ! I think there are 7 of them.
Matyuv
Gangsta Globox
Posts: 21362
Joined: Thu Apr 29, 2004 10:22 am
Tings: 54431

Re: The Math Help Topic

Post by Matyuv »

How is this obviously not a pen&paper problem then? They all can be found manually since there aren't too many of them rite?
I just don't like coding at all anymore. It's annoying.
DesLife
Foutch
Posts: 19946
Joined: Sat Jun 12, 2004 12:42 pm
Tings: 186263

Re: The Math Help Topic

Post by DesLife »

I'm not sure you can find them all manually. I'll give it a try though. But if you want some pen&paper problem, I'll come up with some good algebra. :P
Matyuv
Gangsta Globox
Posts: 21362
Joined: Thu Apr 29, 2004 10:22 am
Tings: 54431

Re: The Math Help Topic

Post by Matyuv »

okie Imma try to find them all manually too.
DesLife
Foutch
Posts: 19946
Joined: Sat Jun 12, 2004 12:42 pm
Tings: 186263

Re: The Math Help Topic

Post by DesLife »

Here's a very good one. I really enjoyed it, but I don't know if you'll be able to understand it, and I cba to translate it.
Matyuv
Gangsta Globox
Posts: 21362
Joined: Thu Apr 29, 2004 10:22 am
Tings: 54431

Re: The Math Help Topic

Post by Matyuv »

Fuck I'm still getting 5. You sure about 7?

1210
2020
21200
3211000
42101000
DesLife
Foutch
Posts: 19946
Joined: Sat Jun 12, 2004 12:42 pm
Tings: 186263

Re: The Math Help Topic

Post by DesLife »

Oh no, there are just 5, my mistake. There's a 9 and a 10 digits ones.
Well it didn't seem too hard, I'll try it too !
Matyuv
Gangsta Globox
Posts: 21362
Joined: Thu Apr 29, 2004 10:22 am
Tings: 54431

Re: The Math Help Topic

Post by Matyuv »

Yup it's not hard. I'll check out the article.
Post Reply