Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #26 Sep 08 2022 08:44:57
%S 5,6,7,13,14,15,21,22,23,29,30,31,37,38,39,45,46,47,53,54,55,61,62,63,
%T 69,70,71,77,78,79,85,86,87,93,94,95,101,102,103,109,110,111,117,118,
%U 119,125,126,127,133,134,135,141,142,143,149,150,151,157,158,159
%N Numbers that are congruent to {5, 6, 7} mod 8.
%H Vincenzo Librandi, <a href="/A047574/b047574.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).
%F From _Chai Wah Wu_, May 30 2016: (Start)
%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
%F G.f.: x*(x^3 + x^2 + x + 5)/(x^4 - x^3 - x + 1). (End)
%F a(n) = (8*n-10*sin(2*Pi*(n+1)/3)/sqrt(3)+2)/3. - _Ilya Gutkovskiy_, May 30 2016
%F a(n) = 8*floor((n-1)/3)+((n-1) mod 3)+5. - _David A. Corneth_, May 30 2016
%F a(3k) = 8k-1, a(3k-1) = 8k-2, a(3k-2) = 8k-3. - _Wesley Ivan Hurt_, Jun 10 2016
%p A047574:=n->8*floor((n-1)/3)+((n-1) mod 3)+5: seq(A047574(n), n=1..100); # _Wesley Ivan Hurt_, Jun 10 2016
%t Select[Range[200], MemberQ[{5, 6, 7}, Mod[#, 8]] &] (* _Vincenzo Librandi_, May 30 2016 *)
%t LinearRecurrence[{1,0,1,-1},{5,6,7,13},60] (* _Harvey P. Dale_, Jul 29 2016 *)
%o (Magma) [n: n in [0..200] | n mod 8 in [5..7]]; // _Vincenzo Librandi_, May 30 2016
%o (PARI) a(n)=8 * (n-1)\3 + (n-1)%3 + 5 \\ _David A. Corneth_, May 30 2016
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_