Here's a rule which can count in base x for any real number x for which x^n-(ax^(n-1)+bx^(b-1)+...)=0 with all a,b.... positive integers (there might be some unforeseen edge cases):
Code: Select all
@RULE ArbitraryCounter
@TABLE
n_states:7
neighborhood:vonNeumann
symmetries:none
#1 backbone
#2 unary storage data
#3 moving unary data (empty)
#4 moving unary data (state 2)
#5 ugghhh probably unnecessary state (signal along the bottom)
#6 unary tape stack
var any1={0,1,2,3,4,5,6}
var any2=any1
var any3=any2
var any4=any3
var signal={3,4,5}
var signal2=signal
2,any1,0,0,2,1
2,any1,2,0,4,2
2,any1,0,0,0,1
1,2,6,0,any1,2
1,2,0,0,2,5
1,2,0,0,0,5
1,0,6,0,2,2
1,0,0,0,2,5
6,any1,any2,1,3,0
6,any1,any2,1,2,0
0,6,any1,1,any2,6
0,6,any1,6,any2,6
0,any1,any2,2,signal,0
1,2,0,0,any1,2
1,4,any1,0,any2,2
1,any1,0,0,4,2
6,any1,any2,0,any3,0
5,0,0,0,1,5
5,3,0,0,1,1
0,0,0,0,1,5
3,0,0,5,0,6
5,any1,any2,any3,any4,2
2,any1,5,0,any2,5
2,any1,any2,5,any3,5
2,any1,6,0,signal,2
2,signal,0,0,signal2,2
2,any1,0,2,signal,2
2,any1,any2,any3,signal,4
0,0,any1,0,signal,0
0,0,any1,6,signal,0
0,any1,any2,any3,signal,3
4,any1,any2,any3,any4,2
3,0,6,1,0,6
3,0,6,1,2,6
3,0,6,6,0,6
3,0,6,6,2,6
3,0,0,6,0,6
3,0,0,6,2,6
0,0,any1,6,4,6
3,any1,any2,any3,any4,0
@COLORS
0 0 0 0
1 137 215 102
2 27 187 117
3 229 47 244
4 71 182 241
5 32 55 106
6 168 166 128
Encoding of polynomials is done from right to left, ignoring the leading term, with each stack of state 2 cells representing a coefficient plus one (except for the last one, which is just that value), so that this is x^3-4x-3:
Note that some algebraic numbers are the roots of multiple polynomials of this form, such as the plastic number, which is the root of both x^3-x-1=0 and x^5-x^4-1=0:
For a quadratic root, if its minimal polynomial has only the leading term positive then no multiple of it does. Therefore, although φ and φ^3 (positive real roots of x^2-x-1=0 and x^2-4x-1=0 respectively) can be counted by in this rule, φ^2 (the positive root of x^2-3x+1=0) cannot be. I'm not sure about higher-degree polynomials, but roots of polynomials with only 1 negative term do not work either.