Why do perfect square values to $ax^2 +ax +1$ form an exponential function?

132 Views Asked by At

While playing around with numbers using Python, I found that the set of values of x which fulfilled $$ax^2 + ax +1 = p^2$$ Where p is an integer form an exponential function. For example,
$$3x^2 + 3x + 1$$ has $x$'s $[7,104,1455,20272,282359,3932760,54776287,762935264,10626317415,\dots]$ which forms an almost perfect exponential function $(r~=0.999997...)$, when the values are paired $$(1,7), (2,104), (3,1455),...$$ I assume this involves some application of number theory and modulus, so I would appreciate someone giving me a hint on how to prove this.
PS: I have a decent understanding of calculus and a barely mediocre understanding of Number Theory.