  We propose a very accurate and efficient variational scheme for the ground
state of the system of $p$-wave attractively interacting fermions confined in a
one-dimensional harmonic trap. By the construction, the method takes the
non-analytical part of interactions exactly into account and thus it
approximates the true ground-state wave function in a whole range of
interactions very accurately. Within the method, we determine different
properties of the system for a different number of particles and different
interactions. In this way, we explore how the system and its features transit
from the ideal non-interacting Fermi gas to the system of infinitely strong
attractions. Additionally, we demonstrate that the ansatz may also be used on a
repulsive branch of interactions where other numerical methods break down. The
presented method of including zero-range interactions is very universal and may
be easily generalized to other one-dimensional confinements.
