The binomial distribution with $n$ trials, $k$ successes and success probability $p$ is given by
$$P(k;n,p) = \binom{n}{k} p^k (1-p)^{(n-k)}, \quad k \in \{0,...,n\}$$
Suppose that we observe $k$ successes and know $p$ but we do not know $n$. Observe that now $k$ and $p$ are fixed whereas $n$ is stochastic. So if $k=6$ and $p=0.4$,
$$P(k=6; n ,p=0.4) = \binom{n}{6} 0.4^6 (0.6)^{(n-6)}, \quad n \in \{6,...,\infty\}.$$ This is however (remark by @Xiaomi) not a valid probability function as it does not sum to one over its suppoer. Is there a probability mass function for $n$? What is a useful (unbiased, consistent) estimator for its parameter $n$?
As noted in Xiaomi's answer, the probability distribution
$P(k=6; n ,p=0.4) = \binom{n}{6} 0.4^6 (0.6)^{(n-6)}, \quad n \in \{6,...,\infty\}.$
fails. The problem is that it assumes the six successes occur randomly among the $n$ occurrences, but this is not true. To achieve $n$ as an outcome the sixth success must occur exactly on attempt $n$. Only the first five successes occur randomly, and they are restricted to the first $n-1$ attempts (but no need for the fifth success to occur exactly at attempt $n-1$. The correct probability distribution with these characteristics is
$$P(k=6; n ,p=0.4) = \binom{n-1}{5} 0.4^5 (0.6)^{((n-1)-5)}\color{blue}{(0.4)}, \quad n \in \{6,...,\infty\}.$$
where the blue factor forces a success on trial $n$ and the rest of the expression accounts for the proper random occurrence of the other five successes. This simplifies to
$$P(k=6; n ,p=0.4) = \binom{n-1}{5} 0.4^6 (0.6)^{(n-6)}, \quad n \in \{6,...,\infty\}.$$
which now does normalize properly and should give consistent statistical estimates.