4

When numbers of this form have an even number of digits they are divisible by 11. I have noticed the pattern below for 19 where L is the number of digits, but is there a way to prove this more rigorously? What other factors might numbers of this form have which occur in a regular pattern?

L=15 133333333333331 =19*7017543859649

L=33 133333333333333333333333333333331 =19*701754385964912280 7017543859649

L=51 133333333333333333333333333333333333333333333333331 =19*701754385964912280 701754385964912280 7017543859649

L=69 133333333333333333333333333333333333333333333333333333333333333333331 =19*701754385964912280 701754385964912280 701754385964912280 7017543859649

L=87 133333333333333333333333333333333333333333333333333333333333333333333333333333333333331 =19*701754385964912280 701754385964912280 701754385964912280 701754385964912280 7017543859649

L=105 133333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333331 =19*701754385964912280 701754385964912280 701754385964912280 701754385964912280 701754385964912280 7017543859649

Goldbug
  • 1,024
  • I’m sure there are faster ways to solve it, but notice the divisibility rule of 19 (2x the last digit added on to the rest) and repeat it 18 times. – Gabe Dec 04 '19 at 15:29
  • It would also appear to be the case when the length is 27+28k they are divisible by 29 and when length is 21+30k they are divisible by 31. Anyone have thoughts on how to enumerate all the cases where terms is the sequence are guaranteed to be composite? – Goldbug Dec 05 '19 at 15:07

6 Answers6

2

Note that $$ 3 \cdot \overbrace{13\cdots31}^L = (10^{L+1} - 1) - 6(10^L + 1) = 10^{L+1} - 6\cdot 10^L - 7\\ = 10\cdot 10^{L} - 6\cdot 10^L - 7 = 4\cdot 10^L - 7. $$ So, $\overbrace{13\cdots31}^L$ is a multiple of $19$ if and only if $4\cdot 10^L - 7$ is a multiple of $19$, which is to say that $$ 4 \cdot 10^L \equiv 7 \pmod{19} $$
Multiplying both sides by $5$ (mult. inverse of $4$) yields $$ (20) \cdot 10^L \equiv 35 \pmod{19}\\ 10^L \equiv -3 \pmod{19}.\\ $$ From here, it suffices to note that $18$ is the smallest positive value of $L$ for which $10^L \equiv 1 \pmod{19}$, and $10^{14} \equiv -3 \pmod{19}$.

Ben Grossmann
  • 234,171
  • 12
  • 184
  • 355
2

Sequence $\,f_k\,$ has $\,\overbrace{3f_4 = 4(10)^3\!-7}^{\textstyle 3(1331) = 3993\ },\,$ and $\,3f_k = 4(10)^{k-1}\!-7\,$ similarly. Working $\bmod 19\!:$

$ f_{\color{#c00}n+j}\!\equiv f_j\! \iff\ \! 3f_{n+j}+7 \equiv 3f_j+7 \!$ $\iff \!4(10)^{n+j-1}\!\equiv 4(10)^{j-1}\!\!\!\iff\! 10^{\color{#c00}n}\equiv 1\!\!\iff\!\! \color{#c00}{18\mid n}$

since Fermat $\Rightarrow 10^{18}\!\equiv 1,\, $ but $10^6,10^9\!\not\equiv 1,\,$ so $10$ has order $\,\color{#c00}{18}\,$ by the Order Test.

Thus $\!\!\!\!\!\!\!\underbrace{f_{15}\equiv f_{-3}}_{\large 15\ \equiv\ -3\pmod{\!\color{#c00}{18}}}\!\!\!\!\!\!\!\equiv (\color{#0a0}{4(10)^{-4}\!-7})/3 \equiv 0,\,$ by $\, \color{#0a0}{7(10^4)}\equiv 7(5^2)\equiv 7(6)\equiv \color{#0a0}4$

Bill Dubuque
  • 282,220
  • We implicitly used a few times that $,(c,19)=1\Rightarrow\bmod 19!:\ c,$ invertible $,\Rightarrow, c,$ cancellable $\ \ $ – Bill Dubuque Dec 04 '19 at 20:10
1

Consider what happens to one of these numbers if you multiply it by 9 and then add 7. You get $39999\ldots3 + 7 = 4000\ldots 0$. So you can write $1333\cdots31$ as $(4 \times 10^n - 7)/3$ for some $n$; furthermore $n$ is one less than the length of the number in digits.

Now for which values of $n$ is ${4 \times 10^n - 7 \over 3}$ divisible by 19?

We must have $4 \times 10^n \equiv 7 \pmod{19}$. The multiplicative inverse of 4 mod 19 is 5 (since $4 \times 5$ = 20 is one more than a multiple of $19$) and so this is the same as $10^n \equiv (7 \times 5) \pmod{19}$, or $10^n \equiv 16 \pmod{19}$.

You can check that $10^{14} \pmod{19} = 16$. We also have $10^{18} \pmod {19} = 1$ which can be checked by explicit computation or because the nonzero integers mod $p$ with multiplication form a group of order $p-1$. So $10^{14 + 18k} \equiv 16 \pmod{19}$ for nonnegative integer $k$.

Michael Lugo
  • 24,422
1

These numbers are $\dfrac{10^{15+18k}-1}9 +2\dfrac{10^{14+18k}-10}9$.

Modulo $19,$ they're

$\equiv(10^{15}-1)(-2)+2(10^{14}-10)(-2)\equiv(8-1)(-2)+2(16-10)(-2)\equiv-14-24\equiv0,$

since $10^{18k}\equiv1$ by Fermat's little theorem, $10^{15}\equiv8\pmod{19},$ $10^{14}\equiv16\pmod{19}$,

and $9^{-1}\equiv-2\pmod {19}$.

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
0

The total length of the number is $17+18k$, so the whole number is $\frac 13(10^{17+18k}-1)-2-2\cdot 10^{16+18k}$

Now note that $10^{18} \equiv 1 \pmod {19}$ so $10^{18k} \equiv 1 \pmod {19}$ so $$\frac 13(10^{17+18k}-1)-2-2\cdot 10^{16+18k}\equiv\frac 13(10^{17}-1)-2-2\cdot 10^{16}\equiv 1 \pmod {19}$$ by your first calculation.

Ross Millikan
  • 383,099
0

Brainstorming:

$1\underbrace{333...3}_{m-1}1 =$

$1\underbrace{000....0}_{m-1}1 + \underbrace{3333....}_{m-1}0=$

$(10^m + 1)+ 10*\frac {9999....9}3= (10^m+1) +10*\frac {10^{m-1}-1}3$

... okay..

$19$ is prime and by Fermats little theorem $10^{18} \equiv 1\pmod {19}$ and so $10^m + 1\equiv 10^a + 1\pmod {19}$ where $m = 18k + a; 0 \le r < 18$

And the multiplicative inverse of $3\mod 19$ is... lesseee .... $3\times 6=18\equiv -1$ so $3\times (-6)\equiv 3\times 13 \equiv 1 \pmod {19}$.

so $10*\frac {10^m-1}3\equiv 10*13(10^m-1)\equiv 13*10^m-130\equiv 13*10^a+3\pmod {19}$

So $19|1\underbrace{333...3}_{m-1}1$ precisely when

$(10^a +1)+ 13*10^a +3=14*10^a + 4\equiv 0 \pmod 19$.

.... Alright...

It's reasonable to figure $10$ is likely to be a primitive root modulo $19$ so there there is only one solution to the above and if that sole solution happens to be $a = 14$ then $m\equiv 14\pmod{18}$ and $m$ is of the form $14+18k$ and $1\underbrace{333...3}_{m-1}1$ has $m + 1 = 15+18k$ digits.

so... it that the case?

$10^{14} = 4^7*5^{14}= 20^7*5^7\equiv 1^7*5^7=25^3*5\equiv 6^3*5\equiv 3^3*8*5\equiv 27*40\equiv 8*2\equiv -3\pmod {19}$

So $14*10^{14} +4 \equiv 14*(-3) + 4\equiv -38\equiv 0 \pmod{19}$.

So... deep breath....

If $1\underbrace{333...3}_{m-1=13+18k}1$ has $15+18k$ digits then

$1\underbrace{333...3}_{m-1=13+18k}1 = $

$(10^{14+18k}+1)+ 10\frac {10^{13+18k}-1}3 \equiv$

$(10^{14} + 1) + 13*10(10^{13}-1)\equiv $

$14*10^{14} + 4\equiv 0\pmod {19}$.

....

If we want to prove this is the only time $19|1\underbrace{333...3}1$ we just have to prove $10$ is a primitive root modulo $19$ which is a matter of showing $10^{6,9}\not \equiv 1\pmod {19}$. ($10^a\equiv 1$ only if $a|18$. If $10^k\equiv 1$ then $10^{mk}\equiv 1$ so if $10$ is not a primitive root one of $10^{6,9}$ will be equivalent to $1$)

$10^3 =1000 = 950 + 38+12\equiv 12\equiv -7\pmod{19}$ so $10^6 \equiv 49\equiv 11\equiv -8\equiv 6$ and $10^9\equiv (-7)*(-8)=56\equiv -1\pmod {19}$.

.......

Ah, geez.......

$1333.....31\equiv 0 \pmod {19} \iff$

$399....993\equiv 0 \pmod {19} \iff$ (because $3$ and $19$ are relatively prime)

$39999....93 +7 = 4000....0 = 4\times 10^{\text{number of digits}-1} \equiv 7\pod{19} \iff $

$40\times 10^{\text{number of digits} -2}\equiv 7\iff$

$2\times 10^{\text{number of digits} -2}\equiv 7\iff$

$20\times 10^{\text{number of digits}-3}\equiv 7\iff$

$10^{\text{number of digits}-3}\equiv 7\iff$

$10^{\text{number of digits}} \equiv 7000 \equiv 8\pmod {19}\iff$

$\text{number of digits} \equiv 15\pmod {18}$.

Would have been a lot cleaner! (Once we prove $10$ is a primitive root modulo $19$).

=====

Aw... triple geez!

If $10$ is a primitive root modulo $19$ then $10^k; k=0...,18$ is a complete residue system $\mod 19$.

So if $k = 1333.... 31$ has $m = a+18j;a = 0...17$ digits then

$3k + 7 = 400000....0 = 4\times 10^{m-1}$ is equivalent to

$10^bk + 10^c \equiv 10^d10^{m-1}\equiv 10^{a+d-1}\pmod {19}$ where $10^b \equiv 3\pmod {19}$ and $10^{c}\equiv 7$ and $10^d \equiv 4$ which is equivalent to

$k \equiv 10^{a+d-1-b\pmod {18}}- 10^{c-b}$ (where $a+d-1-b\pmod{18}$ is a positive integer)

And $19|k$ if and only if $a+d-1-b \equiv c-b\pmod 18$.

$10^k \equiv 1, 10, 5,12, 6,3,11, 15, 17, 18,9,14,7,13,16,8,4,2$

So $b= 5; c=12; d=16$ and for to solve:

$a+d-1-b\equiv c-b$

$a + 16-1-5\equiv 12-5\pmod {18}$

$a \equiv 15\pmod 18$.

fleablood
  • 130,341