I am trying to implement the sieve of Atkin in Kotlin. I want it to support numbers up to 2^32-1, so the sieve must be a UInt-indexed array.
I try to initialise the sieve like this:
var sieve = BooleanArray(limit + 1u)
Then, I get the error:
error: type mismatch: inferred type is UInt but Int was expected
So, is there any way of making a BooleanArray (or equivalent) store at least 4294967295 values?