A positive integer is a good number, if its base $10$ representation can be split into at least $5$ sections, each section with a non-zero digit, and after interpreting each section as a positive integer (omitting leading zero digits), they can be split into two groups, such that each group can be reordered to form a geometric sequence (if a group has $1$ or $2$ numbers, it is also a geometric sequence), for example $20240327$ is a good number, since after splitting it as $2|02|403|2|7$, $2|02|2$ and $403|7$ form two groups of geometric sequences. If $a>1$, $m>2$, $p=1+a+a^2+\dots+a^m$ is a prime, prove that $\frac{10^{p-1}-1}{p}$ is a good number.
Problem
Source: 2024 CTST P20
Tags: number theory, Digits, geometric sequence
28.03.2024 05:25
The number is the first $p-1$ digits of $\frac1p$. Let $o=\operatorname{ord}_p(10)$. If $o\leq\frac{p-1}3$, then the expansion of $\frac1p$ has length $o$, so the number of repeats is at least $3$. If the repeat has two nonzero digits, then each repeat can be split into two groups, which forms two geometric sequences with ratio $1$. Otherwise, $p=11\cdots11\geq11111$ so the number of repeats is more than $5$. Otherwise, there exists $c$ such that $10^c\equiv k\pmod p$ where $k$ is any small quadratic residue. If $\frac p3<c<\frac{2p}3$, then $2c$ does not lie in that range, so there exists $d<\frac p3$ or $d>\frac{2p}3$ such that $z=10^d\mod p\leq k^2$. Notice that we can always take some $z\leq\min(a^2,16)$. Case 1: $d<\frac p3$ Then, the blocks of digits $[1,d]$, $[d+1,2d]$, $[2d+1,3d]$ form a geometric sequence with ratio $z$ as $z^3<p$. Case 2: $d>\frac{2p}3$ Then, the blocks of digits $[d+1,p]$, $[2d-p+1,d]$, $[3d-2p+1,2d-p]$ form a geometric sequence with ratio $z$ as $z^3<p$. The edge cases and finite case check are left as an exercise to the reader.
29.03.2024 18:25
Such a nice problem! The key is to find out that $\frac{1}{31}=0.032258 064516 129032 258064 516129\dots$, and we can divide $\frac{10^{p-1}-1}{p}$ into $m+1$ segments and we will get two groups of geometric sequences with ratio $a$ if $o=\operatorname{ord}_p(10)>\frac{p-1}{3}$