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-3 of 3 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

A039721 a(1) = 1, a(m+1) = 2*Sum_{k=1..floor((m+1)/2)} a(m+1-k).

Original entry on oeis.org

1, 2, 4, 12, 32, 96, 280, 840, 2496, 7488, 22400, 67200, 201408, 604224, 1812112, 5436336, 16307328, 48921984, 146760960, 440282880, 1320833664, 3962500992, 11887458176, 35662374528, 106986989184, 320960967552, 962882499840, 2888647499520, 8665941290112
Offset: 1

Views

Author

Leroy Quet, Dec 11 1999

Keywords

Examples

			a(6)=2*(a(5)+a(4)+a(3)) = 2*(32+12+4) = 96.
		

Crossrefs

Cf. A039722 (similar definition).

Programs

  • Maple
    a[1]:= 1;
    for m from 1 to 100 do
       a[m+1]:= 2*add(a[m+1-k],k=1..floor((m+1)/2));
    od:
    seq(a[i],i=1..100); # Robert Israel, May 18 2014
  • Mathematica
    Fold[Append[#1, 2 Total[#1[[#2 - Range[Floor[#2/2] ] ]] ] ] &, {1}, Range[2, 29]] (* Michael De Vlieger, Dec 11 2017 *)
  • PARI
    lista(nn) = {v = vector(nn); v[1] = 1; for (n=2, nn, v[n] = 2*sum(k=1, n\2, v[n-k]);); v;} \\ Michel Marcus, May 18 2014

Formula

a(1)=1, a(2)=2, a(2m+1)=3*a(2m)-2*a(m), a(2m+2)=3*a(2m+1) (m is positive integer).

Extensions

More terms from James Sellers, May 04 2000
Two more terms from Michel Marcus, May 18 2014

A347027 a(1) = 1; a(n) = a(n-1) + 2 * a(floor(n/2)).

Original entry on oeis.org

1, 3, 5, 11, 17, 27, 37, 59, 81, 115, 149, 203, 257, 331, 405, 523, 641, 803, 965, 1195, 1425, 1723, 2021, 2427, 2833, 3347, 3861, 4523, 5185, 5995, 6805, 7851, 8897, 10179, 11461, 13067, 14673, 16603, 18533, 20923, 23313, 26163, 29013, 32459, 35905, 39947, 43989
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 11 2021

Keywords

Crossrefs

Partial sums of A039722.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = a[n - 1] + 2 a[Floor[n/2]]; Table[a[n], {n, 1, 47}]
    nmax = 47; A[] = 0; Do[A[x] = (x + 2 (1 + x) A[x^2])/(1 - x) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x] // Rest
  • Python
    from collections import deque
    from itertools import islice
    def A347027_gen(): # generator of terms
        aqueue, f, b, a = deque([3]), True, 1, 3
        yield from (1, 3)
        while True:
            a += 2*b
            yield a
            aqueue.append(a)
            if f: b = aqueue.popleft()
            f = not f
    A347027_list = list(islice(A347027_gen(),40)) # Chai Wah Wu, Jun 08 2022

Formula

G.f. A(x) satisfies: A(x) = (x + 2 * (1 + x) * A(x^2)) / (1 - x).
a(n) = 1 + 2 * Sum_{k=2..n} a(floor(k/2)).
Showing 1-3 of 3 results.