Identify the logic behind the series 6 28 66 120 190 276…. The numbers in the series should be used to create a Pyramid. The base of the Pyramid will be the widest and will start converging towards the top where there will only be one element. Each successive layer will have one number less than that on the layer below it. The width of the Pyramid is specified by an input parameter N. In other words there will be N numbers on the bottom layer of the pyramid.

By
In

Example

If input is 2, output will be

00006

00028 00066

If input is 3, output will be

00006

00028 00066

00120 00190 00276

3 answers

Staff July 29, 2016

6  + (6+16=22) 22 = 28
28 +(22+16 =38) 38 = 66
66 + (38+16 =54) 54 = 120
120 +(54+16 = 70) 70 = 190
190 + (70 + 16 = 86) 86 = 276
Note: 16 is the key value
 

#1
  1. can anyone give the code for it
Staff July 30, 2016

I have given only the logic try to implement in program ……..
y=6;
x=6;
print the value of x
Place the below lines in loop so that the process gets repeated
x=x+16;
z=y+x;
print the value of z
y=z;

#2

can u give code for it
 

#3

Please login or Register to Submit Answer