mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   enzocreti (https://www.mersenneforum.org/forumdisplay.php?f=156)
-   -   repunit mod 43 (https://www.mersenneforum.org/showthread.php?t=25228)

enzocreti 2020-02-13 14:14

repunit mod 43
 
111 mod 43 is 25, a power
1111 mod 43 is 36, a power


111111111111111 mod 43 is 16, a power
1111111111111111 mod 43 is 32 a power.




when repunits mod 43 are powers?
Is there a rule, is there any regularity?

Dylan14 2020-02-13 22:19

1 Attachment(s)
Code used to test this:

[CODE]#define the repunit
def R(n):
return (10**n-1)/9
#powers from 0 to 42 are 4, 8, 9, 16, 25, 32 and 36
n = 1
while n<=10000:
residue = R(n)%43
if residue == 4: #2^2
print "R("+str(n)+")"+"is 4 mod 43"
n += 1
elif residue == 8: #2^3
print "R("+str(n)+")"+"is 8 mod 43"
n += 1
elif residue == 9: #3^2
print "R("+str(n)+")"+"is 9 mod 43"
n += 1
elif residue == 16: #2^4
print "R("+str(n)+")"+"is 16 mod 43"
n += 1
elif residue == 25: #5^2
print "R("+str(n)+")"+"is 25 mod 43"
n += 1
elif residue == 32: #2^5
print "R("+str(n)+")"+"is 32 mod 43"
n += 1
elif residue == 36: #6^2
print "R("+str(n)+")"+"is 36 mod 43"
n += 1
else: #R(n) is something else mod 43
n += 1[/CODE]Using this code I get the following output:
[CODE]R(3) is 25 mod 43
R(4) is 36 mod 43
R(15) is 16 mod 43
R(16) is 32 mod 43
R(24) is 25 mod 43
R(25) is 36 mod 43
R(36) is 16 mod 43
R(37) is 32 mod 43
R(45) is 25 mod 43
R(46) is 36 mod 43
R(57) is 16 mod 43
R(58) is 32 mod 43
R(66) is 25 mod 43
...
[/CODE]So there appears to be a pattern:
R(3+21k) is 25 mod 43, R(4+21k) is 36 mod 43, R(15+21k) is 16 mod 43 and R(16+21k) is 32 mod 43, where k is a non-negative integer.
The full output is shown in the zip file attached to this post.

NHoodMath 2020-02-13 22:30

There is a mathematically rigorous way to analyze this.
Repunit numbers can also be written as numbers of the form (10^n-1)/9, with n a positive integer.
(10^21-1)/9 is the smallest repunit divisible by 43, and 21 is therefore the order of 43 (mod 10), thus the sequence (10^n)%43 will repeat every 21st n value, and by association, so will 10^n-1 and (10^n-1)/9.
Case closed.

sweety439 2020-02-14 12:18

There is a formula of repunits mod p for prime p, the period must be a factor of p-1, thus, you can only calculate R1%p, R2%p, R3%p, ..., R(p-1)%p


All times are UTC. The time now is 16:55.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.