OFFSET
0,3
COMMENTS
This quadratic recurrence was given in Problem A6 of the 86th William Lowell Putnam Mathematical Competition, which can be found in the first Kedlaya link below.
For n>0, the rightmost digit of a(n) cycles through these six values: 1, 4, 7, 6, 9, 2.
For n>0, the digital root (A010888) of a(n) is 1 if n is odd and 4 if n is even. So, these digital roots follow the sequence A010685.
For k>0, a(2^(k+1))-2*a(2^k) is divisible by 2^(2*k+2) but not by 2^(2*k+3). Two proofs can be found in the second Kedlaya link below.
LINKS
FORMULA
a(n) = A084849(a(n-1)).
EXAMPLE
a(4) = 2*a(3)^2 + a(3) + 1 = 2*(37^2) + 37 + 1 = 2776.
MATHEMATICA
RecurrenceTable[{a[n] == 2*a[n - 1]^2 + a[n - 1] + 1, a[0] == 0}, a, {n, 0, 10}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Timothy L. Tiffin, Dec 07 2025
STATUS
approved
