• We just launched and are currently in beta. Join us as we build and grow the community.

simple cs problem which i can't find the answer to

p.samson

Code Modularizer
P Rep
0
0
0
Rep
0
P Vouches
0
0
0
Vouches
0
Posts
160
Likes
133
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 100 XP
suppose you write, clockwise, n numbers in a circle. you then color 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? https://19216811.cam/ https://1921681001.id/
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!
Edited by r1agnar21, 01 September 2022 - 05:15 PM.
 

452,496

336,529

336,537

Top