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

A277789 a(n) = Sum_{k=0..n} (-1)^k*floor((1 + sqrt(2))^k).

Original entry on oeis.org

1, -1, 4, -10, 23, -59, 138, -340, 813, -1973, 4752, -11486, 27715, -66927, 161558, -390056, 941657, -2273385, 5488412, -13250226, 31988847, -77227939, 186444706, -450117372, 1086679429, -2623476253, 6333631912, -15290740102, 36915112091, -89120964311, 215157040686, -519435045712, 1254027132081
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 31 2016

Keywords

Comments

Alternating sum of A080039.

Crossrefs

Programs

  • Magma
    I:=[1,-1,4,-10,23]; [n le 5 select I[n] else -Self(n-1)+4*Self(n-2)-3*Self(n-4)+Self(n-5): n in [1..35]]; // Vincenzo Librandi, Nov 01 2016
    
  • Maple
    f:= gfun:-rectoproc({a(n) = -a(n-1) + 4*a(n-2) - 3*a(n-4) + a(n-5),seq(a(i)=[ 1, -1, 4, -10, 23][i+1],i=0..4)},a(n),remember):
    map(f, [$0..40]); # Robert Israel, Oct 31 2016
  • Mathematica
    Accumulate[Table[(-1)^n Floor[(1 + Sqrt[2])^n], {n, 0, 32}]]
    LinearRecurrence[{-1, 4, 0, -3, 1}, {1, -1, 4, -10, 23}, 33]
  • PARI
    x='x+O('x^30); Vec((1-x^2-2*x^3)/((1-x)^2*(1+x)*(1+2*x-x^2))) \\ G. C. Greubel, Sep 30 2018

Formula

O.g.f.: (1 - x^2 - 2*x^3)/((1 - x)^2*(1 + x)*(1 + 2*x - x^2)).
E.g.f.: ((-4*sqrt(2)*sinh(sqrt(2)*x) - 1)*exp(-x) + (5 - 2*x)*exp(x))/4.
a(n) = -a(n-1) + 4*a(n-2) - 3*a(n-4) + a(n-5).
a(n) = (2*sqrt(2)*(-1 - sqrt(2))^n - 2*sqrt(2)*(sqrt(2) - 1)^n - (-1)^n - 2*n + 5)/4.
a(n) ~ (-1)^n*s^(n+1)/(s + 1), where s is the silver ratio (A014176).

A279101 a(n) = Sum_{k=0..n} ceiling((1 + sqrt(2))^k).

Original entry on oeis.org

1, 4, 10, 25, 59, 142, 340, 819, 1973, 4760, 11486, 27725, 66927, 161570, 390056, 941671, 2273385, 5488428, 13250226, 31988865, 77227939, 186444726, 450117372, 1086679451, 2623476253, 6333631936, 15290740102, 36915112117, 89120964311, 215157040714, 519435045712, 1254027132111, 3027489309905, 7309005751892
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 06 2016

Keywords

Crossrefs

Programs

  • Magma
    m:=40; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+x-2*x^2-x^3-x^4)/((1-x)^2*(1-x-3*x^2-x^3)))); // G. C. Greubel, Oct 10 2018
  • Maple
    Digits:=100: a:=n->add(ceil((1+sqrt(2))^k),k=0..n); seq(a(n),n=0..35); # Muniru A Asiru, Oct 11 2018
  • Mathematica
    Accumulate[Table[Ceiling[(1 + Sqrt[2])^n], {n, 0, 33}]]
    LinearRecurrence[{3, 0, -4, 1, 1}, {1, 4, 10, 25, 59}, 34]
    CoefficientList[Series[(1 + x - 2*x^2 - x^3 - x^4)/((1 - x)^2*(1 - x - 3*x^2 - x^3)), {x, 0, 50}], x] (* or *)
    a[n_]:=(4*(1 + Sqrt[2])^n + 2*Sqrt[2]*(1 + Sqrt[2] )^n - 2*(-2 + Sqrt[2] )*(1 - Sqrt[2] )^n + 2*n - (-1)^n - 3)/4; Simplify[Array[a, 50, 0]] (* Stefano Spezia, Oct 11 2018 *)
  • PARI
    x='x+O('x^40); Vec((1+x-2*x^2-x^3-x^4)/((1-x)^2*(1-x-3*x^2-x^3))) \\ G. C. Greubel, Oct 10 2018
    

Formula

G.f.: (1 + x - 2*x^2 - x^3 - x^4)/((1 - x)^2*(1 - x - 3*x^2 - x^3)).
a(n) = 3*a(n-1) - 4*a(n-3) + a(n-4) + a(n-5).
a(n) = (4*(1 + sqrt(2))^n + 2*sqrt(2)*(1 + sqrt(2))^n - 2*(-2 + sqrt(2))*(1 - sqrt(2))^n + 2*n - (-1)^n - 3)/4.
a(n) ~ s^(n+1)/(s-1), where s is the silver ratio (A014176).
Showing 1-2 of 2 results.