Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Today's Game

Name: Anonymous 2018-10-18 16:31

https://dis.tinychan.org/read/lounge/1539806939
>>10
Let's all make our are game, ok?
Ok. Here is the game. You can write all numbers as the sequence of adding 1 and multiplying by 2:

1 = 1
2 = 1*2
3 = 1*2+1
4 = 1*2*2
5 = 2*2+1
6 = (2+1)*2
7 = (2+1)*2+1
8 = 2*2*2
9 = 2*2*2+1
10 = (2*2+1)*2
11 = (2*2+1)*2+1
12 = (2+1)*2*2
13 = (2+1)*2*2+1
14 = ((2+1)*2+1)*2
15 = ((2+1)*2+1)*2+1


Now we don't really need (),+,-, because order is linear:
1:1
2:12
3:121
4:122
5:1221
6:1212
7:12121
8:1222
9:12221
10:12212
11:122121
12:12122
13:121221
14:121212
15:1212121


It is obvious that, in addition to the above, there are other ways to write numbers in this system. For example, 8 can be written as 1222,1122,12112,11112,11111111.

Now the question is: having an arbitrary number N, in how many ways can it be written in this system?
A more complicated question: having all the records of the number N, how many 1s and how many 2s will be among them?

Obviously, two such numbers can be put in juxtapostion, producing the third number. For example, 10|8 = 12212|1222 = 122121222 = 88. And if you remove the initial 1 from the second number, it turns out that juxtapostion gives the multiplication 12212|222 = 12212222 = 80.

What is the name of such a number system, which gives multiplication in juxtaposition? Positional system gives something like an exponentiation.

In the canonic writing of these numbers, noting that after 1, all numbers begin with 12, by moving the indexing by 2, you can write these numbers in binary system (where 0 = 1 and 1 = 2):

1:-----
2:-----
3:0
4:1
5:10
6:01
7:010
8:11
9:110
10:101
11:1010
12:011
13:0110
14:0101
15:01010


Noticing that 0 is never repeated twice, you can use 001 as a terminator if you need to write such numbers one after another - for example, to pack several numbers in the computer's register. To translate such numbers into the usual form, only two operations are needed: shifting to the left, and setting the lower bit of the register to 1.

Name: Anonymous 2018-10-18 16:51

So multiplication can be O (1) operation, regardless of the size of the numbers?

Name: Anonymous 2018-10-18 17:19

what /lounge/ramming language is this?

Name: Anonymous 2018-10-18 22:10

>>3
ur're r anus

Name: Anonymous 2018-10-19 0:23

c〳 ° ▾ ° 〵つ

Name: Anonymous 2018-10-19 1:02

Wrote example Python code: https://github.com/saniv/integer_serialization

That is not Huffman encoding, but then again, it supports objects of any length, without specifying that length anywhere. Kinds of C/C++ null terminated strings, but in bitstream.

Name: Anonymous 2018-10-19 1:21

>>1
Very nice.

Also do you know why there is a penis assistant in this programming imageboard? (it's like MS Word clippit but it's a penis)
https://allchan.su/pr

Don't change these.
Name: Email:
Entire Thread Thread List