aneeshlalwani / number-programs-in-java

This Repository contains a "Number Program". These programs are solved in "Java"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Number Programs in Java

1. Factorial of Number

A factorial is a mathematical function, which is applied to a non-negative integer. For a given positive integer "n," the factorial is the product of all positive integers less than or equal to "n."

2. Larget Among N Digits

An array of integer is provided, from that program would find a largest number among the elements of an array.

3. Prime Number

A prime number is a number that is divisible only by 1 and itself. For example: 5 is a prime number as it is divisible by 1 and 5, and 6 is not a prime number as it is divisible by 1,2,3, and 6.

There are two progams of prime numbers with different logic in this repository

  PrimeNumberLogicOne.java and PrimeNumberLogicTwo.java 

4. Palindrome String

A palindrome is a sequence of characters that reads the same forward as backward, disregarding spaces, punctuation, and capitalization. In other words, a palindrome remains unchanged when its characters are reversed. For example "level", "civic", "radar"

5. Fibonacci Series

The Fibonacci series is a sequence of numbers in which each number (Fibonacci number) is the sum of the two preceding ones, usually starting with 0 and 1. The sequence goes: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on.

6. Pascal Triangle

Pascal's Triangle is a mathematical arrangement of numbers named after the French mathematician Blaise Pascal. It starts with a single number 1 at the top, and each subsequent row is constructed by summing up the two numbers directly above a particular number in the row.

7. Leap Year

A leap year is a year with an extra day, February 29, occurring every four years to synchronize the calendar with the Earth's orbit around the sun. Example: 2024 is a leap year, because It contains a february 29, and 2023 is NOT a leap year, because It does not contain a February 29.

8. Perfect Number

A perfect number is a positive integer equal to the sum of its divisors, excluding itself. For instance, 28 is a perfect number because 1 + 2 + 4 + 7 + 14 = 28.

9. ArmStrong Number

An Armstrong number, also known as a narcissistic number, is a special type of integer. It is equal to the sum of its own digits, each raised to the power of the number of digits. For example, let's consider the number 153: 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153. 153 is an Armstrong number because the sum of the cubes of its digits equals the number itself.

10. Strong Number

A strong number, also known as a digital factorial, is a number whose sum of factorial digits equals the number itself. In general, if a number 'n' is a strong number, the sum of the factorials of its digits will be equal to 'n'. For example, let's consider the number 145: 1! + 4! + 5! = 1 + 24 + 120 = 145. Hence 145 is a Strong Number.

11. Neon Number

A neon number is a number where the sum of digits of square of the number is equal to the number itself. For Example: 9 is a neon number. It's square is 9 * 9 = 81, and sum of the digits 8 + 1 = 9 1 is also a neon number NOTE: Except 1 and 9 there are no more neon numbers between 1 and n.

12. Automorphic Number

An automorphic number is a number whose square ends in the same digits as the number itself. for example: 5, 6, 25 are automorphic numbers. 5 * 5 = 25 --> last digit is 5, 6 * 6 = 36 --> last digit is 6, 25 * 25 = 625 --> last digit is 25

About

This Repository contains a "Number Program". These programs are solved in "Java"


Languages

Language:Java 100.0%