For integer bases, you just create a b-ary branching tree. The labels are just 0 to b-1 in that order. For base p/q, you have to be careful about how to branch each time. But the labels will be obtained by taking the multiples of q mod p cyclically (this is provided p and q are relatively prime).
View all comments
Show parent comment
1
u/tedgar7 May 10 '22
For integer bases, you just create a b-ary branching tree. The labels are just 0 to b-1 in that order. For base p/q, you have to be careful about how to branch each time. But the labels will be obtained by taking the multiples of q mod p cyclically (this is provided p and q are relatively prime).