I want to define a recursive sequence and then ask Mathematica to print a specific value:

Am I doing something wrong?
First, you need to use "delayed substitution" so that Mathematica knows it needs to wait with evaluating expression until you type G[1]. Secondly, you can't have arithmetic expression on the left-hand side. so the second line should be:
G[y_]:=2G[y-1].
G[y+1](assumingyhas no value assigned at the point of call). Indeed, when using a pattern, it can even make sense to have arithmetic arguments, e.g.:G[0]:=1;G[i_Integer/;i>0]:=2*G[i-1];G[y_+n_Integer/;n>0]:=2*G[y+n-1]Then you could writeG[a+4]and get the result16*G[a]. – celtschk May 21 '12 at 08:17H := Function[If[# <= 0, 0, H[# - 1] + #]]andG = Function[If[# <= 0, 0, r := G[# - 1] + #; r ]]? – user1952009 Sep 24 '16 at 14:20