Even though I think you have not counted the full statement of the problem, a solution without using loops would be using combinations :
from itertools import combinations
def make_bricks(small, big, goal):
bricks = [1]*small+[5]*big
return any(sum(lst)==goal
for n in range(len(bricks)+1)
for lst in combinations(bricks,n) )
It is a brute force algorithm, very inefficient. But it is a solution for simple cases.
Edited
Let's solve it without loops or recursion:
With enough small bricks the solution would be trivial:
goal <= small
Let's calculate how many large bricks we are going to use:
nbig = min(big, goal // 5)
What we have left to reach the goal has to be made with small bricks:
(goal - nbig*5) <= small
Finally:
def make_bricks(small, big, goal):
nbig = min(big, goal // 5)
return (goal - nbig*5) <= small
An example using only small bricks to check this solution:
make_bricks(30, 0, 10) --> True