Redhouse: Doesn't seem to be a guaranteed solution unless there are no tails at all at the start. Obviously probability of winning decreases as number of coins increases.
This one comes down to guaranteeing that you have an even number of heads after you flip, the fewest possible number of heads after you flip, and then splitting the coins into two piles as equal as you can get. The way I see it, depending on count, you either flip 1, flip everything, or flip everything but one. Doing anything else results in a 50% chance of you having an odd number of heads before you split them up, so you'd be fucked no matter how the split lands.
If there are an odd number of total coins, and the total coin count (N) is less than 37*2 = 74, flip everything, this guarantees that there are now an even number of heads on the table, and fewer heads than you started with. Then take (N-1)/2 coins and put them in a different pile. If N = 39 you've ensured a 50% chance of winning. If N = 41 you've ensured a 3/8 chance, and decreasing so on, but splitting (N-1)/2 always has the best expectation value.
If there are an odd number of total coins, and the total coin count (N) is more than 37*2 = 74, just flip one coin (flipping all of them now will guarantee you have MORE than 37 heads, and the more heads on the final board the worse the odds your distribution of heads falls into the desired even split). Now you know you have either 36 or 38 heads, you hope it's 36 but it doesn't really matter. Then split them as before, (N-1)/2 in a new pile.
If there are an even number of total coins, shit gets a bit easier. If N < 74, flip everything but one. Even number of heads guaranteed - fewest possible heads in final board - maximum odds of even distribution (this time just split them into 2 equal piles).
If there are an even number of total coins, and N > 74, flip only one. Even number of heads guaranteed (either 36 or 38 again), you've minimized the number of possible heads on the final board, and you'll again make two equal piles.
If N = 74, you could flip all but one or only one, probability is the same
Also, fuck you redhouse for making me think that one through :)
Fuck you double if I'm wrong :)