def is_square_quadruple_sum_cubes(number):
# Convert the number to a string so that we can access its digits
number_str = str(number)
# Get the first and second digits
first_digit = int(number_str[0])
second_digit = int(number_str[1])
# Calculate the sum of the cubes of the digits
sum_cubes = first_digit**3 + second_digit**3
# Calculate the square of the number
square = number**2
# Check if the square is quadruple the sum of the cubes
if square == 4*sum_cubes:
return True
else:
return False
# Test the function
print(is_square_quadruple_sum_cubes(48)) # True
print(is_square_quadruple_sum_cubes(52)) # False
print(is_square_quadruple_sum_cubes(99)) # False
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def is_square_quadruple_sum_cubes(number):
# Convert the number to a string so that we can access its digits
number_str = str(number)
# Get the first and second digits
first_digit = int(number_str[0])
second_digit = int(number_str[1])
# Calculate the sum of the cubes of the digits
sum_cubes = first_digit**3 + second_digit**3
# Calculate the square of the number
square = number**2
# Check if the square is quadruple the sum of the cubes
if square == 4*sum_cubes:
return True
else:
return False
# Test the function
print(is_square_quadruple_sum_cubes(48)) # True
print(is_square_quadruple_sum_cubes(52)) # False
print(is_square_quadruple_sum_cubes(99)) # False