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.

A033490 a(n) = 2*a(n-1) + a(floor(n/2)), with a(1) = 1, a(2) = 2.

Original entry on oeis.org

1, 2, 5, 12, 26, 57, 119, 250, 512, 1050, 2126, 4309, 8675, 17469, 35057, 70364, 140978, 282468, 565448, 1131946, 2264942, 4532010, 9066146, 18136601, 36277511, 72563697, 145136069, 290289607, 580596683, 1161228423, 2322491903, 4645054170, 9290178704, 18580498386
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • GAP
    a:= function(n)
        if n<3 then return 2^(n-1);
        else return 2*a(n-1) + a(Int(n/2));
        fi;
      end;
    List([1..40], n-> a(n) ); # G. C. Greubel, Oct 14 2019
  • Magma
    a:= func< n | n lt 3 select 2^(n-1) else 2*Self(n-1) + Self(Floor(n/2)) >;
    [a(n): n in [1..40]]; // G. C. Greubel, Oct 14 2019
    
  • Maple
    A033490 := proc(n) option remember; if n <= 2 then n else A033490(n-1)+A033490(round(2*(n-1)/2))+A033490(round((n-1)/2)); fi; end;
  • Mathematica
    a[n_]:= a[n]= If[n<3, 2^(n-1), 2*a[n-1] + a[Floor[n/2]]]; Table[a[n], {n, 40}] (* G. C. Greubel, Oct 14 2019 *)
  • PARI
    a=vector(99,i,i);for(n=3,#a,a[n]=2*a[n-1]+a[n\2]);a \\ Charles R Greathouse IV, Nov 29 2011
    
  • Sage
    @CachedFunction
    def a(n):
        if (n<3): return 2^(n-1)
        else: return 2*a(n-1) +a(floor(n/2))
    [a(n) for n in (1..40)] # G. C. Greubel, Oct 14 2019
    

Extensions

Terms a(30) onward added by G. C. Greubel, Oct 14 2019

A033497 a(n) = 2*a(n-1) + a(floor(n/2)), with a(1) = 1, a(2) = 2, a(3) = 4.

Original entry on oeis.org

1, 2, 4, 10, 22, 48, 100, 210, 430, 882, 1786, 3620, 7288, 14676, 29452, 59114, 118438, 237306, 475042, 950966, 1902814, 3807414, 7616614, 15236848, 30477316, 60961920, 121931128, 243876932, 487768540, 975566532, 1951162516, 3902384146, 7804827406, 15609773250
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • GAP
    a:= function(n)
        if n<4 then return 2^(n-1);
        else return 2*a(n-1) + a(Int(n/2));
        fi;
      end;
    List([1..40], n-> a(n) ); # G. C. Greubel, Oct 14 2019
  • Magma
    a:= func< n | n lt 4 select 2^(n-1) else 2*Self(n-1) + Self(Floor(n/2)) >;
    [a(n): n in [1..40]]; // G. C. Greubel, Oct 14 2019
    
  • Maple
    A033497 := proc(n) option remember; if n <= 3 then 2^(n-1) else A033497(n-1)+A033497(round(2*(n-1)/2))+A033497(round((n-1)/2)); fi; end;
  • Mathematica
    a[1]=1;a[2]=2;a[3]=4;a[n_]:=a[n]=2a[n-1]+a[Floor[n/2]]; Array[a,40] (* Harvey P. Dale, Aug 08 2019 *)
    a[n_]:= a[n]= If[n<4, 2^(n-1), 2*a[n-1] + a[Floor[n/2]]]; Table[a[n], {n, 40}] (* G. C. Greubel, Oct 14 2019 *)
  • PARI
    a=vector(99,i,i*(i-1)/2+1);for(n=4,#a,a[n]=2*a[n-1]+a[n\2]);a \\ Charles R Greathouse IV, Nov 29 2011
    
  • Sage
    @CachedFunction
    def a(n):
        if (n<4): return 2^(n-1)
        else: return 2*a(n-1) +a(floor(n/2))
    [a(n) for n in (1..40)] # G. C. Greubel, Oct 14 2019
    

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.