We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #169: Exploring the number of different ways a number can be expressed as a sum of powers of 2.

Project Euler #169: Exploring the number of different ways a number can be expressed as a sum of powers of 2.

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 169 from projecteuler.net

Define and to be the number of different ways can be expressed as a sum of integer powers of 2 using each power no more than twice.

For example, since there are five different ways to express :

What is for a given ?

Input Format

One integer is given on first line representing .

Constraints

Output Format

Print one integer which is the answer to the problem.

Sample Input 0

10

Sample Output 0

5

Author

Arterm

Difficulty

Easy

Max Score

100

Submitted By

1698

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy