Number Based Programs in Java

    Armstrong Number is a positive number if it is equal to the sum of cubes of its digits is called Armstrong number and if its sum is not equal to the number then its not a Armstrong number. Armstrong Number Program is very popular in java, c language, python etc. Examples: 153 is Armstrong, (1*1*1)+(5*5*5)+(3*3*3) = 153

    An Automorphic number is a number whose square “ends” in the same digits as the number itself. Examples: 5*5 = 25, 6*6 = 36, 25*25 = 625

    A number is said to be Buzz Number if it ends with 7 or is divisible by 7. Example: 1007 is a Buzz Number.


    A circular prime is a prime number with the property that the number generated at each intermediate step when cyclically permuting its digits will be prime. For example, 1193 is a circular prime, since 1931, 9311 and 3119 all are also prime.

    Two integers a and b are said to be relatively prime, mutually prime, or coprime if the only positive integer that divides both of them is 1. Example: 13 and 15 are co prime.

    import java.util.Scanner; public class DigitToWord { public static void main(String[] args) { // TODO code application logic here int r, […]

    A Duck number is a number which has zeroes present in it, but there should be no zero present in the beginning of the number. For example 3210


    A Duck number is a number which has zeroes present in it, but there should be no zero present in the beginning of the number. For example 3210

    Factor a number or algebraic expression that divides another number or expression evenly—i.e., with no remainder. For example, 3 and 6 are factors of 12 because 12 ÷ 3 = 4 exactly and 12 ÷ 6 = 2 exactly. The other factors of 12 are 1, 2, 4, and 12. Factors of 12: 1, 2, 3, 4, 6, 8, 12.

    A series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 0, 1, 1, 2, 3, 5, 8, etc.

    Floyd Triangle Program in Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

    the greatest common divisor (gcd) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For example, the gcd of 8 and 12 is 4.

    A happy number is a natural number in a given number base that eventually reaches 1 when iterated over the perfect digital invariant function for. Those numbers that do not end in 1 are -unhappy numbers.

    In mathematics, a harshad number (or Niven number) in a given number base is an integer that is divisible by the sum of its digits when written in that base.

    The least common multiple, lowest common multiple, or smallest common multiple of two integers a and b, usually denoted by LCM(a, b), is the smallest positive integer that is divisible by both a and b.

    If a number=1234, then 1*2*3*4 ,Multiply of digit=24, Multiply Of Digit Program in Java

    A neon number is a number where the sum of digits of square of the number is equal to the number. For example if the input number is 9, its square is 9*9 = 81 and sum of the digits is 9. i.e. 9 is a neon number.

    In mathematics, a Niven number (or harshad number) in a given number base is an integer that is divisible by the sum of its digits when written in that base.

    A palindromic number is a number that remains the same when its digits are reversed. Like 16461, for example,

    A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6 has divisors 1, 2 and 3, and 1 + 2 + 3 = 6, so 6 is a perfect number.

    A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways of writing it as a product, 1 × 5 or 5 × 1, involve 5 itself.

    If a number=1234, then reverse of number is 4321.

    A number is said to be special number when the sum of factorial of its digits is equal to the number itself. Example- 145 is a Special Number as 1!+4!+5!=145.

    A spy number is a number where the sum of its digits equals the product of its digits. For example, 1124 is a spy number, the sum of its digits is 1+1+2+4=8 and the product of its digits is 1*1*2*4=8.

    A twin prime is a prime number that is either 2 less or 2 more than another prime number—for example, either member of the twin prime pair (41, 43). In other words, a twin prime is a prime that has a prime gap of two.

    A number is called a twisted prime number if it is a prime number and reverse of this number is also a prime number.

    A number is said to be unique , if the digits in it are not repeated. for example, 12345 is a unique number. 123445 is not a unique number.

    A number is called Disarium number if the sum of its power of the positions from left to right is equal to the number. Example: 1 + 3*3 + 5*5*5 = 1 + 9 + 125 = 135

    A tech number can be tech number if its digits are even and the number of digits split into two number from middle then add these number if the added number’s square would be the same with the number it will called a Tech Number. If the number is split in two equal halves,then the square of sum of these halves is equal to the number itself. Write a program to generate and print all four digits tech numbers. Note: If number of digits is not even then it is not a tech number.

    Prime Number Up to N Terms Program in Java. Ex: Enter size of prime=5 Number is prime=2 Number is prime=3 Number is prime=5 Number is prime=7 Number is prime=11 Number is prime=13

    Magic number is the if the sum of its digits recursively are calculated till a single digit If the single digit is 1 then the number is a magic number. Magic number is very similar with Happy Number.

    A number is said to be a pronic number if product of two consecutive integers is equal to the number, is called a pronic number. Example- 42 is said to be a pronic number, 42=6×7, here 6 and 7 are consecutive integers

    A number is said to be an Ugly number if positive numbers whose prime factors only include 2, 3, 5. For example, 6(2×3), 8(2x2x2), 15(3×5) are ugly numbers while 14(2×7) is not ugly since it includes another prime factor 7. Note that 1 is typically treated as an ugly number.