A world where when you turn a certain age you get a number on your hand and if that number is a zero you're killed.
The main character has a friend who gives him a lucky hat and he can do magic.
Science Fiction & Fantasy Stack Exchange is a question and answer site for science fiction and fantasy enthusiasts. It only takes a minute to sign up.Sign up to join this community
The book is Dragon Run by Patrick Matthews.
Testing Day is supposed to be a day of celebration for Al Pilgrommor. Born into a wealthy family, he expects to follow in his successful father's footsteps. Of course, that all depends on the rank number Al receives at the testing. The higher the rank he has tattooed onto his neck, the better his life will be.
To his surprise and horror, Al is revealed to be rank zero, the lowest of the low. He's now not only an outcast — he's also a danger to his entire family. So Al goes on the run, fleeing the brutal Cullers, men who hunt down zeroes . . . and put them to death.
The numbers are tattooed on the neck not the hand.
The hat is given to Al by his friend Wisp:
“That’s not all.” Wisp pulled a wide-brimmed black leather hat out of his bag. It was weathered and water-damaged, and had a red suede band tied around the base of its crown.
Al laughed. “You’ve got to be kidding. You’re actually going to wear that?”
“Not me,” Wisp said, holding it out. “My dad said to give it to you. ‘The luck of the Evans,’ he said."