Skip to main content
Participating Frequently
Jan 11, 2023 11:33 AM UTC
Question

Want to display numbers from 105

Hi Everyone,

i am trying to display numbers from 105 but the output should be : {105,110,115,120,,125,130,135,140,145,150,151,152,153,154,155,156,157,158,159,160,165,170,175,180,185,190,195,200},

i have tried but after 105 iam getting 115,Here sharing my code 

a!localVariables(
local!data: 101 + enumerate(100),
index(
local!data,
where(like(touniformstring(local!data), "*5*"))
)
)

Thank You In Advance

    13 replies

    Inspiring
    Jan 11, 2023 11:44 AM UTC

    Could you please try the below code.

    a!localVariables(
      local!data: 101 + enumerate(100),
      index(
        local!data,
        (enumerate(count(local!data)/5)+1)*5,
        {}
      )
    )

    Participating Frequently
    Jan 11, 2023 11:47 AM UTC

    its only showing those are divided by 5 i want to show that but as well after 150 i want to show 151,152,153,154,155,156,157,158,159 like this then after 160 again 165,170

    Inspiring
    Jan 11, 2023 11:53 AM UTC

    Something like below?

    a!localVariables(
      local!data: 101 + enumerate(100),
      local!indexesContains5: wherecontains(true(), find(5, local!data, 1) > 1),
      local!multipleOf5: (enumerate(count(local!data) / 5) + 1) * 5,
      sortintegerarray(
        index(
          local!data,
          union(
            local!multipleOf5,
            local!indexesContains5
          ),
          {}
        ),
        false()
      )
    )

    New Participant
    Jan 11, 2023 12:22 PM UTC

    a!localVariables(

    local!test:a!forEach(

    items: 101+enumerate(100),

    expression:if(mod(fv!item,5)=0,fv!item,{}) ),

    local!test

    )

    Participating Frequently
    Jan 11, 2023 12:30 PM UTC

    a!localVariables(
      local!data:a!forEach(
        items: enumerate(100)+101,
        expression: {if(mod(fv!index,5),{},fv!item),if(find(5,fv!item),fv!item,{})}
      ),
     union(local!data,local!data)
    )

    New Participant
    Jan 11, 2023 12:34 PM UTC

    Hi [mention:def63b4d161e40ea8ebfb4b690b0b18c:e9ed411860ed4f2ba0265705b8793d05]

    Once try it with this..

    a!localVariables(
    local!data: a!forEach(
    items: enumerate(101)+100,
    expression: append(if(find(5,fv!item),fv!item,{}),if(mod(fv!item,5),{},fv!item)),
    ),
    local!uniqueData:union(local!data,local!data),
    local!uniqueData
    )

    New Participant
    Jan 16, 2023 3:23 AM UTC

    i just saw my work has the same error. tks 

    papa's games

    New Participant
    Jun 16, 2025 7:16 AM UTC

    Did you manage to solve it?

    awesome tanks 2

    harshas2775
    Brainy
    Jun 16, 2025 7:25 AM UTC

    Looks like by the 'verified' answer above they were able to solve it.

    Happy to help. Even happier to optimize.
    stefanhelzle0001
    Brainy
    Jan 31, 2023 10:41 AM UTC

    Nice challenge, but for what purpose? Below my approach.

    {
      105 + enumerate(9) * 5,
      150 + enumerate(11),
      160 + enumerate(9) * 5,
    }

    mikes0011
    Brainy
    Jan 31, 2023 6:09 PM UTC
    Nice challenge

    indeed.

    i was, also, wondering if this could be reduced to something more elegant/simple and I just came up with this:

    (enumerate(20) + 21) * 5

    Though of course a lot depends on unfilled assumptions - how long of a list do we need?  Are we assuming it ends at "200" or is that just an example ending point?

    The Expression Guru
    sureshd0004
    Inspiring
    Jun 16, 2025 2:29 PM UTC

    Old post but interesting issue, hence posting this code for anyone else interested in it. 

    a!localVariables(
      local!startNUmber: 105,
      local!endNUmber: 200,
      local!diffrence: 5,
      local!diff: (
        (local!endNUmber - local!startNUmber) / local!diffrence
      ) + 1,
      {
        local!startNUmber + enumerate(local!diff) * local!diffrence
      }
    )