Resonance in regular variables II: Formal solutions for central and non-central first-order resonance