Installing a new fan with old wiring
Your numbering sounds not quite right.   It sounds like a standard setup, with supply coming into the fan box, supply being carried onward to the next load, and a switch loop for the fan.   

Looking at the two whites with the pigtail, these are actually neutral, two whites come from supply and go to onward.  You don't need to care which is which.  The pigtail is neutral for the fan.    

In the bundle with two blacks and 1 white, the two blacks go to supply and onward.   The white is being correctly used as always-hot in the switch loop.   White is used to make it easier for electricians to realize this is not a neutral wire; it is always hot and is easily detected.   It should be wrapped in black tape on both ends to designate it a re-tasked hot.  

The remaining loose black is switched-hot from the switch loop to the fan. 

The fan connects to that loose black (switched-hot) and the white pigtail (neutral).