period 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , … Let n be a positive integer, and let the function f n : N → { 0 , 1 } be defined by f n ( m ) = { 0 1 g cd ( n , m ) > 1 g cd ( n , m ) = 1 . That is, f n ( m ) tells us whether m is coprime to n or not. If we write out the values of f n , we get a periodic (repeating) pattern. For instance, the list above gives the values of f 1 0 starting at m = 0 ; the pattern repeats itself with period 10.
Consider the function f 1 4 0 0 . What is its period?
Note:
The period is defined as the
smallest
possible value, that is, the least positive
T
such that
f
n
(
m
+
T
)
=
f
n
(
m
)
for all integers
m
.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
Substring '0101000001010100010100010001010101000101010100010001010001010100000101' of period 70 (21 times)
This would be my coded solution:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Problem Loading...
Note Loading...
Set Loading...
Lemma
If the prime factor decomposition of n is n = p 1 e 1 ⋅ p 2 e 2 ⋅ ⋯ then the period of f n is equal to T = p 1 ⋅ p 2 ⋯ .
Application
In this case, since 1 4 0 0 = 2 3 ⋅ 5 2 ⋅ 7 , the solution is 2 ⋅ 5 ⋅ 7 = 7 0 .
Proof
(1) We show that if there is a p ∣ n such that p ∣ T , then there exist m with f n ( m ) = 0 but f n ( m + T ) = 1 .
Assuming this, let m = q 1 ⋅ q 2 ⋯ be the product of all prime factor of n that do not divide T . Then f n ( m ) = 0 because g cd ( n , m ) = m > 1 . Now suppose that there is some prime factor q ∣ g cd ( n , m + T ) , implying both q ∣ n and q ∣ ( m + T ) . The way we defined m , q is a prime factor of either T or m , but not both. Therefore q does not divine m + T ; it follows that such a prime number q does not exist. We conclude g cd ( n , m + T ) = 1 and f n ( m + T ) = 1 .
It follows that T must be at least a multiple of all prime divisors p 1 , p 2 , … of n .
(2) We show that if T = p 1 ⋅ p 2 ⋯ , then f n ( m ) = f n ( m + T ) for all m .
If f n ( m ) = 0 then g cd ( n , m ) > 1 , which means there is a prime factor p ∣ g cd ( n , m ) ; this means that p ∣ n and p ∣ m . From p ∣ n and the definition of T is follows that p ∣ T . From p ∣ m and p ∣ T it follows that p ∣ ( m + T ) . Therefore p ∣ g cd ( n , m + T ) , implying that f n ( m + T ) = 0 as well.
Conversely, suppose that f n ( m ) = 1 , i.e. g cd ( n , m ) = 1 . Then no prime factor p ∣ n can be a divisor of m . But if p ∣ m and p ∣ T then p ∣ m + T , implying that g cd ( n , m + T ) = 1 and f n ( m + T ) = 1 .