Assignment 2:
Consider the sequence of natural numbers
1, 2, 3, 4, 5, 6, 7 ………………………….
Removing every second number produces the sequence
1, 3, 5, 7, 9, 11, 13, 15, 17 ………………………….
This process continues indefinitely by removing the fourth, fifth …... and so on, till after a fixed number of steps, certain natural numbers remain indefinitely. These are known as lucky numbers. Write a java program to generate and print lucky numbers less than a given number N < 50.
SAMPLE INPUT : N = 25
OUTPUT :
THE LUCKY NUMBERS LESS THAN 25 ARE:
1 3 7 13 19
Answers
Answered by
0
Answer:
please ask to google........ .......
Similar questions