Home » Find the Sum of the Series

Find the Sum of the Series

Find the Sum of the Series – 1*2*3 + 2*3*4 + 3*4*5+…..+N*(N+1)*(N+2) Hence, if N = 4 Then 1*2*3 + 2*3*4 + 3*4*5 + 4*5*6 = 210 For N = 8 1*2*3 + 2*3*4 + 3*4*5 + 4*5*6 + 5*6*7 + 6*7*8 + 7*8*9 + 8*9*10 = 1980

📌 Challenge Details and Links
ExcelBI Excel Challenge Number: 318
Challenge Difficulty: ⭐️
📥Download Sample File
📥Link to the solutions on LinkedIn

Solving the challenge of Find the Sum of the Series with Power Query

Power Query solution 1 for Find the Sum of the Series, proposed by Zoran Milokanović:
let
  Source = Excel.CurrentWorkbook(){[Name = "Input"]}[Content], 
  S = Table.TransformRows(
    Source, 
    each List.Accumulate({1 .. [N]}, 0, (s, c) => s + List.Product({c .. c + 2}))
  )
in
  S
Power Query solution 2 for Find the Sum of the Series, proposed by Aditya Kumar Darak 🇮🇳:
let
  Source = Excel.CurrentWorkbook(){[Name = "data"]}[Content], 
  Return = Table.AddColumn(Source, "Answer1", each Number.Combinations([N] + 3, 4) * 6)
in
  Return
Power Query solution 3 for Find the Sum of the Series, proposed by Alejandro Simón 🇵🇦 🇪🇸:
let
  Source = Excel.CurrentWorkbook(){[Name = "Table1"]}[Content], 
  Sol = Table.AddColumn(
    Source, 
    "Answer", 
    each List.Sum(List.Transform({1 .. [N]}, each List.Product({_, _ + 1, _ + 2})))
  )[[Answer]]
in
  Sol
Power Query solution 4 for Find the Sum of the Series, proposed by Luan Rodrigues:
let
  Fonte = Tabela1, 
  res = Table.AddColumn(
    Fonte, 
    "Personalizar", 
    each [
      a = {List.FirstN({1 .. [N]}, 3)}
        & List.Select(
          List.Transform(
            {1 .. [N] + 2}, 
            (x) => List.FirstN(List.RemoveFirstN({1 .. [N] + 2}, x), 3)
          ), 
          each List.Count(_) = 3
        ), 
      b = List.Sum(List.Transform(a, List.Product))
    ][b]
  )
in
  res
Power Query solution 5 for Find the Sum of the Series, proposed by Rafael González B.:
let
 Source = Excel.CurrentWorkbook(){0}[Content],
 Result = Table.AddColumn(Source, "Answer", each 
 let
 n = [N],
 L = List.Generate(
 () => [C = 1, LD = 0],
 each [C] <= n + 1,
 each [C = [C] + 1,
 L1 = {[C].. [C] + 2},
 LD = List.Product(L1)
 ],
 each [LD]
 ),
 S = List.Sum(L)
 in
 S, Int64.Type)[[Answer]]
in
 Result
🧙‍♂️🧙‍♂️🧙‍♂️
                    
                  
          

Solving the challenge of Find the Sum of the Series with Excel

Excel solution 1 for Find the Sum of the Series, proposed by Bo Rydobon 🇹🇭:
=INDEX(
    SCAN(
        ,
        EXP(
            MMULT(
                LN(
                    SEQUENCE(
                        999
                    )+{0,
                    1,
                    2}
                ),
                {1;1;1}
            )
        ),
        LAMBDA(
            a,
            v,
            a+v
        )
    ),
    A2:A10
)
Excel solution 2 for Find the Sum of the Series, proposed by Rick Rothstein:
=MAP(A2:A10,
    LAMBDA(x,
    REDUCE(0,
    SEQUENCE(
        x
    ),
    LAMBDA(a,
    n,
    a+n*(n+1)*(n+2)))))
Excel solution 3 for Find the Sum of the Series, proposed by Rick Rothstein:
=LET(f,
    LAMBDA(n,
    n*(n+1)*(n+2)),
    MAP(
        A2:A10,
        LAMBDA(
            x,
            SUM(
                f(
                    SEQUENCE(
                        x
                    )
                )
            )
        )
    ))
Excel solution 4 for Find the Sum of the Series, proposed by John V.:
=MAP(A2:A10,
    LAMBDA(x,
    LET(s,
    SEQUENCE(
        x
    ),
    SUM(s*(s+1)*(s+2)))))
Excel solution 5 for Find the Sum of the Series, proposed by محمد حلمي:
=MAP(
    A2:A10,
    LAMBDA(
        a,
        SUM(
            BYROW(
                
                SEQUENCE(
                    a
                )+{0,
                1,
                2},
                LAMBDA(
                    b,
                    PRODUCT(
                        b
                    )
                )
            )
        )
    )
)
Excel solution 6 for Find the Sum of the Series, proposed by Kris Jaganah:
=MAP(
    A2:A10,
    LAMBDA(
        x,
        LET(
            a,
            SEQUENCE(
                x
            ),
            SUMPRODUCT(
                a,
                a+1,
                a+2
            )
        )
    )
)
Excel solution 7 for Find the Sum of the Series, proposed by Julian Poeltl:
=MAP(A2:A10,
    LAMBDA(A,
    SUM(MAP(SEQUENCE(
        A
    ),
    LAMBDA(A,
    PRODUCT(A*(A+1)*(A+2)))))))
Excel solution 8 for Find the Sum of the Series, proposed by Timothée BLIOT:
=MAP(A2:A10,
    LAMBDA(N,
     LET(S,
     SEQUENCE(
         N
     ),
     SUM(S*(S+1)*(S+2)))))
Excel solution 9 for Find the Sum of the Series, proposed by Hussein SATOUR:
=MAP(
    A2:A10,
     LAMBDA(
         x,
          SUM(
              SEQUENCE(
                  x
              ) * SEQUENCE(
                  x,
                  ,
                  2
              ) * SEQUENCE(
                  x,
                  ,
                  3
              )
          )
     )
)
Excel solution 10 for Find the Sum of the Series, proposed by Sunny Baggu:
=MAP(
    
     A2:A10,
    
     LAMBDA(
         x,
          SUM(
              BYROW(
                  SEQUENCE(
                      x
                  ) + {0,
                   1,
                   2},
                   LAMBDA(
                       a,
                        PRODUCT(
                            a
                        )
                   )
              )
          )
     )
    
)
Excel solution 11 for Find the Sum of the Series, proposed by LEONARD OCHEA 🇷🇴:
=MAP(A2:A10;
    LAMBDA(a;
    LET(s;
    SEQUENCE(
        a
    );
    MMULT(TOROW(
        s
    );
    (s+1)*(s+2)))))
Excel solution 12 for Find the Sum of the Series, proposed by LEONARD OCHEA 🇷🇴:
=MMULT(
    A2:A10^{1,2,3,4},{6;
    11;
    6;
    1}/4
)
Excel solution 13 for Find the Sum of the Series, proposed by Abdallah Ally:
=MAP(
    A2:A10,
    LAMBDA(
        v,
        REDUCE(
            0,
            SEQUENCE(
                v
            ),
            LAMBDA(
                x,
                y,
                x+PRODUCT(
                    SEQUENCE(
                        3,
                        ,
                        y
                    )
                )
            )
        )
    )
)
Excel solution 14 for Find the Sum of the Series, proposed by Md. Zohurul Islam:
=MAP(
    A2:A10,
    LAMBDA(
        x,
        SUM(
            BYROW(
                SEQUENCE(
                    x
                )+SEQUENCE(
                    ,
                    3,
                    0
                ),
                PRODUCT
            )
        )
    )
)
Excel solution 15 for Find the Sum of the Series, proposed by Md. Zohurul Islam:
=MAP(
    A2:A10,
    LAMBDA(
        x,
        LET(
            
            a,
            SEQUENCE(
                x+2
            ),
            
            u,
            DROP(
                a,
                2
            ),
            
            v,
            SEQUENCE(
                x
            )-1,
            
            w,
            SUM(
                MAP(
                    u,
                    v,
                    LAMBDA(
                        x,
                        y,
                        PRODUCT(
                            DROP(
                                TAKE(
                                    a,
                                    x
                                ),
                                y
                            )
                        )
                    )
                )
            ),
            
            w
        )
    )
)
Excel solution 16 for Find the Sum of the Series, proposed by Charles Roldan:
=MAP(A2:A10,LAMBDA(x,SUM(PERMUT(SEQUENCE(x)+2,3))))
Excel solution 17 for Find the Sum of the Series, proposed by Albert Cid Cañigueral:
=REDUCE(;
    MAP(SECUENCIA(
        A2
    );
    LAMBDA(paE;
    paE*(paE+1)*(paE+2)));
    LAMBDA(
        paA;
        paE;
        paA+paE
    ))
Excel solution 18 for Find the Sum of the Series, proposed by Pieter de Bruijn:
=MAP(
    A2:A10,
    LAMBDA(
        a,
        REDUCE(
            0,
            SEQUENCE(
                a
            ),
            LAMBDA(
                b,
                c,
                b+PRODUCT(
                    c+{0,
                    1,
                    2}
                )
            )
        )
    )
)
Excel solution 19 for Find the Sum of the Series, proposed by Nicolas Micot:
=MAP(A2:A10;LAMBDA(N;REDUCE(0;SEQUENCE(N);LAMBDA(l_val;l_seq;l_val+PRODUIT(l_seq;l_seq+1;l_seq+2)))))
Excel solution 20 for Find the Sum of the Series, proposed by Giorgi Goderdzishvili:
=LET(
    
    N_,
    A2,
    
    sm,
     MAKEARRAY(
         3,
         N_,
         LAMBDA(
             r,
             c,
              c+r-1
         )
     ),
    
    bc,
     BYCOL(
         sm,
         LAMBDA(
             x,
             PRODUCT(
                 x
             )
         )
     ),
    
    SUM(
        bc
    )
)
Excel solution 21 for Find the Sum of the Series, proposed by Edwin Tisnado:
=LET(n,
    A2:A10,
    n*(n+1)*(n+2)*(n+3)/4)

=MAP(
    A2:A10,
    LAMBDA(
        x,
        SERIESSUM(
            x,
            1,
            1,
            {6,
            11,
            6,
            1}
        )/4
    )
)
Excel solution 22 for Find the Sum of the Series, proposed by Abdelrahman Omer, MBA, PMP:
=BYROW(A2:A10,LAMBDA(a,SUM(SEQUENCE(a)*SEQUENCE(a,,2)*SEQUENCE(a,,3))))
Excel solution 23 for Find the Sum of the Series, proposed by Diarmuid Early:
=LET(N,
    A2:A10,
    N*(N+1)*(N^2+5*N+6)/4)
Excel solution 24 for Find the Sum of the Series, proposed by Amardeep Singh:
=MAP(A2:A10,
    LAMBDA(m,
    LET(n,
    SEQUENCE(
        m
    ),
    SUM(n*(n+1)*(n+2)))))
Excel solution 25 for Find the Sum of the Series, proposed by Hazem Hassan:
=MAP(
    A2:A10,
    LAMBDA(
        Y,
        LET(
            a,
            SEQUENCE(
                Y
            ),
            
            SUM(
                BYROW(
                    HSTACK(
                        a,
                        a+1,
                        a+2
                    ),
                    LAMBDA(
                        X,
                        PRODUCT(
                            X
                        )
                    )
                )
            )
        )
    )
)
Excel solution 26 for Find the Sum of the Series, proposed by Agah Dikici:
=MAP(
    A2:A10,
    LAMBDA(
        x,
        LET(
            y,
            SEQUENCE(
                x
            ),
            SUMPRODUCT(
                y,
                y+1,
                y+2
            )
        )
    )
)

Solving the challenge of Find the Sum of the Series with Python in Excel

Python in Excel solution 1 for Find the Sum of the Series, proposed by John V.:
Hi everyone!
In consequence, in Excel could be too:
Blessings!
                    
                  

Solving the challenge of& Find the Sum of the Series with R

R solution 1 for Find the Sum of the Series, proposed by Konrad Gryczan, PhD:
library(tidyverse)
library(readxl)
input = read_excel("Sum of Series.xlsx", range = "A1:A10")
test = read_excel("Sum of Series.xlsx", range = "B1:B10")
sum_of_products = function(N) {
 sum(map_dbl(1:N, ~ .x * (.x + 1) * (.x + 2)))
}
result = input %>%
 mutate(result = map_dbl(.$N,sum_of_products))
identical(result$result, test$`Expected Answer`)
#> [1] TRUE
                    
                  

Solving the challenge of Find the Sum of the Series with Excel VBA

Excel VBA solution 1 for Find the Sum of the Series, proposed by Vasin Nilyok:
VBA
Sub SumofSeries()
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
For r = 2 To LastRow
 n = Cells(r, 1)
 i = 0
 For ii = 1 To n
 nTimes = ii * (ii + 1) * (ii + 2)
 i = i + nTimes
 Next
Cells(r, 3) = i
Next r
End Sub
                    
                  
Excel VBA solution 2 for Find the Sum of the Series, proposed by Nicolas Micot:
with VBA:
Function f_challenge318(N As Variant) As Variant
Dim reponse As Variant
reponse = 0
For i = 1 To N
 reponse = reponse + i * (i + 1) * (i + 2)
Next i
f_challenge318 = reponse
End Function
                    
                  

Solving the challenge of Find the Sum of the Series with DAX

DAX solution 1 for Find the Sum of the Series, proposed by Zoran Milokanović:
Expected Answer = SUMX(GENERATESERIES(1, Input[N]), [Value] * ([Value] + 1) * ([Value] + 2))

&&

Leave a Reply