Lucky Numbers in Java

Channel:
Subscribers:
1,540
Published on ● Video Link: https://www.youtube.com/watch?v=bI3yaKTA0aY



Duration: 13:57
239 views
8


Lucky Numbers in Java

Lucky numbers are a sequence of natural numbers that remain after removing second, third, fourth, fifth and so on numbers respectively from a sequence of consecutive natural numbers.

Consider the sequence of first 20 natural numbers:
Removing every second number produces the sequence: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19
Next removing every third number produces the sequence: 1, 3, 7, 9, 13, 15, 19
Next removing every fourth number produces the sequence: 1, 3, 7, 13, 15, 19
Further deleting every fifth number we get the sequence: 1, 3, 7, 13, 19

Deletion of every sixth number is not possible and the five numbers that are lucky to escape deletion remain indefinitely.







Tags:
robin sir
lucky numbers program in java
lucky number java program
check whether a number is a lucky number or not
isc
computer science
java
sample question paper
practical question paper