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

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #88: Product-sum numbers

Project Euler #88: Product-sum numbers

Problem
Submissions
Leaderboard
Discussions

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

A natural number, , that can be written as the sum and product of a given set of at least two natural numbers, is called a product-sum number: .

For example, .

For a given set of size, , we shall call the smallest with this property a minimal product-sum number. The minimal product-sum numbers for sets of size, are as follows.





Hence for , the sum of all the minimal product-sum numbers is ; note that is only counted once in the sum.

In fact, as the complete set of minimal product-sum numbers for is , the sum is .

What is the sum of all the minimal product-sum numbers for ?

Input Format

First and only line contains an integer .

Constraints

Output Format

Print the required answer.

Sample Input

12

Sample Output

61

Author

shashank21j

Difficulty

Easy

Max Score

100

Submitted By

1094

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