Clearly a must be a prime (set x=0). More exactly a is an odd prime because a=2 is not a solution. Furthermore a+1 must be a power of 2. Indeed suppose that a+1 has an odd prime divisor p. Note that p≤2a+1 as a+1 is even. Set x=21(p−1); it is clear that 0<x<a. We have
4x2+a=4⋅41(p−1)2+a=p(p−2)+(a+1). Since p divides a+1, it also divides 4x2+a.
addition, p<a<4x2+a, hence 4x2+a is composite.
The primes 3=22−1 and 7=23−1 satisfy the conditions. The values of 4x2+3 for x=0,1,2 are the primes 3,7,19; the values of 4x2+7 for x=0,1,2,3,4,5,6 are the primes 7,11,23,43,71,107,151. We show that a=3 and a=7 are the only solutions by rejecting all a=2m−1 with m≥4. For numbers of this form consider a+9=(a+1)+8. This even number is not a power of 2 (powers of 2 greater than 8 cannot differ by 8). Let q≤2a+9 be an odd prime divisor of a+9. Set x=21(q−3):
note that x may be zero but is less than a. Now 4x2+a=4⋅41(q−3)2+a=q(q−6)+(a+9), so q
divides 4x2+a. Also q≤2a+9<a as a≥15, hence q<a≤4x2+a. Then 4x2+a is composite, which completes the proof. The answer is a=3 and a=7.