login
Numbers with digits 1,2,4,7 when written in base 8.
1

%I #78 Dec 31 2023 16:57:39

%S 1,2,4,7,9,10,12,15,17,18,20,23,33,34,36,39,57,58,60,63,73,74,76,79,

%T 81,82,84,87,97,98,100,103,121,122,124,127,137,138,140,143,145,146,

%U 148,151,161,162,164,167,185,186,188,191,265,266,268,271,273

%N Numbers with digits 1,2,4,7 when written in base 8.

%C Floretions of all orders. - _Creighton Dement_, Oct 28 2022

%C For any natural number n, the set of terms of this sequence between indices (4^n-1)/3 and (4^(n+1)-4)/3 is "isomorphic" to the group of n-th order floretions. In this case, group multiplication is given by bitwise logical operations (see EXAMPLE). Note that the case of n = 1 is simply the quaternions.

%C In the table below, the left column is the binary representation, the middle column the terms of ((a(n)) and the right column the conventional notation. Multiply x*y (disregarding signs) using the bitwise XNOR operation, where x and y are any floretions of the same order. The XNOR operation returns a 1 if the number of 1's in its inputs is even, and a 0 if the number of 1's is odd. This operation is used to calculate the base vector of the result.

%C **** 1st-order floretions (= quaternions) ****

%C | binary | decimal | floretion

%C 1 | 001 | 1 | i

%C 2 | 010 | 2 | j

%C 4 | 100 | 4 | k

%C 7 | 111 | 7 | e (unit)

%C **** 2nd-order floretions ****

%C 1_1 | 001_001 | 9 | ii

%C 1_2 | 001_010 | 10 | ij

%C 1_4 | 001_100 | 12 | ik

%C 1_7 | 001_111 | 15 | ie

%C 2_1 | 010_001 | 17 | ji

%C 2_2 | 010_010 | 18 | jj

%C 2_4 | 010_100 | 20 | jk

%C 2_7 | 010_111 | 23 | je

%C 4_1 | 100_001 | 33 | ki

%C 4_2 | 100_010 | 34 | kj

%C 4_4 | 100_100 | 36 | kk

%C 4_7 | 100_111 | 39 | ke

%C 7_1 | 111_001 | 57 | ei

%C 7_2 | 111_010 | 58 | ej

%C 7_4 | 111_100 | 60 | ek

%C 7_7 | 111_111 | 63 | ee

%C **** 3rd-order floretions ****

%C 1_1_1

%C 1_1_2

%C ...

%C Note that for a floretion of order n, two digits from any one of its "binary triplets" _abc_ determine the other since XOR(a,b,c) = 1.

%C When working with a floretion algebra over the reals, i.e., elements of the form x = q_1*f_1 + ... q_m*f_m where q_1,...,q_m are real numbers and f_1,...,f_m are any floretions of the same order, then x may also be referred to as a "floretion". In this case f_1,...,f_m (i.e., terms of this sequence) may be referred to as "floretion base vectors" to avoid confusion.

%C Taking signs into account:

%C Given two binary representations (ab) and (cd) for quaternion elements, define multiplication as:

%C Compute (XNOR(a,c))(XNOR(b,d)) to get the base vector of the result.

%C Compute AND(b,c), AND(XNOR(a,b),d), and AND(a,XNOR(c,d)). These are all bitwise AND operations.

%C The sign is negative if and only if the total number of 1's in the results is even.

%C For example, with k*j = (10)*(01) = -i, compute:

%C The base vector as (XNOR(1,0) XNOR(0,1)) = (0)(0) = i.

%C The signs as AND(0,1), AND(XNOR(1,0),1), AND(1, XNOR(0,1)) = 0, 0, 0. There are zero 1's in total, which is an even number, so the result is negative.

%C An example of image processing: take for example a quaternion x = .2i + .5j + .3k + e. Assume we have a square monitor (aspect ratio). Furthermore, assume the screen is divided into 4 squares- one for i (bottom left), one for j (top left), one for k (top right) one for e (bottom right) and that the coefficient is the amount the pixels are lit up on the screen (1 being full brightness, 0 being off- this could be modified later to accomodate negative numbers). Now imagine we have square monitor of resolution 2^n x 2^n. Then we can represent any black and white image with that resolution with an n-th order floretion. This means we can multiply images together, with some parallels to Fourier analysis.

%C Multiplying an image by an idempotent floretion would allow one to repeatedly apply a specific transformation (e.g., a rotation, scaling, or some other operation) to an image, and then undo all of those transformations by continuing to apply the same operation a certain number of times. It could be used in applications such as data encryption, where an image could be "scrambled" using a specific floretion and then "unscrambled" by continuing to apply the same floretion.

%C A compact definition of multiplication is x*y = (ab)(cd) = (-1)^{m+1} (aqc)(bqd) where m = b&c + (aqb)&d + a&(cqd) and "q", "&" are the bitwise XNOR and AND operators respectively. - _Creighton Dement_, Jul 09 2023

%H Creighton Dement, <a href="/A308496/b308496.txt">Table of n, a(n) for n = 1..10000</a>

%H Creighton Dement, <a href="https://github.com/Floretion-Inquisitor/floretions/blob/main/Floretions_and_D3_draft.pdf">Floretions and Actions of D3 (DRAFT)</a>

%H Stefan Rakonjac, <a href="https://imaginary.github.io/oeis-player-mp3/">The Sounds of Sequences: Floretions</a>

%t A308496Q[n_]:=ContainsOnly[IntegerDigits[n,8],{1,2,4,7}];

%t Select[Range[1000],A308496Q] (* _Paolo Xausa_, Dec 31 2023 *)

%o (PARI) is(n)=!#setminus(Set(digits(n,8)),[1,2,4,7]);

%o a(n) =

%o {

%o local(total_count, index);

%o until(total_count == n+1, if(is(index)==1, total_count++); index++);

%o index-1;

%o }

%o (PARI) a(n,b=8,d=[1,2,4,7]) = { for (w=1, oo, if (n>#d^w, n-=#d^w, return (fromdigits(apply(x -> d[1+x], digits(#d^w+n-1, #d))[2..-1],b)))) } \\ _Rémy Sigrist_, Jun 01 2019

%Y Cf. A007094, A108618, A047541.

%K nonn,base,uned

%O 1,2

%A _Creighton Dement_, Jun 01 2019