Number Based Programs in Java
Armstrong Number Program in Java
Java Programs
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
Automorphic Number Program in Java
Java Programs
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
Buzz Number Program in Java
Java Programs
A number is said to be Buzz Number if it ends with 7 or is divisible by 7. Example: 1007 is a Buzz Number.
Circular Prime Program in Java
Java Programs
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.
CoPrime Numbers Program in Java
Java Programs
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.
Digit to Word Program in Java
Java Programs
import java.util.Scanner; public class DigitToWord { public static void main(String[] args) { // TODO code application logic here int r, […]
Duck Number Program in Java
Java Programs
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
Factorial Program in Java
Java Programs
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
Factors Program in Java
Java Programs
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.
Fibonacci Series Program in Java
Java Programs
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
Java Programs
Floyd Triangle Program in Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Greatest Common Divisor Program in Java
Java Programs
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.
Happy Number Program in Java
Java Programs
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.
Harshad Number Program in Java
Java Programs
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.
Least Common Multiple Program in Java
Java Programs
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.
Multiply Of Digit Program in Java
Java Programs
If a number=1234, then 1*2*3*4 ,Multiply of digit=24, Multiply Of Digit Program in Java
Neon Number Program in Java
Java Programs
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.
Niven Number Program in Java
Java Programs
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.
Palindrome Number Program in Java
Java Programs
A palindromic number is a number that remains the same when its digits are reversed. Like 16461, for example,
Perfect Number Program in Java
Java Programs
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.
Prime Number Program in Java
Java Programs
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.
Reverse Number Program in Java
Java Programs
If a number=1234, then reverse of number is 4321.
Special Number Program in Java
Java Programs
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.
Spy Number Program in Java
Java Programs
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.
Twin Prime Program in Java
Java Programs
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.
Twisted Prime Program in Java
Java Programs
A number is called a twisted prime number if it is a prime number and reverse of this number is also a prime number.
Unique Number Program in Java
Java Programs
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.
Disarium Number Program in Java
Java Programs
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
Tech Number Program in Java
Java Programs
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
Java Programs
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 Program in Java
Java Programs
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.
Pronic Number Program in Java
Java Programs
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
Ugly Number Program in Java
Java Programs
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.