Find all a, b, c, d, e, such that a + b + c + d + e = 1000 with no more than 3 loops The rule is:


a, b, c, d, e is an integer from 0 to 1000, no relation between a, b, c, d, e so a can equal to b or c, ...
can not use more than 3 loops (it can be 3 nested loops or 3 normal loops, or 2 nested loops + 1 normal loop, ...)
you need to find all the answers for (a, b, c, d, e) that is:


a + b + c + d + e = 1000



Your answer can be any format: line by line, array, object, ... but it must be clear so anyone can see it.
Shortest bytes will be win for each language!


For example here is when I used 5 loops to solve this puzzle and it violates the rules:

https://repl.it/repls/BestKnobbyDonateware
APL (Dyalog Unicode), 23 16 bytesSBCS



Full program. No loops. Prints a list of quintuplets with two spaces between them. Each quintuplet has the variables separated by single spaces. Requires 0-indexing (⎕IO←0) which is default on many systems.

⍸1E3=⊃∘.+/5⍴⊂⍳1001


Since the above code requires more memory than available on TIO, here's exactly the same, but with a + b + c + d + e between 0 and 10 and a sum of 10:

⍸1E1=⊃∘.+/5⍴⊂⍳11.0


Try it online!

⍳1001 the ɩntegers 0…1000

⊂ enclose to treat as a unit

5⍴ reshape that to length 5

∘.+/ reduction by outer-sum (like outer product, but with plus)
this creates a 5D array with all dimensions being 1000 elements long

⊃ disclose (the reduction had to enclose the result to reduce the rank from 1  to 0)

1E3 5D Boolean mask where equal to 1000

⍸ list of ɩndices where true