Function that converts any text into number

69 Views Asked by At

Years ago I've seen on the Internet a mathematical function that converts any letter/word, i don't remember exactly, into a number. The idea is that the function generates infinitely different output, and anything can be found/located on this infinity, like infinite monkey theorem. Now I cannot find this function, could you please remind it?

Update

The Q is not about some text encodings for software or smth like this. There probably was a couple of functions – one function describes a plane discrete space with X defined on (-∞;+∞), and Y defined on [0; N], like an infinite-wide picture of pixels. And another function takes a string and returns a number Z which is the start (a value of the X axis) of the string in the picture of the first function. I don't remember where I saw this function, probably it was YouTube or some elective course the longest time ago.

2

There are 2 best solutions below

1
On BEST ANSWER

[Edit:] Actually, after your edit, I think you might be looking for a different thing, namely Tupper's self-referential formula.

I'll leave my original answer in place, since it's a similar concept.


I think you're looking for Champernowne's constant, which is the decimal number $$ 0.1\,2\,3\,4\,5\,6\,7\,8\,9\,10\,11\,12\,13\,14\,15\,16\,17\,18\,19\,20\,21\cdots$$

For any given natural number $n$, it appears somewhere in the decimals of this constant (by definition, since the constant just lists all natural numbers as its decimals).

2
On

Well assuming I'm understanding correctly, there would be lots of different way to go about this. One would be to turn each letter into an index of the alphabet, like $a=1,b=2,c=3,\dots$, and then concatenate the numbers, so $abc$ becomes $123$, and so on. You could even just use the already in-place Unicode system that has uniquely numbers for each symbol, and then just concatenate those the same way. This would guarantee a unique number for each and every possible combination of letters or symbols.

Edit: There weren't any comment when I started typing this, so I see now people have already mentioned Unicode now