Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A positive integer is defined as ideal if it can be expressed in the form, 3 x 5' for some non-negative integers x and
A positive integer is defined as ideal if it can be expressed in the form, 3" x 5' for some non-negative integers x and y. Ideal integers have only 3 and 5 as prime divisors. The integers 15, 45 and 75 are ideal integers but 6, 10, and 21 are not. Find the number of ideal-integers within the given segment I, r), inclusive, ie. the integerst such that / stsr. For example, I- 200, r - 405. The smaliest ideaf integer in that range is 3 5? - 225. Other values are 35 - 50 - 243, 31 5 - 375, and 3* 5' - 405. There are 4 ideal integers in the range. Function Description Complete the function getidealNums in the editor below. The function retum the number of ideal integers in the inclusive range. getidealNums has the following parameter(s): E an integer r. an integer Constraints 1slsrs2x 10 Input Format For Custom Testing v Sample Case o Sample Input For Custom Testing
Step by Step Solution
★★★★★
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
Factors of 3 and 5 A positive integer is defined as ideal if it can be exp...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started