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-6 of 6 results.

A168276 a(n) = 2*n - (-1)^n - 1.

Original entry on oeis.org

2, 2, 6, 6, 10, 10, 14, 14, 18, 18, 22, 22, 26, 26, 30, 30, 34, 34, 38, 38, 42, 42, 46, 46, 50, 50, 54, 54, 58, 58, 62, 62, 66, 66, 70, 70, 74, 74, 78, 78, 82, 82, 86, 86, 90, 90, 94, 94, 98, 98, 102, 102, 106, 106, 110, 110, 114, 114, 118, 118, 122, 122, 126, 126, 130, 130
Offset: 1

Views

Author

Vincenzo Librandi, Nov 22 2009

Keywords

Crossrefs

Cf. A063210. - R. J. Mathar, Nov 25 2009

Programs

  • Magma
    [2*n-1-(-1)^n: n in [1..70]]; // Vincenzo Librandi, Sep 16 2013
  • Mathematica
    CoefficientList[Series[2 (1 + x^2) / ((1 + x) (1 - x)^2), {x, 0, 80}], x] (* Vincenzo Librandi, Sep 16 2013 *)
    Table[2 n - 1 - (-1)^n, {n, 70}] (* Bruno Berselli, Sep 17 2013 *)
    LinearRecurrence[{1,1,-1},{2,2,6},70] (* Harvey P. Dale, Oct 22 2014 *)

Formula

a(n) = 4*n - a(n-1) - 4, with n>1, a(1)=2.
from R. J. Mathar, Nov 25 2009: (Start)
a(n) = 2*n - (-1)^n - 1.
a(n) = 2*A109613(n-1).
G.f.: 2*x*(1 + x^2)/((1+x)*(1-x)^2). (End)
a(n) = a(n-1) + a(n-2) - a(n-3). - Vincenzo Librandi, Sep 16 2013
a(n) = A168277(n) + 1. - Vincenzo Librandi, Sep 17 2013
E.g.f.: (-1 + 2*exp(x) + (2*x -1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
Sum_{n>=1} 1/a(n)^2 = Pi^2/16. - Amiram Eldar, Aug 21 2022

Extensions

Previous definition replaced with closed-form expression by Bruno Berselli, Sep 17 2013

A186949 a(n) = 2^n - 2*(binomial(1,n) - binomial(0,n)).

Original entry on oeis.org

1, 0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824
Offset: 0

Views

Author

Paul Barry, Mar 01 2011

Keywords

Comments

Binomial transform is A186948.
Second binomial transform is A186947.
Inverse binomial transform is (-1)^n * A168277(n).
Essentially the same as A000079, A151821, A155559, A171449, and A171559.

Programs

  • GAP
    Concatenation([1,0], List([2..30], n-> 2^n )); # G. C. Greubel, Dec 01 2019
  • Magma
    [n lt 2 select 1-n else 2^n: n in [0..30]]; // G. C. Greubel, Dec 01 2019
    
  • Maple
    seq( `if`(n<2, 1-n, 2^n), n=0..30); # G. C. Greubel, Dec 01 2019
  • Mathematica
    Table[If[n<2, 1-n, 2^n], {n, 0, 30}] (* G. C. Greubel, Dec 01 2019 *)
  • PARI
    vector(31, n, if(n<3, 2-n, 2^(n-1))) \\ G. C. Greubel, Dec 01 2019
    
  • Sage
    [1,0]+[2^n for n in (2..30)] # G. C. Greubel, Dec 01 2019
    

Formula

G.f.: (1 - 2*x + 4*x^2)/(1-2*x).
a(n) = Sum_{k=0..n} binomial(n,k)*(3^k - 2*k).
E.g.f.: exp(2*x) - 2*x. - G. C. Greubel, Dec 01 2019

A276914 Subsequence of triangular numbers obtained by adding a square and two smaller triangles, a(n) = n^2 + 2*A000217(A052928(n)).

Original entry on oeis.org

0, 1, 10, 15, 36, 45, 78, 91, 136, 153, 210, 231, 300, 325, 406, 435, 528, 561, 666, 703, 820, 861, 990, 1035, 1176, 1225, 1378, 1431, 1596, 1653, 1830, 1891, 2080, 2145, 2346, 2415, 2628, 2701, 2926, 3003, 3240, 3321, 3570, 3655, 3916, 4005, 4278, 4371, 4656
Offset: 0

Views

Author

Daniel Poveda Parrilla, Sep 22 2016

Keywords

Comments

All terms of this sequence are triangular numbers. Graphically, for each term of the sequence, one corner of the square will be part of the corresponding triangle's hypotenuse if the term is an odd number. Otherwise, it will not be part of it.
a(A276915(n)) is a triangular pentagonal number.
a(A079291(n)) is a triangular square number, as A275496 is a subsequence of this.

Crossrefs

Programs

  • Magma
    [n*(2*n+(-1)^n): n in [0..40]]; // G. C. Greubel, Aug 19 2022
    
  • Mathematica
    Table[n (2 n + (-1)^n), {n, 0, 48}] (* Michael De Vlieger, Sep 23 2016 *)
  • PARI
    concat(0, Vec(x*(1+9*x+3*x^2+3*x^3)/((1-x)^3*(1+x)^2) + O(x^50))) \\ Colin Barker, Sep 23 2016
    
  • SageMath
    [n*(2*n+(-1)^n) for n in (0..40)] # G. C. Greubel, Aug 19 2022

Formula

a(n) = n^2 + 2*A000217(A052928(n)).
a(n) = A000217(A042948(n)).
a(n) = n*(2*n + (-1)^n).
a(n) = n*A168277(n + 1).
a(n) = n*A016813(A004526(n)).
From Colin Barker, Sep 23 2016: (Start)
G.f.: x*(1 + 9*x + 3*x^2 + 3*x^3) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
a(n) = n*(2*n+1) for n even.
a(n) = n*(2*n-1) for n odd. (End)
E.g.f.: x*( 2*(1+x)*exp(x) - exp(-x) ). - G. C. Greubel, Aug 19 2022
Sum_{n>=1} 1/a(n) = 2 - log(2). - Amiram Eldar, Aug 21 2022

A292576 Permutation of the natural numbers partitioned into quadruples [4k-1, 4k-3, 4k-2, 4k], k > 0.

Original entry on oeis.org

3, 1, 2, 4, 7, 5, 6, 8, 11, 9, 10, 12, 15, 13, 14, 16, 19, 17, 18, 20, 23, 21, 22, 24, 27, 25, 26, 28, 31, 29, 30, 32, 35, 33, 34, 36, 39, 37, 38, 40, 43, 41, 42, 44, 47, 45, 46, 48, 51, 49, 50, 52, 55, 53, 54, 56, 59, 57, 58, 60, 63, 61, 62
Offset: 1

Views

Author

Guenther Schrack, Sep 19 2017

Keywords

Comments

Partition the natural number sequence into quadruples starting with (1,2,3,4); swap the second and third elements, then swap the first and the second element; repeat for all quadruples.

Crossrefs

Inverse: A056699(n+1) - 1 for n > 0.
Sequence of fixed points: A008586(n) for n > 0.
Subsequences:
elements with odd index: A042964(A103889(n)) for n > 0.
elements with even index: A042948(n) for n > 0.
odd elements: A166519(n) for n>0.
indices of odd elements: A042963(n) for n > 0.
even elements: A005843(n) for n>0.
indices of even elements: A014601(n) for n > 0.
Sum of pairs of elements:
a(n+2) + a(n) = A163980(n+1) = A168277(n+2) for n > 0.
Difference between pairs of elements:
a(n+2) - a(n) = (-1)^A011765(n+3)*A091084(n+1) for n > 0.
Compound relations:
a(n) = A284307(n+1) - 1 for n > 0.
a(n+2) - 2*a(n+1) + a(n) = (-1)^A011765(n)*A132400(n+1) for n > 0.
Compositions:
a(n) = A116966(A080412(n)) for n > 0.
a(A284307(n)) = A256008(n) for n > 0.
a(A042963(n)) = A166519(n-1) for n > 0.
A256008(a(n)) = A056699(n) for n > 0.

Programs

  • MATLAB
    a = [3 1 2 4]; % Generate b-file
    max = 10000;
    for n := 5:max
       a(n) = a(n-4) + 4;
    end;
    
  • PARI
    for(n=1, 10000, print1(n + ((-1)^(n*(n-1)/2)*(2 - (-1)^n) - (-1)^n)/2, ", "))

Formula

a(1)=3, a(2)=1, a(3)=2, a(4)=4, a(n) = a(n-4) + 4 for n > 4.
O.g.f.: (2*x^3 + x^2 - 2*x + 3)/(x^5 - x^4 - x + 1).
a(n) = n + ((-1)^(n*(n-1)/2)*(2-(-1)^n) - (-1)^n)/2.
a(n) = n + (cos(n*Pi/2) - cos(n*Pi) + 3*sin(n*Pi/2))/2.
a(n) = n + n mod 2 + (ceiling(n/2)) mod 2 - 2*(floor(n/2) mod 2).
Linear recurrence: a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
First Differences, periodic: (-2, 1, 2, 3), repeat; also (-1)^A130569(n)*A068073(n+2) for n > 0.

A213041 Number of triples (w,x,y) with all terms in {0..n} and 2*|w-x| = max(w,x,y) - min(w,x,y).

Original entry on oeis.org

1, 2, 7, 12, 21, 30, 43, 56, 73, 90, 111, 132, 157, 182, 211, 240, 273, 306, 343, 380, 421, 462, 507, 552, 601, 650, 703, 756, 813, 870, 931, 992, 1057, 1122, 1191, 1260, 1333, 1406, 1483, 1560, 1641, 1722, 1807, 1892, 1981, 2070, 2163, 2256
Offset: 0

Views

Author

Clark Kimberling, Jun 10 2012

Keywords

Comments

See A212959 for a guide to related sequences.
For n > 3, a(n-2) is the number of distinct values of the magic constant in a perimeter-magic (n-1)-gon of order n (see A342819). - Stefano Spezia, Mar 23 2021

Crossrefs

Cf. A002620, A004526, A058331, A212959, A168277 (first differences), A342819.

Programs

  • Mathematica
    t = Compile[{{n, _Integer}}, Module[{s = 0},
    (Do[If[Max[w, x, y] - Min[w, x, y] == 2 Abs[w - x],
    s = s + 1],
    {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
    m = Map[t[#] &, Range[0, 45]]   (* A213041 *)
  • PARI
    Vec((1+3*x^2)/((1-x)^3*(1+x)) + O(x^99)) \\ Altug Alkan, May 06 2016

Formula

a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3.
G.f.: (1 + 3*x^2)/((1 - x)^3 * (1 + x)).
a(n) = (n+1)^2 - 2*A004526(n-1) - 2. - Wesley Ivan Hurt, Jul 15 2013
a(n) = A002620(n+2) + 3*A002620(n). - R. J. Mathar, Jul 15 2013
a(n)+a(n+1) = A058331(n+1). - R. J. Mathar, Jul 15 2013
a(n) = n*(n+1) + (1+(-1)^n)/2. - Wesley Ivan Hurt, May 06 2016
E.g.f.: x*(x + 2)*exp(x) + cosh(x). - Ilya Gutkovskiy, May 06 2016
a(n) = A000384(n+1) - A137932(n+2). - Federico Provvedi, Aug 17 2023

A248825 a(n) = n^2 + 1 - (-1)^n.

Original entry on oeis.org

0, 3, 4, 11, 16, 27, 36, 51, 64, 83, 100, 123, 144, 171, 196, 227, 256, 291, 324, 363, 400, 443, 484, 531, 576, 627, 676, 731, 784, 843, 900, 963, 1024, 1091, 1156, 1227, 1296, 1371, 1444, 1523, 1600, 1683, 1764, 1851, 1936, 2027, 2116
Offset: 0

Views

Author

Paul Curtz, Oct 15 2014

Keywords

Comments

Also, A016742 and A164897 interleaved.
See the spiral in Example field of A054552: after 0, the sequence is given by the terms of the semidiagonals 4, 16, 36, 64, 100, ... and 3, 11, 27, 51, 83, ... sorted into ascending order.
Primes of the sequence are in A056899.

Crossrefs

Programs

  • Magma
    [n^2+1-(-1)^n: n in [0..60]]; // Vincenzo Librandi, Oct 16 2014
    
  • Mathematica
    Table[n^2 + 1 - (-1)^n, {n, 0, 60}] (* Vincenzo Librandi, Oct 16 2014 *)
    LinearRecurrence[{2,0,-2,1},{0,3,4,11},60] (* Harvey P. Dale, Jun 30 2019 *)
  • PARI
    vector(100,n,(n-1)^2+1+(-1)^n) \\ Derek Orr, Oct 15 2014
    
  • Sage
    [n^2+1-(-1)^n for n in (0..60)] # Bruno Berselli, Oct 16 2014

Formula

a(n) = a(-n) = 2*a(n-1) - 2*(n-3) + a(n-4).
a(n) = n^2 + A010673(n) = (n+1)^2 - A168277(n+1).
a(n+1) = A248800(n) + A042963(n+1) = a(n) + A166519(n).
a(n+2) = a(n) + 4*n.
a(n+5) = a(n-5) + A008602(n).
G.f.: x*(3 - 2*x + 3*x^2)/((1 + x)*(1 - x)^3). - Bruno Berselli, Oct 15 2014
Sum_{n>=1} 1/a(n) = Pi^2/24 + tanh(Pi/sqrt(2))*Pi/(4*sqrt(2)). - Amiram Eldar, Aug 21 2022

Extensions

Edited by Bruno Berselli, Oct 16 2014
Showing 1-6 of 6 results.