05AB1E, 17 bytes
" "Ç©IED®âO«]I¢
Explanation
" " String containing code points for 6, 9, and 20
Ç Convert code points to integer list to get [6, 9, 20]
© Store this list in register_c
IE Loop <input> number of times
®â Cartesian product stack contents with list in register_c
O Sum up the contents of each sub array
D « List duplicated before taking Cartesian product, concat
] End for loop
I¢ Count occurences of input
rev
- 39
- 3