Skip to content

Latest commit

 

History

History

SumFct

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

perimeter of squares in a rectangle

codewars

The drawing shows 6 squares the sides of which have a length of 1, 1, 2, 3, 5, 8. It's easy to see that the sum of the perimeters of these squares is : 4 * (1 + 1 + 2 + 3 + 5 + 8) = 4 * 20 = 80

Could you give the sum of the perimeters of all the squares in a rectangle when there are n + 1 squares disposed in the same manner alternative text

Hint: See Fibonacci sequence

Ref: