Coloring each k-th unit in a circle of n units

AI Thread Summary
The discussion centers on a mathematical problem involving coloring numbers arranged in a circle based on a step size k. When the greatest common divisor (gcd) of n (the total numbers) and k is 1, all numbers in the circle are colored. If k divides n, the number of colored units x equals n/k. For cases where gcd(n, k) is greater than 1, such as n=10 and k=8, the number of colored units can be determined by dividing n by gcd(n, k). In this example, gcd(10, 8) is 2, leading to x being 10 divided by 2, resulting in 5 colored numbers. The discussion highlights the importance of understanding the relationship between n, k, and their gcd to determine the number of colored units effectively.
yetam60389
Messages
2
Reaction score
0
TL;DR Summary
N numbers in a circle, coloring each k-th one.
suppose you write, clockwise, n numbers (or "units", doesn't matter) in a circle. you then color, clockwise, each k-th number. you do this until you've colored all n numbers, or until you've reached an already colored number. let x be the number of colored numbers.
i've figured that if gcd(n,k)=1, if they're coprime, the whole circle is colored.
furthermore, if k divides n, then x=n/k.

n=10, k=7, then x=10

n=10, k=5, then x=2

tho, what if they're not?
n=10, k=8, then x=5. from where does this 5 arise?

i swear I've solved this before but i just can't find the answer within my brain now.

thanks for any help!
 
Technology news on Phys.org
yetam60389 said:
n=10, k=8, then x=5. from where does this 5 arise?
What is 10 divided by gcd(10, 8)?

You just need to generalize your analysis a bit.
 
PeterDonis said:
What is 10 divided by gcd(10, 8)?

You just need to generalize your analysis a bit.
figured it out in the meanwhile. you're right, i was quite slow in figuring that out.
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
I am trying to run an .ipynb file and have installed Miniconda as well as created an environment as such -conda create -n <env_name> python=3.7 ipykernel jupyter I am assuming this is successful as I can activate this environment via the anaconda prompt and following command -conda activate <env_name> Then I downloaded and installed VS code and I am trying to edit an .ipynb file. I want to select a kernel, via VS Code but when I press the button on the upper right corner I am greeted...

Similar threads

Replies
27
Views
5K
3
Replies
100
Views
11K
Replies
25
Views
4K
2
Replies
60
Views
11K
Replies
51
Views
10K
Replies
3
Views
3K
3
Replies
102
Views
10K
Back
Top