OFFSET
0,3
COMMENTS
The old entry with this sequence number was a duplicate of A039963.
The simultaneous equations (p+1)(p+2) == -1 (mod q), (q+1)(q+2) == -1 (mod p), where p and q are odd, have solutions {3, 3}, {3, 21}, {7, 73}, {21, 507}, {73, 793}, {793, 8647} and suggested this recurrence.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..980
Index entries for linear recurrences with constant coefficients, signature (12,-12,1).
FORMULA
a(n) = 2*(A004190(n)-10*A004190(n-1))/3+1/3. G.f.: (1-11x+7x^2)/((1-x)(1-11x+x^2)). - R. J. Mathar, Sep 20 2008
MATHEMATICA
nxt[{a_, b_}]:={b, 11b-a-3}; NestList[nxt, {1, 1}, 20][[;; , 1]] (* or *) LinearRecurrence[{12, -12, 1}, {1, 1, 7}, 20] (* Harvey P. Dale, Jul 06 2025 *)
PROG
(PARI) a(n)=([0, 1, 0; 0, 0, 1; 1, -12, 12]^n*[1; 1; 7])[1, 1] \\ Charles R Greathouse IV, Jun 03 2026
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
EXTENSIONS
More terms from R. J. Mathar, Sep 20 2008
STATUS
approved
