OFFSET
1,2
LINKS
R. H. Hardin, Table of n, a(n) for n=1..999
Index entries for linear recurrences with constant coefficients, signature (0,2,1,-1,-2,0,1).
FORMULA
a(n) = A000041(n)^2 for n <= 2.
a(n) = A000041(n)^2 - cumulative A000712(2*n-1-length), 0 <= 2*n-1-length <= floor(n/2) [empirical].
a(n) = (floor(n/2) + 1)^2 + 2*A069905(n). - Georg Fischer, Apr 20 2022
G.f.: -1 + (1 + x + 2*x^2 + 3*x^3 + 3*x^4)/((1 - x)^3*(1 + x)^2*(1 + x + x^2)). - Andrew Howroyd, Oct 26 2025
EXAMPLE
For n = 6, we count the possible concatenations of the 4 pairs in the list (-6,0),(-5,-1),(-4,-2),(-3,-3) with their negative reversed correspondants (starting with (-6,0,0,6)), giving (6/2 + 1)^2 = 16 quadruples, plus the 3 quadruples (-6,1,1,4), (-6,1,2,3), (-6,2,2,2) and their 3 negative reversed correspondants, giving a total of 22 possibilities. - Georg Fischer, Apr 20 2022
PROG
(AWK) # empirical
function a(n) { s=1; for(i=1; i<n; i++) { if(i%2==0)s+=2*int((i+5)/6); else s+=(i+2)+2*int((i+1)/6); } return s; }
CROSSREFS
KEYWORD
nonn
AUTHOR
R. H. Hardin, Mar 13 2009
STATUS
approved
