Search This Blog

Thursday, July 9, 2026

Technical Training

Week1 (09-07-2026)Number-Based Problems

1. Spy Number: check if the sum of digits equals the product of digits for a given number. Print all Spy numbers up to N.

2.Magic Number: a number is Magic if recursively summing its digits yields 1. Check if N is a Magic number.

3.Happy Number: repeatedly replace N with the sum of squares of its digits. Detect if N eventually reaches 1.

4.Perfect Number: a number equals the sum of its proper divisors. Find all Perfect numbers up to N.

5.Perfect Square: check if a number is a perfect square without using sqrt().

6.Neon Number: the sum of digits of N-squared equals N itself (e.g. 9: 9²=81, 8+1=9). Find all Neon numbers in [1, 1000].

7.Buzz Number: a number divisible by 7 or ending in 7. Print all Buzz numbers in a given range [L, R].

8.Tribonacci Series: generate first N terms where T(n) = T(n-1)+T(n-2)+T(n-3). Also generate the Padovan and Jacobsthal series.

9 Krishnamurthi / Strong Number: sum of factorials of digits equals the number. Find all Strong numbers up to N.

10 Evil Number: numbers whose binary has an even number of 1-bits. In range [L,R] count how many are Evil vs Odious. Also identify Strobo-strategic numbers in the same range.


11 Pronic Number: product of two consecutive integers. Find all Pronic numbers in [1, N]. 


12 Unique Number: no digit repeats. Print all unique 3-digit numbers (100–999). 


13 Nelson Number (111): check if N is 111 or a multiple pattern. Generalise: find all repunit numbers up to N.


14 Peterson Number: equals the sum of factorials of its digits raised to the power of their 1-based position. Check if N is a Peterson number.


15 Given a range [L, R], find all numbers that are simultaneously a Perfect Square AND a Perfect number.


Week2 (16-07-2026) Bit Manipulation

1 Convert a given decimal number to its binary equivalent without using bin(). 

2 Convert a given binary number (as string) to its decimal equivalent without using int(). 

3 Detect whether two given integers have opposite signs without using conditional operators. 

4 Add 1 to a given integer using only bit manipulation — no arithmetic operators allowed. 

5 Swap two integers without a temporary variable using XOR. 

6 Given a number N and position K, turn the K-th bit ON; also write a variant to turn it OFF. 

7 Given a number, check whether its binary representation is a palindrome.

8 Check whether a given number is a power of 2 using a single bitwise expression. 

9 Count the number of set bits in a number using Brian Kernighan's Algorithm (n &= n-1). 

10 Check whether a given number is a power of 4 using bit manipulation — no loops or

recursion.

11 Find the single non-duplicate in an array where every other element appears exactly twice,

using XOR.

12 Find the number of bits that must be flipped to convert integer A to integer B. 

13 Reverse the bits of a given 32-bit unsigned integer. 

14 Find the missing number in array [0..n] using XOR (no sum formula). 

15 Swap all odd-positioned and even-positioned bits of a 32-bit integer using bit manipulation. 

Technical Training

Week1 (09-07-202 6) Number-Based Problems 1. Spy Number: check if the sum of digits equals the product of digits for a given number. Print a...