OFFSET
1,2
COMMENTS
Also, numbers n such that kronecker(n+2, 7) = -1. - M. F. Hasler, Mar 15 2013
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: x*(1+2*x+x^2+3*x^3)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Dec 04 2011
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (21*n-18-9*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 7k-3, a(3k-1) = 7k-4, a(3k-2) = 7k-6. (End)
MAPLE
A047343:=n->(21*n-18-9*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9: seq(A047343(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
MATHEMATICA
Flatten[Table[{7n + 1, 7n + 3, 7n + 4}, {n, 0, 19}]] (* Alonso del Arte, Mar 15 2013 *)
LinearRecurrence[{1, 0, 1, -1}, {1, 3, 4, 8}, 90] (* Harvey P. Dale, Aug 07 2021 *)
PROG
(PARI) A047343(n)=n\3*7+[-3, 1, 3][n%3+1] \\ M. F. Hasler, Mar 15 2013
(PARI) for(k=1, 200, kronecker(k+2, 7)==-1 & print1(k", ")) \\ For illustrative purpose of the comment. - M. F. Hasler, Mar 15 2013
(Magma) [n : n in [0..150] | n mod 7 in [1, 3, 4]]; // Wesley Ivan Hurt, Jun 10 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved