Obviously, p is odd, so p≥3. If c=1, then
p+3=2apb≥2p≥p+3,
This can only happen when p=3, a=b=1, giving one solution (p,a,b,c)=(3,1,1,1). In what follows, we assume that c≥2.
Case 1: c is odd. Assume that q is a prime factor of c. Since (p+2)q+1∣(p+2)c+1,
(p+2)q+1=2αpβ.(1)
Obviously, α>0. Note that (p+2)q+1=(p+3)A, where
A=(p+2)q−1−(p+2)q−2+⋯+1>(p+2)q−1−(p+2)q−2=(p+2)q−2(p+1)>pq−1,
and A is odd, so A is a power of p. So A≥pq and β≥q. Taking both sides of (1) modulo p gives 2q≡−1(modp), so the order of 2(modp) is 2 or 2q.
If the order of 2(modp) is 2, then p=3. In this case, (1) is 5q+1=2α3β. Since 5q+1≡2(mod4), we have α=1. By Lifting-the-exponent Lemma, v3(5q+1)=v3(5+1)+v3(q)≤2, so β≤2. One checks that β=1,2 does not satisfy the equation.
If the order of 2(modp) is 2q, then 2q∣p−1. So q≤2p−1<2p. Dividing both sides of (1) by pq and using (1+x1)x<e, x≥1, we have
2αpβ−q=(1+p2)q+p−q<(1+p2)2p+p−q<e+3−3<3.
So β=q and α=1. Using 2⋅pq=(p+2)q+1=(p+3)A, we get A=pq and p+3=2. This is a contradiction.
Case 2: c is even. Assume that 2d∤c with d≥1. Then (p+2)2d+1∣(p+2)c+1. So
(p+2)2d+1=2αpβ.
Since (p+2)2d+1≡2(mod4), α=1.
(p+2)2d+1=2⋅pβ.(2)
Taking both sides of (2) modulo p gives 22d≡−1(modp). So the order of 2(modp) is 2d+1. Thus, 2d<2p. Since
pβ+1>2⋅pβ=(p+2)2d+1>p2d,
we have β≥2d. Dividing both sides of (2) by p2d, we have
2⋅pβ−2d=(1+p2)2d+p−2d<(1+p2)2p+p−2d<e+3−2<3,
so β=2d.
If d≥2, then 2d+1∣p−1 implies that p≡1(mod8). Using (2), we have p2d−1=(p+2)2d−p2d. Analyzing the number of factors 2 on both sides of the equality, we deduce that
v2(p2d−1)=v2(p2−1)+d−1≥d+3.
Yet,
v2((p+2)2d−p2d)=v2((p+2)2−p2)+d−1=v2(2)+v2(2p+2)+d−1=d+2,
giving a contradiction. So d=1 and 2p2=(p+2)2+1, which implies that p=5. Going back to the original equation, we have c=2k, with k odd. But a=1, so we have
2⋅5b=72k+1.
Using Lifting-the-exponent Lemma again, we have b=v5(72k+1)=v5(72+1)+v5(k)≤2+5k. If k≥3, then
2⋅5b≤2⋅52+5k=(72+1)⋅55k<72k+1,
giving a contradiction. So k=1, and thus c=2 and b=2. This gives another solution (p,a,b,c)=(5,1,2,2).
To sum up, there are two solutions of (p,a,b,c): (3,1,1,1) and (5,1,2,2).