Skip to main content
Question

How do you generate all numbers divisible by 13 between 1 and 100 in Appian?

A
Anonymous
December 30, 2025

Answer

Appian Code:

reject(
fn!isnull,
a!forEach(
items: enumerate(100) + 1,
expression: { if(mod(fv!item, 13) = 0, fv!item, null()) }
)
)


Explanation

Above appian expression returns every number from 1 to 100 that is divisible by 13. It builds the list, tests each number, and drops the ones that fail.


1. Generate the numbers

enumerate(100) + 1

enumerate(100) returns the integers 0 to 99. Adding 1 moves the list to 1 to 100.


2. Loop over the list

a!forEach(
items: enumerate(100) + 1,
expression: ...
)

a!forEach() runs the expression once for each number in the list, and fv!item is the current number.


3. Test for divisibility

mod(fv!item, 13) = 0

mod() returns the remainder after division. A remainder of 0 means the number divides evenly by 13.


4. Keep matches, null out the rest

if(
mod(fv!item, 13) = 0,
fv!item,
null()
)

A number divisible by 13 is returned as is. Any other number becomes null().


5. Remove the nulls

reject(fn!isnull, ...)

reject() drops every value that passes the fn!isnull test, so only the numbers divisible by 13 remain.



Output:

{13, 26, 39, 52, 65, 78, 91}


Solution 2 - Find Numbers Divisible by 13 Using Sequence Arithmetic


Appian Code

enumerate(7) * 13 + 13


Explanation

  1. enumerate(7) returns the integers 0 to 6.
  2. Multiplying by 13 gives {0, 13, 26, 39, 52, 65, 78}.
  3. Adding 13 moves the list up one step, to {13, 26, 39, 52, 65, 78, 91}.


Output

{13, 26, 39, 52, 65, 78, 91}

This builds the multiples directly, with no loop and no filtering. It works because exactly seven multiples of 13 fall between 1 and 100, so enumerate(7) gives the right count.

Try it yourself

Change the inputs or the expression and run it to see what it returns.

ri!number=

Independent evaluator: it approximates the Appian expression language and may differ from a real Appian environment. Verify anything that matters. Terms

JuniorExpressions#coding#sailcoding