[go: up one dir, main page]

login
A047605
Numbers that are congruent to {0, 2, 3, 5} mod 8.
1
0, 2, 3, 5, 8, 10, 11, 13, 16, 18, 19, 21, 24, 26, 27, 29, 32, 34, 35, 37, 40, 42, 43, 45, 48, 50, 51, 53, 56, 58, 59, 61, 64, 66, 67, 69, 72, 74, 75, 77, 80, 82, 83, 85, 88, 90, 91, 93, 96, 98, 99, 101, 104, 106, 107, 109, 112, 114, 115, 117, 120, 122, 123
OFFSET
1,2
FORMULA
From Bruno Berselli, Dec 05 2011: (Start)
G.f.: x^2*(2-x+3*x^2)/((1-x)^2*(1+x^2)).
a(n) = 2*(n-1)-(i^(n*(n+1))+1)/2, where i=sqrt(-1). (End)
From Wesley Ivan Hurt, Jun 04 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>4.
a(2k) = A047617(k), a(2k-1) = A047470(k). (End)
E.g.f.: (6 + sin(x) - cos(x) + (4*x - 5)*exp(x))/2. - Ilya Gutkovskiy, Jun 05 2016
Sum_{n>=2} (-1)^n/a(n) = (3-2*sqrt(2))*Pi/16 + 3*log(2)/8. - Amiram Eldar, Dec 21 2021
MAPLE
A047605:=n->2*(n-1)-(I^(n*(n+1))+1)/2: seq(A047605(n), n=1..100); # Wesley Ivan Hurt, Jun 04 2016
MATHEMATICA
Table[(1+I)*((4-4*I)*n+5*I-5+I^(1-n)-I^n)/4, {n, 80}] (* Wesley Ivan Hurt, Jun 04 2016 *)
Flatten[#+{0, 2, 3, 5}&/@(8*Range[0, 20])] (* or *) LinearRecurrence[{2, -2, 2, -1}, {0, 2, 3, 5}, 100] (* Harvey P. Dale, Sep 30 2018 *)
PROG
(PARI) a(n)=n\4*8+[-3, 0, 2, 3][n%4+1] \\ Charles R Greathouse IV, Dec 05 2011
(Magma) [n : n in [0..150] | n mod 8 in [0, 2, 3, 5]]; // Wesley Ivan Hurt, Jun 04 2016
CROSSREFS
Sequence in context: A028841 A028840 A189143 * A295085 A153000 A222172
KEYWORD
nonn,easy
STATUS
approved