Consider on the natural number the lexicographic ordering on the prime factorization: If $m = p_1^{a_1}\cdots p_r^{a_r},n = q_1^{b_1}\cdots q_s^{b_s}$ then we define: $$m \vartriangleleft n :\iff [(p_1,a_1),(p_2,a_2),\cdots,(p_r,a_r)] \prec [(q_1,b_1),(q_2,b_2),\cdots,(q_s,b_s)]$$ where the right hand side $\prec$ is the lexicographic ordering of the two lists, where $(p,a) \prec (q,b) :\iff p < q \text{ or } ( p=q \text{ and } a < b)$ and the primes in the factorization list are sorted by usual absolute value: $p_i < p_{i+1}$. Example: 1) For instance for $n=1,\cdots , 10 $ we get the following sorting: $$1, 2, 6, 10, 4, 8, 3, 9, 5, 7$$ 2) Examples : sorted by absolute value: $[2, 7, 11, 30, 60, 121]$ lexicographically sorted: $[2, 30, 60, 7, 11, 121]$ [(2, 1)] = [(2, 1)] [(2, 1)] < [(7, 1)] [(2, 1)] < [(11, 1)] [(2, 1)] < [(2, 1), (3, 1), (5, 1)] [(2, 1)] < [(2, 2), (3, 1), (5, 1)] [(2, 1)] < [(11, 2)] [(7, 1)] > [(2, 1)] [(7, 1)] = [(7, 1)] [(7, 1)] < [(11, 1)] [(7, 1)] > [(2, 1), (3, 1), (5, 1)] [(7, 1)] > [(2, 2), (3, 1), (5, 1)] [(7, 1)] < [(11, 2)] [(11, 1)] > [(2, 1)] [(11, 1)] > [(7, 1)] [(11, 1)] = [(11, 1)] [(11, 1)] > [(2, 1), (3, 1), (5, 1)] [(11, 1)] > [(2, 2), (3, 1), (5, 1)] [(11, 1)] < [(11, 2)] [(2, 1), (3, 1), (5, 1)] > [(2, 1)] [(2, 1), (3, 1), (5, 1)] < [(7, 1)] [(2, 1), (3, 1), (5, 1)] < [(11, 1)] [(2, 1), (3, 1), (5, 1)] = [(2, 1), (3, 1), (5, 1)] [(2, 1), (3, 1), (5, 1)] < [(2, 2), (3, 1), (5, 1)] [(2, 1), (3, 1), (5, 1)] < [(11, 2)] [(2, 2), (3, 1), (5, 1)] > [(2, 1)] [(2, 2), (3, 1), (5, 1)] < [(7, 1)] [(2, 2), (3, 1), (5, 1)] < [(11, 1)] [(2, 2), (3, 1), (5, 1)] > [(2, 1), (3, 1), (5, 1)] [(2, 2), (3, 1), (5, 1)] = [(2, 2), (3, 1), (5, 1)] [(2, 2), (3, 1), (5, 1)] < [(11, 2)] [(11, 2)] > [(2, 1)] [(11, 2)] > [(7, 1)] [(11, 2)] > [(11, 1)] [(11, 2)] > [(2, 1), (3, 1), (5, 1)] [(11, 2)] > [(2, 2), (3, 1), (5, 1)] [(11, 2)] = [(11, 2)] I used this sorting to visualize the following Jaccard similarty kernel, where $\Omega$ counts the prime divisors with multiplicity: $$\frac{\Omega(\gcd(a,b))}{\Omega(\operatorname{lcm}(a,b))}$$ where the entries $n=1,\ldots, N=1400$ of the matrix are sorted by the lexicographic ordering above: [![prime_factorization_fractal_with_lexicographi_sorting][1]][1] **Q: While there seems to be some visual fractal pattern, I am asking myself, how does one quantify / define this fractal pattern?** One idea would be to let $N \rightarrow \infty$ and make the matrix larger, so that one can zoom in but I am not sure how to formalize this idea. **Edit**: Here is another image for the kernel $\omega(\gcd(a,b))$ whose Gram matrix of size $n \times n$ has rank $\pi(n)$, where $\omega$ counts the distinct prime divisors of $n$ and $\pi$ is the prime counting function: [![prime_factorization_fractal_lexicographic_sorting_omega_kernel][2]][2] Counting the size of the blocks on the main diagonal, we find the [following OEIS sequence][3]: $$0, 1, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 3, 1, 1, 1, 4, 1, 1, 1, 4, 2, 1, 1, 5, 2, 1, 1, 5, 2, 1, 1, 1, 6, 2, 1, 1, 1, 6, 2, 1, 1, 1, 1, 7, 2, 1, 1, 1, 1, 7, 3, 1, 1, 1, 1, 8, 3, 1, 1, 1, 1, 8, 3, 1, 1, 1, 1, 1, 9, 3, 1, 1, 1, 1, 1, 9, 3, 1, 1, 1, 1, 1, 1, 10, 3, 1, 1, 1, 1, 1, 1, 10, 4, 1, 1, 1, 1, 1, 1, 11, 4, 1, 1, 1, 1, 1, 1, 11, 4, 1, 1, 1, 1, 1, 1, 1$$ [SageMath-script][4] [1]: https://i.sstatic.net/EUioQ.jpg [2]: https://i.sstatic.net/SQXeY.png [3]: https://oeis.org/A249809 [4]: https://sagecell.sagemath.org/?z=eJytVk2P2yoU3Y80_4GXFXaYmTjT6knzyltUapfppjvLirBNpshgCDjTyb8vGIPtJJNppUZREuDcr3PPxanpDkhBnwlsk6fbG2BfmnYH3QJOW6g0E3RbsxdmpDYWktze3N7U1ubbRRtzEPCF8APpmGxhi1QCdlIDBVgL3vb1rImATYO0PnEnSKfZK8zzpoEEld4Zcc60LvpFOSyirx2purO0crhH07T2iXe1d9Y2m47W56UiTV-oNhR_JdzQpAgROIUCxQhKAeyDisTv7Pdhp01mWVjoJ3vq_HhPlRSK6Jk7Fv0D0tZA_IPb4WTi6C6LYIEvAVazuMvMBdxpKcDu0FadlNwAJpStG1RCbTu5bejRYegrEYpTYwsYWMnX6F-UZfadpmu0Th_Tj_Yz7X940i1vbQcXX4Lp0yKJm94JKI-AlEbyQ0eBawN9AgsUYo1oTl9ZJa0Y1A9WEc6PQxIOHfIJVgjYlPGYPRy4TLyqok4CfuAoSuZkv-9kn0XfOJKgxafF0IxeeNRKACxwv0cwLoeN_21mvUXp4w6sWt0qLjvOyvtK_Ad8x33PNanP5Km0vKC_KOmmyfokRok8V3W_g3H2XvP9nAaD5MGveSX8GoxB1tMgg7WcW4_gxwvgdRqAafr4AElappAsZ2YfLphlD46TiH6YOElG3mxzO7N1It4qO5hMHgwMP2bj01pS-tkJpxjnxTlLeVZEE2a2PftjY7wevP09UYq2NcyGaXadn8DctAt2-aoMmMZi_LlicJ-cx8ibYomzE1H4I7c1IwGeVnulOM5t5HxVpDCGb5NlqIRze2QB2TgcTX-fkvaZwjVqLXJKyOVKm2ml1mWMpGyku-ysMM7jLNDqpKL-kqqkOob7qaZU9WtiQK3eKzsvios90i71WsEx4F02zfpNDXjjoIC8mNichPhdKVyVQ8-yyzXQcpqJ1QmORSi3nD9ibKG9XIKFY7px4ex4-8t6EJVVReGvyc3Y8QytY8MnyKujt0kC3t2eGxQOZtsx5U2gQhw5M5117r5gCL9ZxrYYFxkOt75HX73zx2AmxrZXMPyma6pp_V1TOksjuTc_5E84hYa_IdYBqiSXuiQaf9cHiipBFF58tk8us0DEKFp1W-3-TOBs8FMrhrPVanDnqN64wVqt_DKyM7JwlYE_rf6v5L-ZPM-JqRjb2mzfJjD5Bd437Fs=&lang=sage&interacts=eJyLjgUAARUAuQ==