A047415 Numbers that are congruent to {1, 3, 4, 6} mod 8.
1, 3, 4, 6, 9, 11, 12, 14, 17, 19, 20, 22, 25, 27, 28, 30, 33, 35, 36, 38, 41, 43, 44, 46, 49, 51, 52, 54, 57, 59, 60, 62, 65, 67, 68, 70, 73, 75, 76, 78, 81, 83, 84, 86, 89, 91, 92, 94, 97, 99, 100, 102, 105, 107, 108, 110, 113, 115, 116, 118, 121, 123, 124
Offset: 1
Links
- Iain Fox, Table of n, a(n) for n = 1..10000
- Math StackExchange, Strange Sum of Numbers 1 to 100, September 2020.
- Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
Programs
-
Magma
[n : n in [0..150] | n mod 8 in [1, 3, 4, 6]]; // Wesley Ivan Hurt, May 31 2016
-
Maple
A047415:=n->2*(n-1)-(I^(n*(n+1))-1)/2: seq(A047415(n), n=1..100); # Wesley Ivan Hurt, May 31 2016
-
Mathematica
Select[Range[108], MemberQ[{1, 3, 4, 6}, Mod[#, 8]]&] (* Bruno Berselli, Dec 06 2011 *)
-
Maxima
makelist(2*(n-1)-(%i^(n*(n+1))-1)/2, n, 1, 55); /* Bruno Berselli, Dec 06 2011 */
-
PARI
a(n)=2*(n-1)-(I^(n*(n+1))-1)/2 \\ Charles R Greathouse IV, Dec 06 2011
Formula
G.f.: x*(1+x+2*x^3) / ( (1+x^2)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
a(n) = 2*(n-1)-(i^(n*(n+1))-1)/2, where i=sqrt(-1). - Bruno Berselli, Dec 06 2011
From Wesley Ivan Hurt, May 31 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>4.
a(n) = (1+i)*(4*n-4*n*i+3*i-3+i^(1-n)-i^n)/4 where i=sqrt(-1).
E.g.f.: (4 + sin(x) - cos(x) + (4*x - 3)*exp(x))/2. - Ilya Gutkovskiy, May 31 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = 3*Pi/16 - (sqrt(2)+1)*log(2)/8 + sqrt(2)*log(sqrt(2)+2)/4. - Amiram Eldar, Dec 24 2021
Comments