# Tag Archives: Numbers

## Triangle of numbers arising from Gilbreath’s conjecture

The task is to find the triangle of numbers arising from Gilbreath’s conjecture. Gilbreath’s conjecture: It is observed that given a sequence of prime numbers,… Read More »

## Euler zigzag numbers ( Alternating Permutation )

Euler Zigzag numbers is a sequence of integers which is a number of arrangements of those numbers so that each entry is alternately greater or… Read More »

## Nambiar Number Generator

M. Nambiar has devised a mechanism to process any given number and thus generating a new resultant number. He calls this mechanism as the “Nambiar… Read More »

## Find two integers A and B such that A ^ N = A + N and B ^ N = B + N

Given a non-negative integer N, the task is to find two integers A (greatest integer smaller than N) and (smallest integer greater than N) such… Read More »

## Program to find first N Fermat Numbers

Fermat numbers are non-negative odd numbers which is valid for all values of k>=0. Only the first seven terms of the sequence are known till… Read More »

## Maximum value of division of two numbers in an Array

Given an array A of size N (> 2). The task is to find the maximum value of A[i] / A[j] Note: A[i] ≠ 0.… Read More »

## Recursive program to find all Indices of a Number

Given an array arr of size N and an integer X. The task is to find all the indices of the integer X in the… Read More »

## Reverse bytes of a Hexadecimal Number

Given an unsigned integer N. The task is to reverse all bytes of N without using a temporary variable and print the reversed number. Examples:… Read More »

## Append a digit in the end to make the number equal to the length of the remaining string

Given a string str in which an integer is appended in the end (with or without leading zeroes). The task is to find a single… Read More »

## Maximum possible elements which are divisible by 2

Given an integer array arr of size N. The task is to find the maximum possible elements in the array which are divisible by 2… Read More »

## Minimum operations required to convert X to Y by multiplying X with the given co-primes

Given four integers X, Y, P and Q such that X ≤ Y and gcd(P, Q) = 1. The task is to find minimum operation… Read More »

## Check if a number is Fermat Pseudoprime

Given a number N and a base number A. The task is to check whether the number is a Fermat Pseudoprime to the base. The… Read More »

## Largest and smallest digit of a number

Given a number N. The task is to find the largest and the smallest digit of the number. Examples : Input : N = 2346… Read More »

## Sum of all second largest divisors after splitting a number into one or more parts

Given an integer N( 2 <= N <= 10^9 ), split the number into one or more parts(possibly none), where each part must be greater… Read More »

## Count total set bits in all numbers from 1 to n | Set 2

Given a positive integer N, the task is to count the sum of the number of set bits in the binary representation of all the… Read More »