login
Numbers that are congruent to {2, 3, 4, 7} mod 8.
6

%I #29 Dec 25 2021 09:42:27

%S 2,3,4,7,10,11,12,15,18,19,20,23,26,27,28,31,34,35,36,39,42,43,44,47,

%T 50,51,52,55,58,59,60,63,66,67,68,71,74,75,76,79,82,83,84,87,90,91,92,

%U 95,98,99,100,103,106,107,108,111,114,115,116,119,122,123

%N Numbers that are congruent to {2, 3, 4, 7} mod 8.

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2,2,-1).

%F a(n) = A056594(n)+2*n-1. - _Zerinvary Lajos_, Jul 06 2008

%F a(n) = A047404(n)+1. - _Zerinvary Lajos_, Jul 06 2008

%F G.f.: x*(2-x+2*x^2+x^3) / ((1+x^2)*(x-1)^2). - _R. J. Mathar_, Oct 08 2011

%F From _Wesley Ivan Hurt_, May 20 2016: (Start)

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

%F a(n) = (4*n-2+I^(1-n)+I^(n-1))/2 where I=sqrt(-1).

%F a(2n) = A004767(n-1) for n>0, a(2n-1) = A047463(n). (End)

%F Sum_{n>=1} (-1)^(n+1)/a(n) = 3*Pi/16 - 3*log(2)/8. - _Amiram Eldar_, Dec 25 2021

%p A047546:=n->(4*n-2+I^(1-n)+I^(n-1))/2: seq(A047546(n), n=1..100); # _Wesley Ivan Hurt_, May 20 2016

%t Table[(4n-2+I^(1-n)+I^(n-1))/2, {n, 80}] (* _Wesley Ivan Hurt_, May 20 2016 *)

%o (Sage) [lucas_number1(n,0,1)+2*n-1 for n in range(1,56)] # _Zerinvary Lajos_, Jul 06 2008

%o (PARI) a(n)=(n-1)\4*8+[7,2,3,4][n%4+1] \\ _Charles R Greathouse IV_, Jun 11 2015

%Y Cf. A004767, A047404, A047463, A056594.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_

%E More terms from _Wesley Ivan Hurt_, May 20 2016