A111802 n^2-n-1 for n>3; a(1)=1; a(2)=2; a(3)=3.
1, 2, 3, 11, 19, 29, 41, 55, 71, 89, 109, 131, 155, 181, 209, 239, 271, 305, 341, 379, 419, 461, 505, 551, 599, 649, 701, 755, 811, 869, 929, 991, 1055, 1121, 1189, 1259, 1331, 1405, 1481, 1559, 1639, 1721, 1805, 1891, 1979, 2069, 2161, 2255, 2351, 2449, 2549
Offset: 1
Examples
a(3) = 3, the number of different diagonal sums of all order 3 Latin squares. Their diagonal sums can only be 3, 6 and 9.
Links
- Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
Crossrefs
Cf. A028387.
Programs
-
Mathematica
Table[If[n<4,n,n^2-n-1],{n,60}] (* or *) LinearRecurrence[{3,-3,1},{1,2,3,11,19,29},60] (* Harvey P. Dale, Sep 04 2018 *)
-
PARI
a(n)=if(n>3,n^2-n-1,n) \\ Charles R Greathouse IV, Dec 20 2011
Formula
a(n) = n^2-n-1 = A028387(n-2) for n>3; a(n) = n for 1<=n<=3.
Comments