Problem 52689. Easy Sequences 18: Set Bits of Triple Summations
The function S(n) is defined by the following triple summations:
The double brackets mean that the output of the triple summations is being rounded-off to the nearest integer. Write the function 'bitS(n)', which is the number of bits set in the binary representation of S(n).
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
William
on 12 Sep 2021
Hmmm. It's a very clever problem, but I am getting different answers!
ChrisR
on 12 Sep 2021
I am as well. For example, for n = 100, I get 4 (out of 7) bits set.
William
on 12 Sep 2021
Chris -- Yes, exactly.
Ramon Villamangca
on 12 Sep 2021
Let me check. Thanks.
Ramon Villamangca
on 12 Sep 2021
Hi Chris/William,
Should be 'triple summations', sorry for that.
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1985 Solvers
-
Sum of first n terms of a harmonic progression
493 Solvers
-
10572 Solvers
-
Pandigital number n°1 (Inspired by Project Euler 32)
113 Solvers
-
Decrypt the cypher using XOR encryption (for beginners)
62 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!