# Tag Archives: maths-perfect-square

## Square root of a number by Repeated Subtraction method

Given an integer N, the task is to find its perfect square root by repeated subtraction only. Examples: Input: N = 25 Output: 5 Input:… Read More »

## Count quadruplets(A, B, C, D) till N such that sum of square of A and B is equal to that of C and D

Given a number N, the task is to find the number of quadraples such that a2 + b2 = c2 + d2 where (1 <=… Read More »

## Count of elements having odd number of divisors in index range [L, R] for Q queries

Given an array arr[] of N positive integers and the number of queries Q, each query contains two numbers L and R. The task is… Read More »

## Count of elements to be multiplied with integers to make each pair of Array a perfect square

Given an array arr[] containing positive integers, the task is to find the minimum number of operations to be done on the array to make… Read More »

## Smallest number whose sum of digits is square of N

Given an integer N, the task is to find the smallest number whose sum of digits is N2.Examples:   Input: N = 4 Output: 79 24 = 16 sum… Read More »

## Sastry Numbers

Given an integer N, the task is to check N is a Sastry number.  A number N is a Sastry Number if N concatenated with… Read More »

## Find sum of product of every number and its frequency in given range

Given an array arr[] of integers and an array of queries, the task is to find the sum of product of every number and its… Read More »

## Count of pairs of integers whose difference of squares is equal to N

Given a positive integer N, the task is to find the count of pairs of integers (x, y) whose difference of squares is equal to… Read More »

## Count elements in an Array that can be represented as difference of two perfect squares

Given an array arr[], the task is to count the number of elements in the array that can be represented as in the form of… Read More »

## Find two numbers such that difference of their squares equal to N

Given an integer N, the task is to find two non-negative integers A and B, such that A2 – B2 = N. If no such… Read More »

## Subsets of size K with product equal to difference of two perfect squares

Given a distinct integers array arr[] of size N and an integer K, the task is to count the number of subsets of size K… Read More »

## Sum of all perfect square divisors of numbers from 1 to N

Given a number N, the task is to find the sum of all the perfect square divisors of numbers from 1 to N. Examples: Input:… Read More »

## Construct an Array such that cube sum of all element is a perfect square

Given the size of array N, the task is to construct an array of size N with positive integer elements such that the cube sum… Read More »

## Count of subarrays whose sum is a perfect square

Given an array arr[] with positive and negative elements, the task is to count all subarrays whose sum is a perfect square. Examples: Input: arr[]… Read More »

## Construct an Array of size N whose sum of cube of all elements is a perfect square

Given an integer N, the tasks is to construct a sorted array arr[] of size N, such that the sum of cube of all elements… Read More »