8
$\begingroup$

Today I set out to invent a two character numeral system designed to make factorization trivial. Indeed, it lets one factor non-trivial numbers with over thousand digits within 30 seconds per hand - the upshot is that the notation isn't particularly suited for arithmetic. In fact, when I try to add certain two digit numbers, my computer gives me an overflow warning.

The idea is to not use any base like binary or decimal, as in $28=2\cdot 10^1+8\cdot 10^0$, but to hardcode the prime factors $28=2^2\cdot 3^0 \cdot 5^0 \cdot 7^1$ into the notation. So denote the start and end of a number by "$s$" and "$e$". I set

$0:=se$

and declare a natural number to be any string of the form "$sxe$" where $x$ is a finite string of numbers. The $n$'th number in the sequence $x$ denotes the power oth the $n$'th prime number and "$sxe$" is the associated product. So from an ordinal point of view

$1=2^0=s0e=ssee$

$2=2^1=s1e=ssseee$

$3=2^0\cdot 3^1=s01e=ssesseee$

$4=2^2=s2e=sssseeee$

$5=2^0\cdot 3^0\cdot 5^1=s001e=ssesesseee$

...

$28=2^2\cdot 3^0 \cdot 5^0 \cdot 7^1=s2001e=sssseeesesesseee$

I came to the conclusion that the language consists of all the strings with equal number of $s$'s and $e$'s, where while scanning from the left there are always more $s$'s than $e$'s and the substring $esee$ isn't allowed. The first condition makes sure that all numbers close and the second one disallows superfluous factor of powers of 0.

I've written a script which brute force generates these strings (it forms all permutations of even numbers of $s$'s and $e$'s and then drops the disallowed ones) and also one to translate them to decimal expression (which relies on knowing what the $n$'th prime is):

http://pastebin.com/RwkGX6TV

This e.g tells me that 2417851639229258349412352 is sssesssseeeeee and the nice thing is that all numbers factor easily:

$sssesssseeeeee$

$= s(s(se)(s(s(s(se)e)e)e)e)e$

$=s(s0(s(s(s0e)e)e)e)e$

$=s(s0(s(s1e)e)e)e$

$=s(s0(s2e)e)e$

$=s(s0(2^2)e)e$

$=s(2^0\cdot 3^{2^2})e$

$=2^{3^{2^2}}.$

For now, I've generated most of the numbers with 20 characters and I've added an artificial bound of $R=10^{50}$ to the size of the exponents. This is necessary, as e.g. the number $13$, being the $6$th prime, reads $ssesesesesesseee$, i.e. $s000001e$ but it's neighbors in this enumeration can be numbers with thousands of digits. Generating the strings is simple down at $14$ but multiplication is hard. Later, also higher number of strings are needed and the way I produce the permutation is probably inefficient.

To generate a bigger library of numbers, I'd like to know if someone has an idea for a less arbitrary enumeration of the the strings which avoid the uncomputably big numbers.

Does someone maybe know an good way to enumerate the numbers in the form $1,2,3,2^2,5,2\cdot 3,7,\cdots,3^{2^5}\cdot 11^2\cdot 19^3,\cdots$?

$\endgroup$
5
  • 2
    $\begingroup$ Letting $se$ encode $0$ seems unprincipled -- it ought to stand for the empty product which is $1$. Instead you're making $1$ the only number that's encoded with something that ends in $see$, apparently for no other reason than to distinguish it from $se$. It would be nicer to simply have a separate symbol for $0$. (Also, I think it would be easier to read if you wrote ( and ) instead of $s$ and $e$). $\endgroup$ Commented Oct 12, 2013 at 3:25
  • 1
    $\begingroup$ Multiplication would be easy if only you could do addition, but addition seems to be very hard. (If it weren't, you would have an efficient factorization procedure there, and could turn cryptography upside down...) $\endgroup$ Commented Oct 12, 2013 at 3:30
  • $\begingroup$ @HenningMakholm: Yes, initially I tried to use only s and 0 (similarly to Peanos numbers). Then I saw that I had problems with parsing the end of an exponent and introduced e. Having three symbols makes the expressions more clear, it's true - I just dropped the 0 again when I saw that there is no ambiguity when $se$ pops up and so I used it for that - and thinking about it I make significant use of it in the code. Though it's minimalism, I'm okay with adding 0. I also used brackets but they are not so simple to distinguish and more complex to explain to some programming languages than letters. $\endgroup$
    – Nikolaj-K
    Commented Oct 12, 2013 at 17:00
  • $\begingroup$ Please show an example of a "non-trivial" number that can be factored within $30$ seconds by hand! $\endgroup$
    – Peter
    Commented Nov 21, 2015 at 17:49
  • $\begingroup$ @Henning Fast multiplication would not be enough to factor very large numbers. $\endgroup$
    – Peter
    Commented Nov 21, 2015 at 17:49

0

You must log in to answer this question.