code for Fibonacci series in Appian

How to create a code for Fibonacci series in Appian

  Discussion posts and replies are publicly visible

Parents
  • DSAA_FibonacciSeries
    --------------------------------
    a!localVariables(
      local!input:ri!input,
      local!result:a!forEach(
        items: enumerate(ri!input),
        expression: rule!DSAA_calculateFibSeries(fv!item)
      ),
      local!result
    )
    
    
    -------------------
    DSAA_calculateFibSeries
    --------------------------
    if(
      ri!numTimes <= 2,
      1,
      sum(rule!DSAA_calculateFibSeries(numTimes: ri!numTimes - 2),
        rule!DSAA_calculateFibSeries(
          numTimes: ri!numTimes-1
        ))
    )

Reply
  • DSAA_FibonacciSeries
    --------------------------------
    a!localVariables(
      local!input:ri!input,
      local!result:a!forEach(
        items: enumerate(ri!input),
        expression: rule!DSAA_calculateFibSeries(fv!item)
      ),
      local!result
    )
    
    
    -------------------
    DSAA_calculateFibSeries
    --------------------------
    if(
      ri!numTimes <= 2,
      1,
      sum(rule!DSAA_calculateFibSeries(numTimes: ri!numTimes - 2),
        rule!DSAA_calculateFibSeries(
          numTimes: ri!numTimes-1
        ))
    )

Children
No Data