13/23

Display Every 100th Number from 1 to n

Easy

Given an integer n, generate a list of numbers from 1 to n, and return only the numbers that occur at every 100th position (i.e., 100, 200, 300, ...) up to n.


Example :

Input:
ri!n = 500

Output:
{100, 200, 300, 400, 500}


ri! Rule Inputs

ri!nNumber (Integer)
1000

Example 1 — Case 1

Input: ri!n
500
Output:
{
  100,
  200,
  300,
  400,
  500
}

Example 2 — Case 2

Input: ri!n
1300
Output:
{
  100,
  200,
  300,
  400,
  500,
  600,
  700,
  800,
  900,
  1000,
  1100,
  1200,
  1300
}

Example 3 — Case 3

Input: ri!n
1421
Output:
{
  100,
  200,
  300,
  400,
  500,
  600,
  700,
  800,
  900,
  1000,
  1100,
  1200,
  1300,
  1400
}

Appian Expression Tips

  • • Use ri!variableName for rule inputs
  • • Use a!localVariables(local!x: …, body) for locals
  • • Use a!forEach(items: …, expression: fv!item) to iterate
  • • Use where() / reject(fn!isnull, list) to filter