tag:blogger.com,1999:blog-6314876008291942531.post799391735858971369..comments2021-03-28T11:31:00.109-07:00Comments on Antonio Gulli's coding playground: Problem solving: Array of bits, and their stateUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-6314876008291942531.post-45659545265665129242009-01-08T10:12:00.000-08:002009-01-08T10:12:00.000-08:00hint: you can prove that the k-th bit is inverted...hint: you can prove that the k-th bit is inverted a number of times equal to the factors of i. Therefore you need to find those numbers which have an odd amounts of factors. You can prove that these numbers must be a perfect square.<BR/>The final problem is to estimate how many perfect square numbers there are before k. This is floor(sqrt(k)).codingplaygroundhttps://www.blogger.com/profile/08478993186814330588noreply@blogger.com