Jocasta Numbers

Rules of Construction of Jocasta Binaries

By convention we let B(X*1)=Ø where N(Ø)=0, and Ø:Y*N:Z*M = Y*N:Ø:Z*M = Y*N:Z*M:Ø = Y*N:Z*M.

B(P*N) = 0 ∀ N>1

B(X:Y*N:Z) = 0:B(Y*N):0 if X=Z

B(X:Y*N:Z) = 1:not(B(Y*N)):1 if X>Z and Y*N≤R(X*N)

B(X:Y*N:Z) = 1:B'(Y*N):0 if X>Z and Y*N>R(X*N)
   (where B'(Y*N) is B(Y*N) with leading 0's converted to 1's)

Explanation of Terms

b is the base we are working in. Note that we always work in terms of integers within base-b.

X*N, Y*N, and Z*N represent any N-digit numbers (note that they may have leading zeroes).

R(X*N) and B(X*N) are shorthand for bR(X*N, N) and bB(X*N, N) respectively. Note that we do not need to define the length argument since it is explicitly defined within the value argument.

X*1 may also be represented more simply as X.

0*N, 1*N, ... represent a series of N zeroes, ones, ... within a number.

P*N represents an N-digit palindromic number (so that R(P*N)=P*N). By definition any X*1 may also be represented as P*1 (or simply P).

X*N:Y*N:Z*N represents a number constructed of all the digits of X*N followed by Y*N followed by Z*N, and would therefore have 3N digits altogether.

X*N:[P*1]:R(X*N) represents a number constructed of all the digits of X*N, optionally followed by P*1, and then followed by all the digits of R(X*N). The resulting number in this case would be either a P*2N or a P*(2N+1).

Help! Maths!