**Updating this thread after approx. 5 years:**

Edit: In the definition, below, we have $xâˆ—y$ (disregarding signs) is given by `bitFlip(bitXor(x, y), bitWidth=n*3)`

where x and y are any floretions of order n. Of course, any exact definition should take signs into account. Here is the code to properly multiply two floretions in C++ taking signs into account:

Let **a** and **b** be base floretions (i.e. integers with all digits equal 1, 2, 4, or 7 when written in octal) of order **n** (= the total number of digits in octal). Define

```
const long Oct666 = 0666666666666666666666;
const long Oct111 = 0111111111111111111111;
// bitmask is unit floretion (0777...777) with number of digits = n
long bitmask = pow(8, n) - 1;
```

Then $a*b = $

```
int floret_ion::f_mult(int a, int b, const unsigned int bitmask) {
int pre_sign = sgn<int>(a) * sgn<int>(b);
a = abs(a);
b = abs(b);
// Shift every 3-bits of "a" one to the left;
unsigned int a_cyc = ((a << 1) & OCT666) | ((a >> 2) & OCT111);
//take bit AND of a_cyc with b and determine if number of bits set is even or odd
int cyc_sign = (count_bits((a_cyc & b) & bitmask) & 0b1) ? 1 : -1;
// take floretion order into account (e.g. "ije" is odd while "eeii" is even)
int ord_sign = (count_bits(bitmask) & 0b1) ? 1 : -1;
return (pre_sign * cyc_sign * ord_sign) * (bitmask & (~(a ^ b)));
}
```

Original message:

There is a request for Floretion in WIKI going back to 2006, still pending. As one of the original contributors, I have collected a bunch of information, see below. However, I'm not a mathematician and would appreciate any collaboration.

A **floretion** is any whole number whose absolute value base 8 representation contains only digits 1, 2, 4 and 7. For example, the absolute value of the number -315337 in octal is 1147711, which contains only digits 1, 2, 4 and 7. The number of digits when written in octal is the order of the floretion (in this case 7). Instead of writing in octal, we could also associate $1 \leftrightarrow i$, $2 \leftrightarrow j$, $4 \leftrightarrow k$ and $7 \leftrightarrow e$ and write $iikeeii$, establishing a direct link to quaternions. Floretions of the same order can equipped with multiplication: $x*y$ (disregarding signs) is given by
`bitFlip(bitXor(x, y), bitWidth=n*3)`

where $x$ and $y$ are any floretions of order $n$. Signs are taken into account via the left bitshift operator (omitted here).

Floretions of the same order can be multiplied by scalars and added together, effectively turning the group of positive "base" vectors into an algebra over the reals. For example if $x = ie + .5jj + ki$ and $y = je + ik$, then $x*y = ke - .5ej - ek - ii - kk - ki$. Floretions of order one are just the quaternions. Multiplying floretions often leads to relationships among sequences involving fibonacci numbers.

Floretion groups are groups of order $2^{(2n+1)} = 2*4^n$ for $n = 1,2,3 \dots$ (there are $4^n$ positive base vectors)

Note all references to *floretions* before 2012 are of order 1 or 2.
Links:

- Current definition
- Structure of Floretion Group, R. Mathar (order 2 only)
- OEIS A108618
- Construction of sequence with musical properties
Online Floretion Multiplier (order 2 only)

OEIS Sequences related to floretions

**Additional info so far**

Floretions can be used to generate algorithmic music, create fractals, show relationships between fibonacci numbers, store and process images, neural networks, and demonstrate aspects of necklace theory. This article discusses a general definition and uses basic image processing as an example. When floretions are discussed as groups, they are always finite. As each finite group has a matrix representation, broad areas of application are to be expected due to the wide range of matrix theory applications. Refer to the links for other examples.

Before proceeding, possible areas of confusion:

Reading the word "quaternion" by itself, one may ask if the reference is to members of a group Q = {+-i, +-j, +-k, +-e}, to a ring, or to an algebra over the reals or over some other field. The same ambiguity occurs with "floretion": a reference may be to "some floretion x" without explicitely stating group, ring or algebra. This is only possible when the case is clear from the context (which it usually is). In most real-world applications, the reference is to the algebra over the reals. Here, a typical element may be written x = .5i - 2j + .75k or x = ii - ji + .5ee - jk. In the first case x is a first order floretion spanned by base floretions i, j, k (or 1, 2, 4 in octal notation) in the latter it is a second order floretion spanned by base floretions ii, ji, ee, jk (11, 21, 77, 24 in octal). Note floretions of different order cannot be added together or multiplied as they are not in the same space. As a consequence of the above possibilities, there are also many different ways to represent floretions notationally. Do we want to express an order 2 floretion as a member of the quaternion factor space QxQ{1,-1}, as a member of the tensor product of HxH where H is the real algebra of quaternions, as a 4x4 matrix of real numbers, in binary/decimal/octal, or in "OEIS notation" as x = ii - .5ji - ke? Here we will restrict ourselves to binary/decimal/octal or OEIS notation.

The word 'order' is not used in the conventional sense when discussing floretions. Generally, when referring to the order of a floretion x, the reference is not to the standard definition "smallest m such that a^m = e" (for base floretions, m is always 1, 2 or 4) . A (base) floretion can be written with digits 1, 2, 4, 7 as 1224, 224, 12777. The order of the floretion is simply the number of digits.
The group of order n floretions is a group with 2*4^n elements (the factor 2 corresponding to positive and negative elements). As the size of the group is generally also referred to the order of the group, there is a chance of confusion. Again, this should be clear from the context. For example, simply reading "order m" with no additional info, we already know the reference must be to an order m floretion from a group with 2*4^m elements, provided m cannot be written in the form 2*4^n for some n > 0. Conversely, reading "order 32" without any additional info is almost certainly referring to a group with 32 elements: simply because calculating properties floretions of order 12 and above (in this case 32) would be extremely time consuming: we would be working with groups with 2*4^(12) total elements! The only real chance of confusion the "order 8" case- but here we can agree to just say "quaternions".

An image processing introduction:

A floretion can be visualized as a heightmap above and/or below a two-dimensional square grid surface. Alternatively, if heights are interpreted as grayscales, a floretion can be seen as a square black and white image (clearly, 3 floretions as a color image). The higher the order of the floretion, the greater the grid resolution:
order 1: 4^1 tiles, resolution 2x2 pixels
order 2: 4^2 tiles, resolution 4x4 pixels
order 3: 4^3 tiles, resolution 8x8 pixels (chessboard)
...

This applies whether we are discussing floretion groups or algebras: in the case of groups, all heights are equal 1 or -1. A key observation is that multiplication is defined, so these height maps and images can be manipulated in many ways. For example, we may store an image "A" as a floretion (a one dimensional sequence of numbers which can easily be converted to a two dimensional image) and require turning it by 90 degrees. Instead of defining the standard rotation matrix, we can look for an image B such that A*B gives the appropriate rotation. We could also look for a floretion with an inverse to distort the original image and restore it later.