Skip to main content
deleted 1724 characters in body
Source Link
mousetail
  • 14.5k
  • 19
  • 27

Base Neutral Numbering System

It frustrates me that when you say "base 16", the 16 is in base 10. We need a base neutral way of writing down numbers when favoring a specific base would be inappropriate.

How it works

We define <n> to be the nth prime. So <1>=2, <2>=3, <3>=5. Note that every positive integer can be uniquely represented by the product of some number of <> expressions. For example 6 can be written as <1>*<2>.

However, in this form we still have numbers that need to be represented in some base. So we must recurse on each term. Until we reach the number 1, which has the same value almost in any base.

Your challenge is to print positive integer in this base neutral format.

I hope the examples will make things more clear:

Test cases

base 10base neutralExplanation
111 can't be factored
2<1>2 is the first prime
3<<1>>3 is the second prime, 2 is the first prime
4<1> * <1>2 times 2
5<<<1>>>5 is the third prime
6<1> * <<1>>2 times 3
10<1> * <<<1>>>
13<<1> * <<1>>>6th prime
255<<1>> * <<<1>>> * <<<1> * <1>>>3 * 5 * 17, 17 is the 7th prime, 7 is the 4th prime

You may replace * with any symbol of you prefer. You may replace <> with {},[] or () if you prefer, as long as you don't use the symbol replacing *. The 1 must stay a 1 though. You may also add spaces or line breaks anywhere. The spaces in the examples are just for clarity and you may omit them.

This is code golf. Shortest answer in each language wins.

Base Neutral Numbering System

It frustrates me that when you say "base 16", the 16 is in base 10. We need a base neutral way of writing down numbers when favoring a specific base would be inappropriate.

How it works

We define <n> to be the nth prime. So <1>=2, <2>=3, <3>=5. Note that every positive integer can be uniquely represented by the product of some number of <> expressions. For example 6 can be written as <1>*<2>.

However, in this form we still have numbers that need to be represented in some base. So we must recurse on each term. Until we reach the number 1, which has the same value almost in any base.

Your challenge is to print positive integer in this base neutral format.

I hope the examples will make things more clear:

Test cases

base 10base neutralExplanation
111 can't be factored
2<1>2 is the first prime
3<<1>>3 is the second prime, 2 is the first prime
4<1> * <1>2 times 2
5<<<1>>>5 is the third prime
6<1> * <<1>>2 times 3
10<1> * <<<1>>>
13<<1> * <<1>>>6th prime
255<<1>> * <<<1>>> * <<<1> * <1>>>3 * 5 * 17, 17 is the 7th prime, 7 is the 4th prime

You may replace * with any symbol of you prefer. You may replace <> with {},[] or () if you prefer, as long as you don't use the symbol replacing *. The 1 must stay a 1 though. You may also add spaces or line breaks anywhere. The spaces in the examples are just for clarity and you may omit them.

This is code golf. Shortest answer in each language wins.

Base Neutral Numbering System

Add *
Source Link
mousetail
  • 14.5k
  • 19
  • 27

Base Neutral Numbering System

It frustrates me that when you say "base 16", the 16 is in base 10. We need a base neutral way of writing down numbers when favoring a specific base would be inappropriate.

How it works

We define <n> to be the nth prime. So <1>=2, <2>=3, <3>=5. Note that every positive integer can be uniquely represented by the product of some number of <> expressions. For example 6 can be written as <1>*<2>.

However, in this form we still have numbers that need to be represented in some base. So we must recurse on each term. Until we reach the number 1, which has the same value almost in any base.

Your challenge is to print positive integer in this base neutral format.

I hope the examples will make things more clear:

Test cases

base 10 base neutral Explanation
1 1 1 can't be factored
2 <1> 2 is the first prime
3 <<1>> 3 is the second prime, 2 is the first prime
4 <1><1><1> * <1> 2 times 2
5 <<<1>>> 5 is the third prime
6 <1><<1>><1> * <<1>> 2 times 3
10 <1><<<1>>><1> * <<<1>>>
13 <<1> * <<1>>> 6th prime
255 <<1>> * <<<1>>> * <<<1>*<1>>><<<1> * <1>>> 3 * 5 * 17, 17 is the 7th prime, 7 is the 4th prime

You may replace * with any symbol of you prefer. You may replace <> with {},[] or () if you prefer, as long as you don't use the symbol replacing *. The 1 must stay a 1 though. You may also add spaces or line breaks anywhere. The spaces in the examples are just for clarity and you may omit them.

This is code golf. Shortest answer in each language wins.

Base Neutral Numbering System

It frustrates me that when you say "base 16", the 16 is in base 10. We need a base neutral way of writing down numbers when favoring a specific base would be inappropriate.

How it works

We define <n> to be the nth prime. So <1>=2, <2>=3, <3>=5. Note that every positive integer can be uniquely represented by the product of some number of <> expressions. For example 6 can be written as <1>*<2>.

However, in this form we still have numbers that need to be represented in some base. So we must recurse on each term. Until we reach the number 1, which has the same value almost in any base.

Your challenge is to print positive integer in this base neutral format.

I hope the examples will make things more clear:

Test cases

base 10 base neutral Explanation
1 1 1 can't be factored
2 <1> 2 is the first prime
3 <<1>> 3 is the second prime, 2 is the first prime
4 <1><1> 2 times 2
5 <<<1>>> 5 is the third prime
6 <1><<1>> 2 times 3
10 <1><<<1>>>
13 <<1> * <<1>>> 6th prime
255 <<1>> * <<<1>>> * <<<1>*<1>>> 3 * 5 * 17, 17 is the 7th prime, 7 is the 4th prime

You may replace * with any symbol of you prefer. You may replace <> with {},[] or () if you prefer, as long as you don't use the symbol replacing *. The 1 must stay a 1 though. You may also add spaces or line breaks anywhere. The spaces in the examples are just for clarity and you may omit them.

This is code golf. Shortest answer in each language wins.

Base Neutral Numbering System

It frustrates me that when you say "base 16", the 16 is in base 10. We need a base neutral way of writing down numbers when favoring a specific base would be inappropriate.

How it works

We define <n> to be the nth prime. So <1>=2, <2>=3, <3>=5. Note that every positive integer can be uniquely represented by the product of some number of <> expressions. For example 6 can be written as <1>*<2>.

However, in this form we still have numbers that need to be represented in some base. So we must recurse on each term. Until we reach the number 1, which has the same value almost in any base.

Your challenge is to print positive integer in this base neutral format.

I hope the examples will make things more clear:

Test cases

base 10 base neutral Explanation
1 1 1 can't be factored
2 <1> 2 is the first prime
3 <<1>> 3 is the second prime, 2 is the first prime
4 <1> * <1> 2 times 2
5 <<<1>>> 5 is the third prime
6 <1> * <<1>> 2 times 3
10 <1> * <<<1>>>
13 <<1> * <<1>>> 6th prime
255 <<1>> * <<<1>>> * <<<1> * <1>>> 3 * 5 * 17, 17 is the 7th prime, 7 is the 4th prime

You may replace * with any symbol of you prefer. You may replace <> with {},[] or () if you prefer, as long as you don't use the symbol replacing *. The 1 must stay a 1 though. You may also add spaces or line breaks anywhere. The spaces in the examples are just for clarity and you may omit them.

This is code golf. Shortest answer in each language wins.

added 33 characters in body
Source Link
mousetail
  • 14.5k
  • 19
  • 27

Base Neutral Numbering System

It frustrates me that when you say "base 16", the 16 is in base 10. We need a base neutral way of writing down numbers when favoring a specific base would be inappropriate.

How it works

We define f(n)<n> to be the nth prime. So f(1)=2<1>=2, f(2)=3<2>=3, f(3)=5<3>=5. Note that every positive integer can be uniquely represented by the product of some number of f<> expressions. For example 6 can be written as f(1)*f(2)<1>*<2>.

However, in this form we still have numbers that need to be represented in some base. So we must recurse on each term. Until we reach the number 1, which has the same value almost in any base.

Your challenge is to print positive integer in this base neutral format.

I hope the examples will make things more clear:

Test cases

base 10 base neutral Explanation
1 1 1 can't be factored
2 f(1)<1> 2 is the first prime
3 f(f(1))<<1>> 3 is the second prime, 2 is the first prime
4 f(1)*f(1)<1><1> 2 times 2
5 f(f(f(1)))<<<1>>> 5 is the third prime
6 f(1)*f(f(1))<1><<1>> 2 times 3
10 f(1)*f(f(f(1)))<1><<<1>>>
13 f(f(1)*f(f(1)))<<1> * <<1>>> 6th prime
255 f(f(1))*f(f(f(1)))*f(f(f(1)*f(1)))<<1>> * <<<1>>> * <<<1>*<1>>> 3 * 5 * 17, 17 is the 7th prime, 7 is the 4th prime

You may replace f with any other letter if you prefer. You may replace * with any symbol of you prefer. You may replace ()<> with {},[] or <>() if you prefer, as long as you don't use the symbol replacing *. The 1 must stay a 1 though. You may also add spaces or line breaks anywhere. The spaces in the examples are just for clarity and you may omit them.

This is code golf. Shortest answer in each language wins.

Base Neutral Numbering System

It frustrates me that when you say "base 16", the 16 is in base 10. We need a base neutral way of writing down numbers when favoring a specific base would be inappropriate.

How it works

We define f(n) to be the nth prime. So f(1)=2, f(2)=3, f(3)=5. Note that every positive integer can be uniquely represented by the product of some number of f expressions. For example 6 can be written as f(1)*f(2).

However, in this form we still have numbers that need to be represented in some base. So we must recurse on each term. Until we reach the number 1, which has the same value almost in any base.

Your challenge is to print positive integer in this base neutral format.

I hope the examples will make things more clear:

Test cases

base 10 base neutral Explanation
1 1 1 can't be factored
2 f(1) 2 is the first prime
3 f(f(1)) 3 is the second prime, 2 is the first prime
4 f(1)*f(1) 2 times 2
5 f(f(f(1))) 5 is the third prime
6 f(1)*f(f(1)) 2 times 3
10 f(1)*f(f(f(1)))
13 f(f(1)*f(f(1))) 6th prime
255 f(f(1))*f(f(f(1)))*f(f(f(1)*f(1))) 3 * 5 * 17, 17 is the 7th prime, 7 is the 4th prime

You may replace f with any other letter if you prefer. You may replace * with any symbol of you prefer. You may replace () with {},[] or <> if you prefer, as long as you don't use the symbol replacing *. The 1 must stay a 1 though.

This is code golf. Shortest answer in each language wins.

Base Neutral Numbering System

It frustrates me that when you say "base 16", the 16 is in base 10. We need a base neutral way of writing down numbers when favoring a specific base would be inappropriate.

How it works

We define <n> to be the nth prime. So <1>=2, <2>=3, <3>=5. Note that every positive integer can be uniquely represented by the product of some number of <> expressions. For example 6 can be written as <1>*<2>.

However, in this form we still have numbers that need to be represented in some base. So we must recurse on each term. Until we reach the number 1, which has the same value almost in any base.

Your challenge is to print positive integer in this base neutral format.

I hope the examples will make things more clear:

Test cases

base 10 base neutral Explanation
1 1 1 can't be factored
2 <1> 2 is the first prime
3 <<1>> 3 is the second prime, 2 is the first prime
4 <1><1> 2 times 2
5 <<<1>>> 5 is the third prime
6 <1><<1>> 2 times 3
10 <1><<<1>>>
13 <<1> * <<1>>> 6th prime
255 <<1>> * <<<1>>> * <<<1>*<1>>> 3 * 5 * 17, 17 is the 7th prime, 7 is the 4th prime

You may replace * with any symbol of you prefer. You may replace <> with {},[] or () if you prefer, as long as you don't use the symbol replacing *. The 1 must stay a 1 though. You may also add spaces or line breaks anywhere. The spaces in the examples are just for clarity and you may omit them.

This is code golf. Shortest answer in each language wins.

Source Link
mousetail
  • 14.5k
  • 19
  • 27
Loading