User:Inthar/Code: Difference between revisions
| Line 729: | Line 729: | ||
// `<<` multiplies the left by two to the power of the right. | // `<<` multiplies the left by two to the power of the right. | ||
(u << gcd_exponent_on_two) as i64 | (u << gcd_exponent_on_two) as i64 | ||
} | } | ||
| Line 907: | Line 894: | ||
// Algorithm from Bulgakova et al, 2023, "On balanced and abelian properties of circular words over a ternary alphabet". | // Algorithm from Bulgakova et al, 2023, "On balanced and abelian properties of circular words over a ternary alphabet". | ||
pub fn christoffel_word(a: u32, b: u32) -> String { | pub fn christoffel_word(a: u32, b: u32) -> String { | ||
let d = | let d = (gcd(a as i64, b as i64) as u32); | ||
if d == 1 { | if d == 1 { | ||
let mut result : String = String::from(""); | let mut result : String = String::from(""); | ||