login
Numbers that are congruent to {3, 5, 6} mod 8.
3

%I #24 Sep 08 2022 08:44:57

%S 3,5,6,11,13,14,19,21,22,27,29,30,35,37,38,43,45,46,51,53,54,59,61,62,

%T 67,69,70,75,77,78,83,85,86,91,93,94,99,101,102,107,109,110,115,117,

%U 118,123,125,126,131,133,134,139,141,142,147,149,150,155,157,158

%N Numbers that are congruent to {3, 5, 6} mod 8.

%C Also, numbers n such that Fibonacci(n) = 2 (mod 3), where Fibonacci = A000045. - _M. F. Hasler_, Sep 29 2012

%H Vincenzo Librandi, <a href="/A047443/b047443.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 G.f.: x*(1+x)*(2*x^2-x+3)/((1+x+x^2)*(x-1)^2). - _R. J. Mathar_, Dec 07 2011

%F From _Wesley Ivan Hurt_, Jun 13 2016: (Start)

%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.

%F a(n) = 2*(12*n-3-6*cos(2*n*Pi/3)+sqrt(3)*sin(2*Pi*n/3))/9.

%F a(3k) = 8k-2, a(3k-1) = 8k-3, a(3k-2) = 8k-5. (End)

%p A047443:=n->2*(12*n-3-6*cos(2*n*Pi/3)+sqrt(3)*sin(2*Pi*n/3))/9: seq(A047443(n), n=1..100); # _Wesley Ivan Hurt_, Jun 13 2016

%t Select[Range[150], MemberQ[{3,5,6}, Mod[#,8]]&] (* _Harvey P. Dale_, Oct 04 2011 *)

%t LinearRecurrence[{1, 0, 1, -1}, {3, 5, 6, 11}, 100] (* _Vincenzo Librandi_, Jun 14 2016 *)

%o (PARI) is_A047443(n)=bittest(104,n%8) \\ with 104=2^3+2^5+2^6. - _M. F. Hasler_, Sep 29 2012

%o (PARI) A047443(n)={n=divrem(n,3);n[1]*8+[-2,3,5][n[2]+1]} \\ _M. F. Hasler_, Sep 29 2012

%o (Magma) [n : n in [0..150] | n mod 8 in [3, 5, 6]]; // _Wesley Ivan Hurt_, Jun 13 2016

%Y Cf. A000045.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_