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

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.

• The sequence here is oeis.org/A001921 , with a linear recurrence for your sequence, which leads to the exponential growth you're seeing. But there is no proof there. – Michael Lugo Aug 17 '18 at 14:34
• That sequence was an example. I am talking about the more general family of sequences which all form exponential functions. – Jonah Aug 17 '18 at 14:39
• Write $(2p)^2-a(2x+1)^2=(4-a)$. This is a Pell equation – Lozenges Aug 17 '18 at 14:41