cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 17 results. Next

A047461 Numbers that are congruent to {1, 4} mod 8.

Original entry on oeis.org

1, 4, 9, 12, 17, 20, 25, 28, 33, 36, 41, 44, 49, 52, 57, 60, 65, 68, 73, 76, 81, 84, 89, 92, 97, 100, 105, 108, 113, 116, 121, 124, 129, 132, 137, 140, 145, 148, 153, 156, 161, 164, 169, 172, 177, 180, 185, 188, 193, 196, 201, 204, 209, 212, 217, 220, 225, 228, 233
Offset: 1

Views

Author

Keywords

Comments

Maximal number of squares that can be covered by a queen on an n X n chessboard. - Reinhard Zumkeller, Dec 15 2008

Crossrefs

Programs

  • GAP
    Filtered([1..250], n->n mod 8=1 or n mod 8 =4); # Muniru A Asiru, Jul 23 2018
    
  • Magma
    [4*n-3 - ((n+1) mod 2): n in [1..70]]; // G. C. Greubel, Mar 15 2024
    
  • Maple
    seq(coeff(series(factorial(n)*((8-exp(-x)+(8*x-7)*exp(x))/2), x,n+1),x,n),n=1..60); # Muniru A Asiru, Jul 23 2018
  • Mathematica
    Flatten[(#+{1,4})&/@(8Range[0,30])] (* or *) LinearRecurrence[ {1,1,-1},{1,4,9},60] (* Harvey P. Dale, Jun 18 2013 *)
    CoefficientList[ Series[(4x^2 + 3x + 1)/((x + 1) (x - 1)^2), {x, 0, 58}], x] (* Robert G. Wilson v, Jul 24 2018 *)
  • Maxima
    makelist(4*n -(7 + (-1)^n)/2, n, 1, 100); /* Franck Maminirina Ramaharo, Jul 22 2018 */
    
  • Python
    def A047461(n): return (n-1<<2)|(n&1) # Chai Wah Wu, Mar 30 2024
  • SageMath
    [4*n-3 - ((n+1)%2) for n in range(1,71)] # G. C. Greubel, Mar 15 2024
    

Formula

From R. J. Mathar, Oct 29 2008: (Start)
G.f.: x*(1+3*x+4*x^2)/((1+x)*(1-x)^2).
a(n) = a(n-2) + 8.
a(n) + a(n+1) = A004770(n).
a(n+1) - a(n) = A010703(n). (End)
a(n) = 8*floor((n-1)/2) + 4 - 3*(n mod 2). - Reinhard Zumkeller, Dec 15 2008
a(n) = A153125(n,n). - Reinhard Zumkeller, Dec 20 2008
a(n) = 8*n - a(n-1) - 11 (with a(1)=1). - Vincenzo Librandi, Aug 06 2010
a(n) = 4*n - (7 + (-1)^n)/2. - Arkadiusz Wesolowski, Sep 18 2012
a(1)=1, a(2)=4, a(3)=9, a(n) = a(n-1) + a(n-2) - a(n-3). - Harvey P. Dale, Jun 18 2013
a(n) = 1 + A004526(n)*3 + A004526(n-1)*5. - Gregory R. Bryant, Apr 16 2014
From Franck Maminirina Ramaharo, Jul 22 2018: (Start)
a(n) = A047470(n) + 1.
E.g.f.: (8 - exp(-x) + (8*x - 7)*exp(x))/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+1)*Pi/16 + log(2)/4 + sqrt(2)*arccoth(sqrt(2))/8. - Amiram Eldar, Dec 11 2021

A047470 Numbers that are congruent to {0, 3} mod 8.

Original entry on oeis.org

0, 3, 8, 11, 16, 19, 24, 27, 32, 35, 40, 43, 48, 51, 56, 59, 64, 67, 72, 75, 80, 83, 88, 91, 96, 99, 104, 107, 112, 115, 120, 123, 128, 131, 136, 139, 144, 147, 152, 155, 160, 163, 168, 171, 176, 179, 184, 187, 192, 195, 200, 203, 208, 211, 216, 219, 224, 227, 232
Offset: 1

Views

Author

Keywords

Comments

Maximum number of squares attacked by a queen on an n X n chessboard. - Stewart Gordon, Mar 23 2001
Equivalently, maximum vertex degree in the n X n queen graph. - Eric W. Weisstein, Jun 20 2017
Number of squares attacked by a queen on a toroidal chessboard. - Diego Torres (torresvillarroel(AT)hotmail.com), May 19 2001
List of squared distances between points of diamond 'lattice' with minimal distance sqrt(3). - Arnold Neumaier (Arnold.Neumaier(AT)univie.ac.at), Aug 01 2003
Draw a figure-eight knot diagram on the plane and assign a list of nonnegative numbers at each crossing as follows. Start with 0 and choose a crossing on the knot. Pick a direction and walk around the knot, appending the following nonnegative number everytime a crossing is visited. Two series of sequences are obtained: this sequence, A047535, A047452, A047617 and A047615, A047461, A047452, A047398 (see example). - Franck Maminirina Ramaharo, Jul 22 2018

Examples

			From _Franck Maminirina Ramaharo_, Jul 22 2018: (Start)
Consider the following equivalent figure-eight knot diagrams:
+---------------------+           +-----------------n
|                     |           |                 |
|           +---------B-----+     |           w-----A---e
|           |         |     |     |           |     |   |
|     n-----C---+     |     |     |           |     |   |
|     |     |   |     |     | <=> |   +-------B-----s   |
|     |     +---D-----+     |     |   |       |         |
|     |         |           |     |   |       |         |
w-----A---------e           |     +---C-------D---------+
      |                     |         |       |
      s---------------------+         +-------+
Uppercases A,B,C,D denote crossings, and lowercases n,s,w,e denote directions. Due to symmetry and ambient isotopy, all possible sequences are obtained by starting from crossing A and choose either direction 'n' or 's'.
Direction 'n':
A: 0, 3,  8, 11, 16, 19, 24, 27, 32, 35, 40, ... (this sequence);
B: 4, 7, 12, 15, 20, 23, 28, 31, 36, 39, 44, ... A047535;
C: 1, 6,  9, 14, 17, 22, 25, 30, 33, 38, 41, ... A047452;
D: 2, 5, 10, 13, 18, 21, 26, 29, 34, 37, 42, ... A047617.
Direction 's':
A: 0, 5,  8, 13, 16, 21, 24, 29, 32, 37, 40, ... A047615;
B: 1, 4,  9, 12, 17, 20, 25, 28, 33, 36, 41, ... A047461;
C: 2, 7, 10, 15, 18, 23, 26, 31, 34, 39, 42, ... A047524;
D: 3, 6, 11, 14, 19, 22, 27, 30, 35, 38, 43, ... A047398.
(End)
		

Crossrefs

Programs

  • GAP
    a:=[0,3,8];; for n in [4..50] do a[n]:=a[n-1]+a[n-2]-a[n-3]; od; a; # Muniru A Asiru, Jul 23 2018
    
  • Maple
    a:=n->add(4+(-1)^j,j=1..n):seq(a(n),n=0..64); # Zerinvary Lajos, Dec 13 2008
  • Mathematica
    With[{c = 8 Range[0, 30]}, Sort[Join[c, c + 3]]] (* Harvey P. Dale, Oct 11 2011 *)
    Table[(8 n - 9 - (-1)^n)/2, {n, 20}] (* Eric W. Weisstein, Jun 20 2017 *)
    LinearRecurrence[{1, 1, -1}, {0, 3, 8}, 20] (* Eric W. Weisstein, Jun 20 2017 *)
    CoefficientList[Series[(x (3 + 5 x))/((-1 + x)^2 (1 + x)), {x, 0, 20}], x]  (* Eric W. Weisstein, Jun 20 2017 *)
  • PARI
    forstep(n=0,200,[3,5],print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
    
  • Python
    def A047470(n): return (n-1<<2)-(n&1^1) # Chai Wah Wu, Mar 30 2024

Formula

a(n) = a(n-1) + 4 + (-1)^n.
a(n) = a(n-1) + a(n-2) - a(n-3).
a(n) = A042948(n) + A005843(n).
G.f.: (3x+5*x^2)/((1-x)*(1-x^2)).
a(n) = 8*n - a(n-1) - 13 (with a(1)=0). - Vincenzo Librandi, Aug 06 2010
a(n+1) = Sum_{k>=0} A030308(n,k)*A171497(k). - Philippe Deléham, Oct 17 2011
a(n) = 4*n -(9 + (-1)^n)/2. - Arkadiusz Wesolowski, Sep 18 2012
E.g.f: (10 - exp(-x) + (8*x - 9)*exp(x))/2. - Franck Maminirina Ramaharo, Jul 22 2018
Sum_{n>=2} (-1)^n/a(n) = (sqrt(2)-1)*Pi/16 + log(2)/2 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A047452 Numbers that are congruent to {1, 6} mod 8.

Original entry on oeis.org

1, 6, 9, 14, 17, 22, 25, 30, 33, 38, 41, 46, 49, 54, 57, 62, 65, 70, 73, 78, 81, 86, 89, 94, 97, 102, 105, 110, 113, 118, 121, 126, 129, 134, 137, 142, 145, 150, 153, 158, 161, 166, 169, 174, 177, 182, 185, 190
Offset: 1

Views

Author

Keywords

Comments

Except for 1, numbers whose binary reflected Gray code (A014550) ends with 01. - Amiram Eldar, May 17 2021

Crossrefs

Programs

  • GAP
    Filtered([0..250], n->n mod 8=1 or n mod 8=6); # Muniru A Asiru, Jul 24 2018
    
  • Maple
    seq(coeff(series(factorial(n)*((4+exp(-x)+(8*x-5)*exp(x))/2), x,n+1),x,n),n=1..60); # Muniru A Asiru, Jul 24 2018
  • Mathematica
    Table[(8 n - 5 + (-1)^n)/2, {n, 1, 100}] (* Franck Maminirina Ramaharo, Jul 23 2018 *)
    CoefficientList[ Series[(2x^2 + 5x + 1)/((x - 1)^2 (x + 1)), {x, 0, 50}], x] (* or *)
    LinearRecurrence[{1, 1, -1}, {1, 6, 9}, 51] (* Robert G. Wilson v, Jul 24 2018 *)
  • Maxima
    makelist((8*n - 5 + (-1)^n)/2, n, 1, 100); /* Franck Maminirina Ramaharo, Jul 23 2018 */
    
  • Python
    def A047452(n): return (n<<2)-2-(n&1) # Chai Wah Wu, Mar 30 2024

Formula

G.f.: x*(1+5*x+2*x^2) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Dec 07 2011
E.g.f.: (4 + exp(-x) + (8*x - 5)*exp(x))/2. - Ilya Gutkovskiy, May 25 2016
a(n) = A047615(n) + 1. - Franck Maminirina Ramaharo, Jul 23 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+2)*Pi/16 + log(2)/8 + sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

A047617 Numbers that are congruent to {2, 5} mod 8.

Original entry on oeis.org

2, 5, 10, 13, 18, 21, 26, 29, 34, 37, 42, 45, 50, 53, 58, 61, 66, 69, 74, 77, 82, 85, 90, 93, 98, 101, 106, 109, 114, 117, 122, 125, 130, 133, 138, 141, 146, 149, 154, 157, 162, 165, 170, 173, 178, 181, 186, 189, 194, 197, 202, 205, 210, 213, 218, 221, 226, 229, 234
Offset: 1

Views

Author

Keywords

Comments

Numbers whose binary reflected Gray code (A014550) ends with 11. - Amiram Eldar, May 17 2021

Crossrefs

Programs

  • Mathematica
    Select[Range[300],MemberQ[{2,5},Mod[#,8]]&] (* or *) LinearRecurrence[ {1,1,-1},{2,5,10},80] (* Harvey P. Dale, Feb 23 2016 *)
  • Maxima
    makelist(4*n -(5 + (-1)^n)/2, n, 1, 100); /* Franck Maminirina Ramaharo, Jul 22 2018 */
    
  • Python
    def A047617(n): return (n-1<<2)+1+(n&1) # Chai Wah Wu, Mar 30 2024

Formula

a(n) = 8*n - a(n-1) - 9 (with a(1)=2). - Vincenzo Librandi, Aug 06 2010
a(n) = 4*n - (5 + (-1)^n)/2. - Arkadiusz Wesolowski, Sep 18 2012
G.f.: (2+3*x+3*x^2)/((-1+x)^2*(1+x)). - Harvey P. Dale, Feb 23 2016
a(1)=2, a(2)=5, a(3)=10, a(n) = a(n-1) + a(n-2) - a(n-3). - Harvey P. Dale, Feb 23 2016
From Franck Maminirina Ramaharo, Jul 22 2018: (Start)
a(n) = A047470(n) + 2.
E.g.f.: (6 - exp(-x) + (8*x - 5)*exp(x))/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(2)*Pi/16 - log(2)/8 + sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A047535 Numbers that are congruent to {4, 7} mod 8.

Original entry on oeis.org

4, 7, 12, 15, 20, 23, 28, 31, 36, 39, 44, 47, 52, 55, 60, 63, 68, 71, 76, 79, 84, 87, 92, 95, 100, 103, 108, 111, 116, 119, 124, 127, 132, 135, 140, 143, 148, 151, 156, 159, 164, 167, 172, 175, 180, 183, 188, 191, 196, 199, 204, 207, 212, 215, 220, 223, 228, 231
Offset: 1

Views

Author

Keywords

Comments

Union of A004771 and A017113.

Crossrefs

Programs

Formula

a(n) = 8*n - a(n-1) - 5 (with a(1)=4). - Vincenzo Librandi, Aug 06 2010
a(n) = 4*n -(1 + (-1)^n)/2. - Arkadiusz Wesolowski, Sep 18 2012
G.f.: x*(4+3*x+x^2) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Jul 10 2015
From Franck Maminirina Ramaharo, Jul 22 2018: (Start)
a(n) = A047470(n) + 4.
E.g.f.: (2 - exp(-x) + (8*x - 1)*exp(x))/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+1)*Pi/16 - log(2)/4 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 11 2021

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

Original entry on oeis.org

3, 6, 11, 14, 19, 22, 27, 30, 35, 38, 43, 46, 51, 54, 59, 62, 67, 70, 75, 78, 83, 86, 91, 94, 99, 102, 107, 110, 115, 118, 123, 126, 131, 134, 139, 142, 147, 150, 155, 158, 163, 166, 171, 174, 179, 182, 187, 190, 195, 198, 203, 206, 211, 214, 219, 222, 227, 230
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) = 8*n - a(n-1) - 7, n > 1. - Vincenzo Librandi, Aug 05 2010
From R. J. Mathar, Dec 05 2011: (Start)
a(n) = 4*n - (3 + (-1)^n)/2.
G.f.: x*(3+3*x+2*x^2) / ( (1+x)*(x-1)^2 ). (End)
From Franck Maminirina Ramaharo, Aug 06 2018: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3), n > 3.
a(n) = 4*n + (n mod 2) - 2.
a(n) = A047470(n) + 3.
a(2*n) = A017137(n-1).
a(2*n-1) = A017101(n-1).
E.g.f.: ((8*x - 3)*exp(x) - exp(-x) + 4)/2. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(2)*Pi/16 + log(2)/8 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 18 2021

A047615 Numbers that are congruent to {0, 5} mod 8.

Original entry on oeis.org

0, 5, 8, 13, 16, 21, 24, 29, 32, 37, 40, 45, 48, 53, 56, 61, 64, 69, 72, 77, 80, 85, 88, 93, 96, 101, 104, 109, 112, 117, 120, 125, 128, 133, 136, 141, 144, 149, 152, 157, 160, 165, 168, 173, 176, 181, 184, 189, 192, 197, 200, 205, 208, 213, 216, 221, 224, 229, 232
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • GAP
    Filtered([0..250], n->n mod 8=0 or n mod 8=5); # Muniru A Asiru, Jul 23 2018
    
  • Magma
    [(8*n - 7 + (-1)^n)/2 : n in [1..50]]; // Wesley Ivan Hurt, Mar 26 2015
    
  • Maple
    a:=n->add(4-(-1)^j, j=1..n): seq(a(n), n=0..59); # Zerinvary Lajos, Dec 13 2008
  • Mathematica
    Table[(8 n - 7 + (-1)^n)/2, {n, 1, 40}] (* Wesley Ivan Hurt, Mar 26 2015 *)
    Rest@ CoefficientList[Series[x^2*(5 + 3 x)/((1 - x)^2*(1 + x)), {x, 0, 59}], x] (* Michael De Vlieger, Aug 25 2016 *)
    Rest@(Range[0, 60]! CoefficientList[ Series[(6 + Exp[-x] + (8 x - 7)*Exp[x])/2, {x, 0, 60}], x]) (* or *)
    LinearRecurrence[{1, 1, -1}, {0, 5, 8}, 60] (* Robert G. Wilson v, Jul 23 2018 *)
  • PARI
    forstep(n=0,200,[5,3],print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
    
  • PARI
    concat(0, Vec(x^2*(5+3*x)/((1-x)^2*(1+x)) + O(x^100))) \\ Colin Barker, Aug 25 2016
    
  • Python
    def A047615(n): return (n<<2)-3-(n&1) # Chai Wah Wu, Mar 30 2024

Formula

a(n) = 8*n-a(n-1)-11 (with a(1)=0). - Vincenzo Librandi, Aug 06 2010
a(n+1) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=5 and b(k)=2^(k+2) for k>0. - Philippe Deléham, Oct 17 2011
From Wesley Ivan Hurt, Mar 26 2015: (Start)
a(n) = a(n-1)+a(n-2)-a(n-3).
a(n) = (8n - 7 + (-1)^n)/2. (End)
G.f.: x^2*(5+3*x) / ((1-x)^2*(1+x)). - Colin Barker, Aug 25 2016
From Franck Maminirina Ramaharo, Jul 23 2018: (Start)
a(n) = A047470(n) - (-1)^(n - 1) + 1.
E.g.f.: (6 + exp(-x) + (8*x - 7)*exp(x))/2. (End)
Sum_{n>=2} (-1)^n/a(n) = log(2)/2 - (sqrt(2)-1)*Pi/16 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 18 2021

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A195605 a(n) = (4*n*(n+2)+(-1)^n+1)/2 + 1.

Original entry on oeis.org

2, 7, 18, 31, 50, 71, 98, 127, 162, 199, 242, 287, 338, 391, 450, 511, 578, 647, 722, 799, 882, 967, 1058, 1151, 1250, 1351, 1458, 1567, 1682, 1799, 1922, 2047, 2178, 2311, 2450, 2591, 2738, 2887, 3042, 3199, 3362, 3527, 3698, 3871, 4050, 4231, 4418, 4607, 4802
Offset: 0

Views

Author

Bruno Berselli, Sep 21 2011 - based on remarks and sequences by Omar E. Pol

Keywords

Comments

Sequence found by reading the numbers in increasing order on the vertical line containing 2 of the square spiral whose vertices are the triangular numbers (A000217) - see Pol's comments in other sequences visible in this numerical spiral.
Also A077591 (without first term) and A157914 interleaved.

Crossrefs

Cf. A047621 (contains first differences), A016754 (contains the sum of any two consecutive terms).

Programs

  • Magma
    [(4*n*(n+2)+(-1)^n+3)/2: n in [0..48]];
    
  • Mathematica
    CoefficientList[Series[(2 + 3 x + 4 x^2 - x^3) / ((1 + x) (1 - x)^3), {x, 0, 50}], x] (* Vincenzo Librandi, Aug 19 2013 *)
    LinearRecurrence[{2,0,-2,1},{2,7,18,31},50] (* Harvey P. Dale, Jan 21 2017 *)
  • PARI
    for(n=0, 48, print1((4*n*(n+2)+(-1)^n+3)/2", "));

Formula

G.f.: (2+3*x+4*x^2-x^3)/((1+x)*(1-x)^3).
a(n) = a(-n-2) = 2*a(n-1)-2*a(n-3)+a(n-4).
a(n) = A047524(A000982(n+1)).
Sum_{n>=0} 1/a(n) = 1/2 + Pi^2/16 - cot(Pi/(2*sqrt(2)))*Pi/(4*sqrt(2)). - Amiram Eldar, Mar 06 2023

A201455 a(n) = 3*a(n-1) + 4*a(n-2) for n>1, a(0)=2, a(1)=3.

Original entry on oeis.org

2, 3, 17, 63, 257, 1023, 4097, 16383, 65537, 262143, 1048577, 4194303, 16777217, 67108863, 268435457, 1073741823, 4294967297, 17179869183, 68719476737, 274877906943, 1099511627777, 4398046511103, 17592186044417, 70368744177663, 281474976710657
Offset: 0

Views

Author

Bruno Berselli, Jan 09 2013

Keywords

Comments

This is the Lucas sequence V(3,-4).
Inverse binomial transform of this sequence is A087451.

Crossrefs

Cf. for the same recurrence with initial values (i,i+1): A015521 (Lucas sequence U(3,-4); i=0), A122117 (i=1), A189738 (i=3).
Cf. for similar closed form: A014551 (2^n+(-1)^n), A102345 (3^n+(-1)^n), A087404 (5^n+(-1)^n).

Programs

  • Magma
    [n le 1 select n+2 else 3*Self(n)+4*Self(n-1): n in [0..25]];
    
  • Mathematica
    RecurrenceTable[{a[n] == 3 a[n - 1] + 4 a[n - 2], a[0] == 2, a[1] == 3}, a[n], {n, 25}]
  • Maxima
    a[0]:2$ a[1]:3$ a[n]:=3*a[n-1]+4*a[n-2]$ makelist(a[n], n, 0, 25);
    
  • PARI
    Vec((2-3*x)/((1+x)*(1-4*x)) + O(x^30)) \\ Michel Marcus, Jun 26 2015

Formula

G.f.: (2-3*x)/((1+x)*(1-4*x)).
a(n) = 4^n+(-1)^n.
a(n) = A086341(A047524(n)) for n>0, a(0)=2.
a(n) = [x^n] ( (1 + 3*x + sqrt(1 + 6*x + 25*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
a(n) = (2/4^n) * Sum_{k = 0..n} binomial(4*n+1, 4*k). - Peter Bala, Feb 06 2019

A047481 Numbers that are congruent to {0, 2, 5, 7} mod 8.

Original entry on oeis.org

0, 2, 5, 7, 8, 10, 13, 15, 16, 18, 21, 23, 24, 26, 29, 31, 32, 34, 37, 39, 40, 42, 45, 47, 48, 50, 53, 55, 56, 58, 61, 63, 64, 66, 69, 71, 72, 74, 77, 79, 80, 82, 85, 87, 88, 90, 93, 95, 96, 98, 101, 103, 104, 106, 109, 111, 112, 114, 117, 119, 120, 122, 125
Offset: 1

Views

Author

Keywords

Comments

Complement of A047415.

Crossrefs

Programs

  • Magma
    I:=[0, 2, 5, 7, 8]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..70]]; // Vincenzo Librandi, May 16 2012
    
  • Maple
    A047481:=n->(-1*((-1)^((n-1)/2-(-1)^n/4-1/4)))/2+2*(n-1)+1/2: seq(A047481(n), n=1..100); # Wesley Ivan Hurt, Jun 01 2016
  • Mathematica
    Select[Range[0,300], MemberQ[{0,2,5,7}, Mod[#,8]]&] (* Vincenzo Librandi, May 16 2012 *)
    LinearRecurrence[{2,-2,2,-1},{0,2,5,7},70] (* Harvey P. Dale, May 28 2017 *)
  • PARI
    a(n)=[-1,0,2,5][n%4]+n\4*8 \\ Charles R Greathouse IV, Mar 05 2014
    
  • PARI
    x='x+O('x^100); concat(0, Vec(x^2*(2+x+x^2)/((1-x)^2*(1+x^2)))) \\ Altug Alkan, Dec 24 2015

Formula

From Colin Barker, May 14 2012: (Start)
a(n) = (1/4+i/4)*((-3+3*i)-i*(-i)^n+i^n+(4-4*i)*n) where i=sqrt(-1).
G.f.: x^2*(2+x+x^2)/((1-x)^2*(1+x^2)). (End)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>4. - Vincenzo Librandi, May 16 2012
a(n) = (-1*((-1)^((n-1)/2-(-1)^n/4-1/4)))/2+2*(n-1)+1/2.
a(n) = cos(n*Pi/2)-1/2*cos((n-1)*Pi/2)-1/2*cos(n*Pi/2)+2*(n-1)+1/2. - Cédric Christian Bernard Gagneux, Mar 05 2014
a(2k) = A047524, a(2k-1) = A047615(k). - Wesley Ivan Hurt, Jun 01 2016
E.g.f.: (2 - sin(x) + cos(x) + (4*x - 3)*exp(x))/2. - Ilya Gutkovskiy, Jun 02 2016
Sum_{n>=2} (-1)^n/a(n) = (3-sqrt(2))*log(2)/8 + sqrt(2)*log(2+sqrt(2))/4 - Pi/16. - Amiram Eldar, Dec 21 2021
Showing 1-10 of 17 results. Next