OFFSET
1,3
COMMENTS
The set of values for m such that 7i+m is a perfect square (the quadratic residues of 7 including the trivial case of k*7). - Gary Detlefs, Mar 07 2010
The product of any two terms belongs to the sequence and therefore also a(n)^2, a(n)^3, a(n)^4 etc. - Bruno Berselli, Dec 03 2012
LINKS
Daniel Starodubtsev, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
If n mod 4 = 0 then a(n) = floor((7*n-3)/4)+1, else a(n) = floor((7*n-3)/4). - Gary Detlefs, Mar 07 2010
G.f.: x^2*(1+x+2*x^2+3*x^3) / ( (1+x)*(1+x^2)*(x-1)^2 ). - R. J. Mathar, Dec 04 2011
a(n) = n-3+(6*n+(2-(-1)^n)(1-2*i^(n(n+1)))+1)/8, where i=sqrt(-1). - Bruno Berselli, Dec 03 2012
a(0)=0, a(1)=1, a(2)=2, a(3)=4, a(4)=7, a(n) = a(n-1) + a(n-4) - a(n-5) for n>5. - Harvey P. Dale, Jun 04 2013
E.g.f.: (12 + 3*sin(x) - cos(x) + (7*x - 10)*sinh(x) + (7*x - 11)*cosh(x))/4. - Ilya Gutkovskiy, Jun 02 2016
MAPLE
for i from 1 to 56 do if(i mod 4=0) then print(floor(7*i-3)/4)+1) else print(floor(7*i-3)/4)) fi od; # Gary Detlefs, Mar 07 2010
A047351:=n->n-3+(6*n+(2-I^(2*n))*(1-2*I^(n*(n+1)))+1)/8: seq(A047351(n), n=1..100); # Wesley Ivan Hurt, Jun 01 2016
MATHEMATICA
Select[Range[0, 100], MemberQ[{0, 1, 2, 4}, Mod[#, 7]]&] (* or *) LinearRecurrence[{1, 0, 0, 1, -1}, {0, 1, 2, 4, 7}, 60] (* Harvey P. Dale, Jun 04 2013 *)
PROG
(Magma) [n : n in [0..150] | n mod 7 in [0, 1, 2, 4]]; // Wesley Ivan Hurt, Jun 01 2016
(PARI) x='x+O('x^100); concat(0, Vec(x^2*(1+x+2*x^2+3*x^3)/((1+x)*(1+x^2)*(x-1)^2))) \\ Altug Alkan, Jun 02 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved