Can You Learn an Algorithm? Generalizing from Easy to Hard Problems with Recurrent Networks