%I #39 Aug 10 2024 01:30:12
%S 0,1,2,4,7,8,9,11,14,15,16,18,21,22,23,25,28,29,30,32,35,36,37,39,42,
%T 43,44,46,49,50,51,53,56,57,58,60,63,64,65,67,70,71,72,74,77,78,79,81,
%U 84,85,86,88,91,92,93,95,98,99,100,102,105,106,107,109,112
%N Numbers that are congruent to {0, 1, 2, 4} mod 7.
%C 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
%C 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
%H Daniel Starodubtsev, <a href="/A047351/b047351.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).
%F 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
%F 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
%F 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
%F 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
%F a(2k) = A047346(k), a(2k-1) = A047352(k). - _Wesley Ivan Hurt_, Jun 01 2016
%F 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
%p 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
%p 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
%t 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 *)
%o (Magma) [n : n in [0..150] | n mod 7 in [0, 1, 2, 4]]; // _Wesley Ivan Hurt_, Jun 01 2016
%o (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
%Y Cf. A045373 (primes), A047346, A047352.
%Y Complement of A047327.
%K nonn,easy
%O 1,3
%A _N. J. A. Sloane_