Iterating through huge sequence

I am creating a dropdown on a page for a range of values falling b/w and incrementing by . These min, max & i values are derieved from json data file. Got something like below, but unfortunately it’s causing “size of result exceeds limit” issue. Max value we are talking about here is “500000”

Any help is greatly appreciated. Thanks for your time.

{{ range $index, seq .Site.Data.dropdown.max }}
   {{ if (or (modBool $index .Site.Data.dropdown.step) (eq $index .Site.Data.dropdown.min))}}
      {{ . }}
   {{ end }}
{{ end }}

just so you know, below example with hardcoded values works

{{ range $index, seq 20 }}
   {{ if (or (modBool $index 3) (eq $index 5))}}
      {{ . }}
   {{ end }}
{{ end }}

Edit: Max value mentioned

Not tested…

{{ range $index, (seq ( int .Site.Data.dropdown.max)) }}

Thanks. You are right, this should work but if max value is 500000 or so it doesn’t. Original post now mentions the max value.