#Axiom + its library
f(n:PI,a:INT,b:INT):List INT==
r:List INT:=[]
a>b =>r
d:=1+b-a
for i in 1..n repeat
r:=concat(r,a+random(d)$INT)
r
examples
(6) -> f(1,1,5)
(6) [2]
Type: List Integer
(7) -> f(1,1,1)
(7) [1]
Type: List Integer
(10) -> f(10,1,1)
(10) [1,1,1,1,1,1,1,1,1,1]
Type: List Integer
(11) -> f(10,-20,-1)
(11) [- 10,- 4,- 18,- 5,- 5,- 11,- 15,- 1,- 20,- 1]
Type: List Integer
(12) -> f(10,-20,-1)
(12) [- 4,- 5,- 3,- 4,- 18,- 1,- 2,- 14,- 19,- 8]
Type: List Integer
(13) -> f(10,-20,-1)
(13) [- 18,- 12,- 12,- 19,- 19,- 15,- 5,- 17,- 19,- 4]
Type: List Integer
(14) -> f(10,-20,-1)
(14) [- 8,- 11,- 20,- 10,- 4,- 8,- 11,- 3,- 10,- 16]
Type: List Integer
(15) -> f(10,9,-1)
(15) []
Type: List Integer
(16) -> f(10,0,100)
(16) [72,83,41,35,27,0,33,18,60,38]
Type: List Integer