Solve the alogrithm above you

Ok, the concept is simple, first you solve the algorithm above you, then you give several inputs and their respective outputs using a new specific algorithm.

Rules:
1.) Be easy! If your algorithm isn’t simple enough, or isn’t logical, then no one will be able to solve it, and thus the thread will come to a hault.
2.) The algorithm doesn’t need to be your own, but you’re more than welcome to make up your own too.
3.) You MUST solve the algorithm above you before posting a new problem.
4.) If you can not solve an algorithm, you can ask the author for either a hint or more specific inputs, but someone needs to solve it before you go on.
5.) If you solve an algorithm, you aren’t required to make your own; the person who posts after you just won’t have to solve the previous one to post theirs.

Ok, here’s mine (input on left, output on right):


0 - 0
1 - 1
2 - 2
3 - 3
4 - 10
7 - 13
8 - 20
10 - 22
12 - 30
15 - 33
16 - 100
20 - 110
99 - 1203
100 - 1210
1000 - 33220
9999 - 2130033

CONVERTER PROGRAM HERE

Ok, so that’s a quick program I made in c++ earlier today. And no, I won’t post the sourcecode, for obvious reasons :wink:

42

Huh?
https://en.wikipedia.org/wiki/42_(number)
Is there something in there that I should be aware of?

42 is The Answer to the Ultimate Question of Life, the Universe, and Everything
https://en.wikipedia.org/wiki/42_(number)#In_The_Hitchhiker.27s_Guide_to_the_Galaxy
:retard:

It’s the Answer to Life, the Universe, and Everything.

edit: :ninja:ed :frowning:

It is the ultimate answer to life, the universe, and everything.

EDIT: I actually did that on purpose…

1 - 1 = A
2 - 2 = B
3 - 3 = C —> C is for cookie, thats good enough for me, cookie cookie cookie starts with c

This really doesn’t work if you guys don’t try :wink:

You put holes into your numbers on purpose

0 - 0
1 - 1
2 - 2
3 - 3
4 - 10

5 - 11
6 - 12
7 - 13
8 - 20

9 - 21
10 - 22
11 - 23
12 - 30
13 - 31
14 - 32
15 - 33
16 - 100

17 - 101
18 - 102
19 - 103
20 - 110

Maybe there’s a formula, but I’m getting it wrong.

Am I on the right track?

This forum game, I actually like!

Close?
y = x + 7*[ (x-1) div 3] + 70*[(x-1) div 15]

Some more thought…
y = x + 6*[ x div 4] + 70*[x div 16]

Ooops!
y = x + 6*[ x div 4] + 60*[x div 16]

Therefore
y = x + 6*[ x div 4] + 60*[x div 16] + 600*[x div 256] + 6000*[x div 65536] …
or
y = x + 6*[ x div 4] + 60*[x div 16] + 600*[x div 64] + 6000*[x div 256] + 60000*[x div 1024]…

Maybe there’s a shorthand way to write that…

I dunno what ‘holes’ are, but sadly, no, you’re not on the right track.
You’re gonna smile when you see what the algorithm is :slight_smile:
Thanks for genuinely trying, too!

Oh, if ‘holes’ are incorrect or false data, then no; I haven’t put up any incorrect data.

Edit:
OOOOOOOOOOOOOOOOOOOOOOOOOOH
ROFL
By ‘holes’ you meant I skipped some input numbers. Yes, yes of course, I was giving some random numbers.

And yes, now you’re on the right track :slight_smile:

Well you posted while I was editing, so here’s a bump

y = x + 6*[ x div 4] + 60*[x div 16]

x is input
y is output
[a div b] is a/b rounded down to the nearest integer

it works

I’m afraid that doesn’t work with my newest number added to the input, which is 100.
But you definitely have the right idea.

Edit: also added 1000 and 9999

also added 99 which destroys your 2 digit algorithm, sorry mate.

Haha, no problem thanks for giving more info. I’m busy now, but I’ll give it another shot when I can.

Yeah, that’s wonderful, I wish you the best of luck!
I’m gonna write a program to calculate the output based on an input based on the algorithm so you can have unlimited examples. (if no one solves it before then)

I thought you said be easy! Ugh… I’ve noticed a few patterns here and there, but can’t come up with a consistent one. I think I’ll post “42” like everyone else and come back to it later.

Oh, and please please please PLEASE add a loop to that program. I only used it 4 or 5 times and it drove me nuts that it didn’t even have a simple loop.

Lol, ok fair enough. I fixed it, it’s already uploaded :wink:

Something like:


While (true)
{
//code[…]
}

brb decompilin :stuck_out_tongue_winking_eye:

Edit: doh… c++ and windows executable :frowning: where’s mah *nix-executable… :’( ?

Needs some Kramer’s Law up in here.

Seriously though, be easy?

Fine, I can’t believe no one got it, but here’s a HUGE hint:
I’m converting to a certain base, from base 10.

That would be base 4 then. Kinda embarrassed that I didn’t see that.

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.