Skip to main content
January 11, 2023
Question

Want to display numbers from 105

  • January 11, 2023
  • 13 replies
  • 0 views

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

    January 11, 2023

    Could you please try the below code.

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

    January 11, 2023

    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

    January 11, 2023

    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()
      )
    )

    January 11, 2023

    a!localVariables(

    local!test:a!forEach(

    items: 101+enumerate(100),

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

    local!test

    )

    January 11, 2023

    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)
    )

    January 11, 2023

    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
    )

    January 16, 2023

    i just saw my work has the same error. tks 

    papa's games

    June 16, 2025

    Did you manage to solve it?

    awesome tanks 2

    harshas2775
    June 16, 2025

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

    stefanhelzle0001
    January 31, 2023

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

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

    mikes0011
    Brainy
    January 31, 2023
    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?

    sureshd0004
    June 16, 2025

    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
      }
    )