You are given a 0-indexed integer array nums of length n. You can perform the following operation as many times as needed: pick an index i that has not been previously selected, and choose a prime number p such that p < nums[i]. Then, subtract p from nums[i]. Your task is to determine if it is possible to make the array strictly increasing by performing the operation described.
You are given a circular integer array arr and an integer k. In this circular array, the first element follows after the last one, and the last element precedes the first one. Your task is to determine the minimum number of operations required to make the sum of every subarray of length k equal. In each operation, you can pick any element in the array and either increase or decrease it by 1.
Given a 2D grid of integers, you need to determine the largest prime number present on any of the diagonals of the grid. A number is considered prime if it is greater than 1 and divisible only by 1 and itself. The diagonal elements are those where the row and column indices are the same or sum to the length of the grid minus 1.
You are given an array of positive integers ’nums’. You can perform an operation on this array where you select two consecutive elements and replace one of them with the gcd (greatest common divisor) of the two elements. The goal is to make all elements of the array equal to 1 using the minimum number of operations. If it’s impossible to make all elements equal to 1, return -1.
You are given an array ’nums’ containing integers. A pair of indices ‘i, j’ is considered beautiful if the first digit of nums[i] and the last digit of nums[j] are coprime. Two numbers are coprime if their greatest common divisor (GCD) is 1, i.e., ‘gcd(x, y) == 1’. Your task is to find the total number of beautiful pairs in nums.
You are given an integer ’n’. Your task is to find all pairs of prime numbers [x, y] such that 1 <= x <= y <= n, x + y = n, and both x and y are prime numbers. Return a 2D sorted list of such prime pairs. If no such pairs exist, return an empty array.