OFFSET
0,2
REFERENCES
A. V. Shutov, On the number of words of a given length in plane crystallographic groups (Russian), Zap. Nauchn. Sem. S.-Peterburg. Otdel. Mat. Inst. Steklov. (POMI) 302 (2003), Anal. Teor. Chisel i Teor. Funkts. 19, 188--197, 203; translation in J. Math. Sci. (N.Y.) 129 (2005), no. 3, 3922-3926 [MR2023041]. See Table 1, line "p4".
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
G.f.: -(-2*x^6-x^5-3*x^4-3*x^3-4*x^2-2*x-1)/(x^6-2*x^3+1).
Recurrence (there are several equivalent versions):
-n a(n) - 2 a(n + 1) - a(n + 2) + (n - 3) a(n + 3) + 2 a(n + 4) + a(n + 5) = 0, with a(0) = 1, a(1) = 2, a(2) = 4, a(3) = 5, a(4) = 7.
a(n) = 2*a(n-3) - a(n-6) for n > 6. - Chai Wah Wu, Mar 30 2018
MAPLE
f:= proc(n) if n=0 then 1
elif (n mod 3) = 0 then 2*n-1
elif (n mod 3) = 1 then (5*n+1)/3
else (5*n+2)/3; fi;
end;
[seq(f(n), n=0..70)];
MATHEMATICA
Join[{1}, LinearRecurrence[{0, 0, 2, 0, 0, -1}, {2, 4, 5, 7, 9, 11}, 100]] (* Vincenzo Librandi, Mar 31 2018 *)
nxt[{n_, a_}]:={n+1, Which[Divisible[n+1, 3], 2n+1, Mod[n+1, 3]==1, (5n+6)/3, True, (5n+7)/3]}; NestList[nxt, {0, 1}, 70][[All, 2]] (* Harvey P. Dale, Sep 08 2021 *)
PROG
(Magma) I:=[1, 2, 4, 5, 7, 9, 11]; [n le 7 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..70]]; // Vincenzo Librandi, Mar 31 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Mar 30 2018
STATUS
approved