Lucky Numbers in Java | ISC Computer Science 2024 Practical
1.4 هزار بار بازدید -
9 ماه پیش
-
Lucky Numbers in Java |
Lucky Numbers in Java | ISC Computer Science 2024 Practical
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.
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.
9 ماه پیش
در تاریخ 1402/08/06 منتشر شده
است.
1,442
بـار بازدید شده