DEV Community

vimala jeyakumar
vimala jeyakumar

Posted on

2

Number Series

Task:

1 . Look at this series: 58, 52, 46, 40, 34, ... What number should come next?
26

28

30

32
Ans:
The series is decreasing by 6 each time:

58 - 6 = 52
52 - 6 = 46
46 - 6 = 40
40 - 6 = 34

So, continuing the pattern, 34 - 6 = 28.

The next number in the series is 28.

Program:

package day1if;

public class Numberseries1 
{
public static void main (String args[])
{
    int no = 58;
    int count = 1;
    while( count<=5)
    {
        System.out.println(no);
        no = no-6;
        count = count+ 1;

    }
}
}

Enter fullscreen mode Exit fullscreen mode

output:
58
52
46
40
34
28

2.Look at this series: 3, 4, 7, 8, 11, 12, ... What number should come next?
7

10

14

15
Ans:
Let’s look at the pattern:

3 → 4 (add 1)
4 → 7 (add 3)
7 → 8 (add 1)
8 → 11 (add 3)
11 → 12 (add 1)

It looks like the pattern alternates between adding 1 and adding 3.

Following this pattern, the next step is to add 3 to 12, so:

12 + 3 = 15

The next number in the series is 15.

Program:

package day1if;

public class Numberseries2 {

    public static void main(String[] args) {
        int no = 3;
        int count =1;
        while( count<=7)
        {
            System.out.println(no);
            no = no+1;
            System.out.println(no);
            no = no+3;
            count = count+2;
        }
    }
}

Enter fullscreen mode Exit fullscreen mode

output:
3
4
7
8
11
12
15
16

3.Look at this series: 31, 29, 24, 22, 17, ... What number should come next?
15

14

13

12
Ans:
Let’s examine the pattern:

31 → 29 (subtract 2)
29 → 24 (subtract 5)
24 → 22 (subtract 2)
22 → 17 (subtract 5)

The pattern alternates between subtracting 2 and subtracting 5.

So, following this pattern, the next step is to subtract 2 from 17:

17 - 2 = 15

The next number in the series is 15.

Program:

package day1if;

public class Numberseries3 {

    public static void main(String[] args) 
    {

        int no = 31;
        int count =0;
        while( count<=5)
        {
            System.out.println(no);
            no = no-2;
            System.out.println(no);
            no = no-5;
            count = count+2;
        }


    }

}
Enter fullscreen mode Exit fullscreen mode

output:
31
29
24
22
17
15

4.Look at this series: 1.5, 2.3, 3.1, 3.9, ... What number should come next?
4.2

4.4

4.7

5.1
Ans:
Let’s examine the differences between the numbers in the series:

2.3 - 1.5 = 0.8
3.1 - 2.3 = 0.8
3.9 - 3.1 = 0.8

It looks like the series increases by 0.8 each time. So, to find the next number:

3.9 + 0.8 = 4.7

The next number in the series is 4.7.

Program:

package day1if;

public class Numberseries4 {

    public static void main(String[] args)
    {
        float no = 1.5f;
        int count  = 1;
        while (count<6)
        {
            System.out.println(no);
             no = no + 0.8f; 
             count = count+1;
        }
    }

}
Enter fullscreen mode Exit fullscreen mode

Output:
1.5
2.3
3.1
3.8999999
4.7

5.Look at this series: 201, 202, 204, 207, ... What number should come next?
205

208

210

211
Ans:
Let’s look at the differences between the numbers:

202 - 201 = 1
204 - 202 = 2
207 - 204 = 3

It seems the series is increasing by 1, 2, 3, and so on.

Following this pattern, the next difference should be 4. So:

207 + 4 = 211

The next number in the series is 211.

Program:

package day1if;

public class Numberseries5 
{
    public static void main(String[] args)
    {
        int no = 201;
        int count = 1;
        while( count<6)
        {
            System.out.println(no);
            no = no+1;
            System.out.println(no);
            no = no+2;
            System.out.println(no);
            no=no+3;
            System.out.println(no);
            no=no+4;
            count = count+4;
        }
    }

}


Enter fullscreen mode Exit fullscreen mode

Output:
204
207
211
212
214
217

6.Look at this series: 2, 6, 18, 54, ... What number should come next?
108

148

162

216
Ans:
The pattern in the series appears to be multiplying each term by 3:

2 × 3 = 6
6 × 3 = 18
18 × 3 = 54

So, to find the next number, we multiply 54 by 3:

54 × 3 = 162

Thus, the next number in the series is 162.

Program:

package day1if;

public class Numberseries6 
{
    public static void main(String[] args)
    {
        int no =2;
        int count = 1;
        while( count<6)
        {
            System.out.println(no);
            no = no*3;
            count = count+1;
        }

}
    }

Enter fullscreen mode Exit fullscreen mode

Output:
2
6
18
54
162

7.Look at this series: 5.2, 4.8, 4.4, 4, ... What number should come next?
3

3.3

3.5

3.6
Ans:
The pattern in this series appears to be decreasing by 0.4 each time:

5.2 - 0.4 = 4.8
4.8 - 0.4 = 4.4
4.4 - 0.4 = 4

So, to find the next number, we subtract 0.4 from 4:

4 - 0.4 = 3.6

Thus, the next number in the series is 3.6.

Program:

package day1if;

public class Numberseries7
{
    public static void main(String[] args)
    {
        float no =5.2f;
        int count = 1;
        while( count<6)
        {
            System.out.println(no);
            no = no-0.4f;
            count = count+1;
        }

}
}
Enter fullscreen mode Exit fullscreen mode

Output:
5.2
4.7999997
4.3999996
3.9999995
3.5999994

8.Look at this series: 2, 4, 6, 8, 10, ... What number should come next?
11

12

13

14
Ans:
The pattern in this series is increasing by 2 each time:

2 + 2 = 4
4 + 2 = 6
6 + 2 = 8
8 + 2 = 10

So, to find the next number, we add 2 to 10:

10 + 2 = 12

Thus, the next number in the series is 12.

Program:

package day1if;

public class Numberseries8 {

    public static void main(String[] args) 
    {
        int no =2;
        int count = 0;
        while( count<6)
        {
            System.out.println(no);
            no = no+2;
            count = count+1;
        }

    }

}

Enter fullscreen mode Exit fullscreen mode

Output:
2
4
6
8
10
12

9.Look at this series: 36, 34, 30, 28, 24, ... What number should come next?
20

22

23

26
Ans:
The pattern in this series alternates between subtracting 2 and subtracting 4:

36 - 2 = 34
34 - 4 = 30

30 - 2 = 28
28 - 4 = 24

To find the next number, we subtract 2 from 24:

24 - 2 = 22

Thus, the next number in the series is 22.

Program:

package day1if;

public class Numberseries9 {

    public static void main(String[] args)
    {
        int no =36;
        int count = 0;
        while( count<6)
        {
            System.out.println(no);
            no = no-2;
            System.out.println(no);
            no = no-4;
            count = count+2;
        }



    }

}

Enter fullscreen mode Exit fullscreen mode

Output:
36
34
30
28
24
22

10.Look at this series: 22, 21, 23, 22, 24, 23, ... What number should come next?
22

24

25

26

Ans:
The pattern in this series alternates between subtracting 1 and adding 2:

22 - 1 = 21
21 + 2 = 23
23 - 1 = 22
22 + 2 = 24
24 - 1 = 23

So, the next step should be adding 2 to 23:

23 + 2 = 25

Thus, the next number in the series is 25.

Program:

package day1if;

public class Numberseries10 
{

    public static void main(String[] args) 
    {
        int no =22;
        int count = 0;
        while( count<7)
        {
            System.out.println(no);
            no = no-1;
            System.out.println(no);
            no = no+2;
            count = count+2;
        }


    }

}

Enter fullscreen mode Exit fullscreen mode

Output:
22
21
23
22
24
23
25
24

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo 📊✨

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

DEV is better (more customized, reading settings like dark mode etc) when you're signed in!

Okay