1597763040

Given a positive number **N**, the task is to check whether the given number **N** can be expressed in the form of **ax + by** where x and y > 1 and a and b > 0. If N can be expressed in the given form then print **true** otherwise print **false**.

**Examples:**

_ N = 5_Input:

_ true_Output:

Explanation:

_5 can be expressed as 22+12 _

_ N = 15_Input:

_ false_Output:

**Approach:** The idea is to use the concept of perfect powers to determine whether the sum exists or not. Below are the steps:

- Create an array(say
**perfectPower[]**) to store the numbers which are a perfect power or not. - Now the array
**perfectPower[]**store all the elements which are perfect power, therefore we generate all possible pair sum of all the elements in this array. - Keep the mark of the sum calculated in the above step in an array
**isSum[]**as it can be expressed in the form of**ax + by**. - After the above steps if
**isSum[N]**is true then print**true**otherwise print**false**.

#greedy #mathematical #maths #maths-power #numbers

1619607900

Introduction

A number is said to be the perfect number if the sum of its proper divisors (not including the number itself) is equal to the number.

To get a better idea let’s consider an example, proper divisors of 6 are 1, 2, 3. Now the sum of these divisors is equal to 6 (1+2+3=6), so 6 is said to be a perfect number. Whereas if we consider another number like 12, proper divisors of 12 are 1, 2, 3, 4, 6. Now the sum of these divisors is not equal to 12, so 12 is not a perfect number.

Programming in Python is relatively simpler and more fun when compared to other languages because of its simpler syntax, good readability. Now that we are clear with the concept of perfect number let’s write a python program to check if a number is a perfect number or not. Let’s build a python code for checking if the given user input is a perfect number or not and explore the fun in coding with python.

#data science #how to check if a number is perfect #perfect number #perfect number in python #perfect number program in python #python

1620418260

Introduction

A number is said to be the perfect number if the sum of its proper divisors (not including the number itself) is equal to the number.

To get a better idea let’s consider an example, proper divisors of 6 are 1, 2, 3. Now the sum of these divisors is equal to 6 (1+2+3=6), so 6 is said to be a perfect number. Whereas if we consider another number like 12, proper divisors of 12 are 1, 2, 3, 4, 6. Now the sum of these divisors is not equal to 12, so 12 is not a perfect number.

Programming in Python is relatively simpler and more fun when compared to other languages because of its simpler syntax, good readability. Now that we are clear with the concept of perfect number let’s write a python program to check if a number is a perfect number or not. Let’s build a python code for checking if the given user input is a perfect number or not and explore the fun in coding with python.

#data science #how to check if a number is perfect #perfect number #perfect number in python #perfect number program in python #python

1597763040

Given a positive number **N**, the task is to check whether the given number **N** can be expressed in the form of **ax + by** where x and y > 1 and a and b > 0. If N can be expressed in the given form then print **true** otherwise print **false**.

**Examples:**

_ N = 5_Input:

_ true_Output:

Explanation:

_5 can be expressed as 22+12 _

_ N = 15_Input:

_ false_Output:

**Approach:** The idea is to use the concept of perfect powers to determine whether the sum exists or not. Below are the steps:

- Create an array(say
**perfectPower[]**) to store the numbers which are a perfect power or not. - Now the array
**perfectPower[]**store all the elements which are perfect power, therefore we generate all possible pair sum of all the elements in this array. - Keep the mark of the sum calculated in the above step in an array
**isSum[]**as it can be expressed in the form of**ax + by**. - After the above steps if
**isSum[N]**is true then print**true**otherwise print**false**.

#greedy #mathematical #maths #maths-power #numbers

1620885491

Hire **top dedicated Mirosoft power BI consultants** from ValueCoders who aim at leveraging their potential to address organizational challenges for large-scale data storage and seamless processing.

We have a team of **dedicated power BI consultants** who help start-ups, SMEs, and enterprises to analyse business data and get useful insights.

What are you waiting for? Contact us now!

No Freelancers, 100% Own Staff

Experienced Consultants

Continuous Monitoring

Lean Processes, Agile Mindset

Non-Disclosure Agreement

Up To 2X Less Time

##power bi service #power bi consultant #power bi consultants #power bi consulting #power bi developer #power bi development

1619670565

Hire our expert Power BI consultants to make the most out of your business data. Our power bi developers have deep knowledge in Microsoft Power BI data modeling, structuring, and analysis. 16+ Yrs exp | 2500+ Clients| 450+ Team

Visit Website - https://www.valuecoders.com/hire-developers/hire-power-bi-developer-consultants

#power bi service #power bi consultant #power bi consultants #power bi consulting #power bi developer #power bi consulting services