OFFSET
1,2
COMMENTS
Yet another plausible solution to A115603.
The first differences of A115603 are all squares (assuming a prior term of 0), meaning that any sequence beginning 1,3,2,4 is sufficient to account for them; This solution chooses the permutation of integers A080782 = {1,3,2,4,6,5,7,9,8,...}
Ultimately that means this sequence is equal to A000330 for every two out of three consecutive terms, and is greater by 2n+1 where different.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,2,-4,2,-1,2,-1).
FORMULA
a(n) = ( n(n+1) + 6 - 8*sin^2(Pi*(n+1)/3) )*(2n+1)/6.
a(n) = Sum_{k=0..n} A080782(k)^2.
From Colin Barker, Aug 03 2020: (Start)
G.f.: x*(1 + 8*x - 5*x^2 + 10*x^3 + 4*x^4 - x^5 + x^6) / ((1 - x)^4*(1 + x + x^2)^2).
a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) - 4*a(n-4) + 2*a(n-5) - a(n-6) + 2*a(n-7) - a(n-8) for n>8.
(End)
MATHEMATICA
Accumulate[Array[#+Mod[#+1, 3]&, 70, 0]^2] (* Harvey P. Dale, Mar 29 2013 *)
PROG
(PARI) Vec(x*(1 + 8*x - 5*x^2 + 10*x^3 + 4*x^4 - x^5 + x^6) / ((1 - x)^4*(1 + x + x^2)^2) + O(x^40)) \\ Colin Barker, Aug 03 2020
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Carl R. White, Aug 25 2009
STATUS
approved