2
$\begingroup$

I have been toying for a while with the study of: in how many distinct primes and of which size can we divide permutations of digits of the first positive integers?

In this post I studied how many permutations of the digits of consecutive positive integers from $1$ to $n$ were prime numbers (allowing leading zeros). There I found some restrictions; for instance, if we call $S(n)$ the set of different permutations of the digits of consecutive positive integers from $1$ to $n$, by divisibility criteria $n$ must be of the form $3k+1$ to have permutations of the digits of consecutive positive integers from $1$ to $n$ that are prime numbers.

In this second post I take a step further, and ask about the possibility of always having some permutation of the digits of consecutive positive integers from $1$ to $n$ (from now on, $p_{i}(n)$) such that it can be divided into blocks of digits such that each block forms some prime number.

As a result of the comments, the broader (and more interesting) question stated at the beginning of this post came to my mind. in how many distinct primes and of which size can we divide permutations of digits of the first positive integers?

Regarding maximum size of some block of digits of some permutation being a prime number (from now on, $M_{s}B_{j}p_{i}(n)$), the first post cited establishes the restriction cited, so if we denote as $D(n)$ the number of digits of consecutive positive integers from $1$ to $n$, at most we have $M_{s}B_{j}p_{i}(n)\leq D(n)-1$ for any $p_{i}(n)$ such that $n\neq 3k+1$, and numerical evidence shows that $M_{s}B_{j}p_{i}(n)= D(n)$ for many $p_{i}(n)$ such that $n=3k+1$. I have not been able to derive other bounds on this angle of the problem, but this suggests that $M_{s}B_{j}p_{i}(n)$ shall be close to $D(n)$.

Regarding the maximum number of blocks of distinct primes, I found surprising that really tight bounds on the number of blocks can be (in principle) conjectured. For instance, using the Python program below, I have been able to check that if we restrict the size of the blocks to be $M_{s}B_{j}p_{i}(n)\leq \lfloor\log(n)\rfloor$ the program finds permutations and sets of blocks of digits such that each block forms some distinct prime number for $n\leq 13$ (the program takes so much time for bigger values of $n$). Currently, I have no clue on how sharp could this bound be, or if it is clearly false for bigger values of $n$.

I guess that some statistical study on the ocurrence of digits in the first prime numbers could be helpful, comparing it to the ocurrence of digits in the first consecutive positive integers, to get more insight on the possible restrictions to size and number of prime numbers in which permutations of the first consecutive positive integers can be divided.

Questions

Can you share some helpful references, or insight (teorical or heuristical) to this problem? Do you find it interesting enough to continue researching? Can you share some advice on how to improve the Python program, or an alternative, to check bounds for bigger values of $n$?

Thanks in advance!

Python program for checking bounds

@author: juanmoreno """

import itertools import math

def is_prime(num): if num < 2: return False for i in range(2, int(math.sqrt(num)) + 1): if num % i == 0: return False return True

def find_smallest_blocks(perm_str, log_n, max_block_size, current_blocks, all_blocks): if len(perm_str) == 0: if all_blocks is None or len(current_blocks) < len(all_blocks): return current_blocks return all_blocks

for size in range(1, min(max_block_size, len(perm_str)) + 1):
    block = perm_str[:size]
    if is_prime(int(block)):
        new_blocks = current_blocks + [block]
        result = find_smallest_blocks(perm_str[size:], log_n, max_block_size, new_blocks, all_blocks)
        if result is not None:
            all_blocks = result

return all_blocks

def find_permutation(n): digits = list(range(1, n+1)) log_n = math.floor(math.log(n)) max_block_size = log_n

while True:
    for perm in itertools.permutations(digits):
        perm_str = ''.join(map(str, perm))
        blocks = find_smallest_blocks(perm_str, log_n, max_block_size, [], None)
        if blocks:
            print(f"Valid permutation found: {perm_str} => Blocks: {blocks}")
            return

    # Generate next permutation
    next_permutation = list(itertools.permutations(digits))
    if next_permutation:
        digits = list(next_permutation[0])
    else:
        break

print("No valid permutation found.")

if name == "main": n = int(input("Enter a positive integer n: ")) find_permutation(n)

$\endgroup$

1 Answer 1

2
$\begingroup$

here are some references to my previous research on a couple of strictly related open problems.

  1. Here we show fascinating recurring patterns occurring in all the permutations of any element of the OEIS sequence A180346: https://nntdm.net/papers/nntdm-18/NNTDM-18-1-29-48.pdf Thus, we provide an "ad hoc" sieve for those circular permutations of any element of the string $1\_2\_3\_4\_5\_\dots\_m\_(m+1)\_\dots\_n$ which is pretty similar to the ancient idea by Eratostene.

  2. A very old preprint of mine on this very specific topic: https://vixra.org/pdf/1101.0092v2.pdf.

  3. Related OEIS sequences: A046893, A068710, A176942, A180346, A181129, A344626-A344626.

At the time (2011) I enjoyed very much such a recreational challenge, thus I hope you will go further and improve my previous results stated in the aforementioned references.

$\endgroup$
2
  • 1
    $\begingroup$ thanks for your references! I hope to be able to complete the research, and find connections between your work and mine! $\endgroup$ Commented Aug 4, 2023 at 6:20
  • 2
    $\begingroup$ Thank you, Juan! I hope the same. My paper on NNTDM is not immediately understandable, but its outcome is very powerful, since (given a prime number $pr_j$) we have one and only one recurring pattern for every sector of Figure 4, as shown in Section 4, Figures 6 to 20, for primes between 7 and 13 and small values of $d(p)$ and $d(r)$). Those patterns of Smarandache numbers that are divisible by any given $pr_j$ repeat themselves over and over covering the whole corresponding sector of Figure 4 (i.e., each sector is uniquely defined by one pair $(d(p), d(r)$). $\endgroup$ Commented Aug 4, 2023 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .