OFFSET
1,2
COMMENTS
For n >= 3, a(n) is the sum of all multiples of n XOR n-1 that are <= n^2.
LINKS
Winston de Greef, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
a(n) = A162264(n-1) + 1 for n >= 2. - Hugo Pfoertner, Jun 02 2023
G.f.: x*(1 - 5*x + 2*x^2 - 4*x^3)/(1 - x)^4. - Stefano Spezia, Jun 03 2023
MATHEMATICA
Table[(2 n^3 - n^2 + 3 n - 2)/2, {n, 100}]
LinearRecurrence[{4, -6, 4, -1}, {1, 8, 26, 61}, 50]
PROG
(Magma) [(2*n^3 - n^2 + 3*n - 2)/2 : n in [1..50]];
(PARI) a(n) = n^3 - 1 + (-n^2 + 3*n)/2 \\ Winston de Greef, Jun 01 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, May 25 2023
STATUS
approved