Skip to content

Instantly share code, notes, and snippets.

@paniq
Last active July 18, 2024 14:41
Show Gist options
  • Save paniq/ff034a60fa31cd7d83729dedc238a72f to your computer and use it in GitHub Desktop.
Save paniq/ff034a60fa31cd7d83729dedc238a72f to your computer and use it in GitHub Desktop.
fn bitstripes (n)
-1:u64 // ((1:u64 << n) | 1)
fn rbitstripes (n)
d := (1:u64 << n) | 1
f := max (n * 2) 1
k := 64:u64 // f
kf := k * f
sh := 64:u64 - kf
m := (-1:u64 // d) >> sh
m | (m << kf)
for i in (range 33)
print
/bin (rbitstripes i) (mindigits = 64)
/bin (bitstripes i) (mindigits = 64)
i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment