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.

A098180 Odd numbers with twice the odd numbers repeated in order between them.

Original entry on oeis.org

1, 2, 2, 3, 5, 6, 6, 7, 9, 10, 10, 11, 13, 14, 14, 15, 17, 18, 18, 19, 21, 22, 22, 23, 25, 26, 26, 27, 29, 30, 30, 31, 33, 34, 34, 35, 37, 38, 38, 39, 41, 42, 42, 43, 45, 46, 46, 47, 49, 50, 50, 51, 53, 54, 54, 55, 57, 58, 58, 59, 61, 62, 62, 63, 65, 66, 66, 67, 69, 70, 70, 71
Offset: 0

Views

Author

Paul Barry, Aug 30 2004

Keywords

Comments

Partial sums of A098178.
Also A042968 with the even terms repeated. - Michel Marcus, Apr 14 2015
Fixed points are [2,3,6,7,10,11,..] = A042964. - Wesley Ivan Hurt, Oct 13 2015

Crossrefs

Programs

  • Magma
    [Floor((2*n+1-(-1)^((n+1)*(n+2)/2))/2): n in [0..80]]; // Vincenzo Librandi, Apr 13 2015
    
  • Maple
    A098180:=n->(2*n+1-(-1)^((n+1)*(n+2)/2))/2: seq(A098180(n), n=0..100); # Wesley Ivan Hurt, Apr 12 2015
  • Mathematica
    Table[(2 n + 1 - (-1)^((n + 1) (n + 2)/2))/2, {n, 0, 40}] (* Wesley Ivan Hurt, Apr 12 2015 *)
  • PARI
    first(n) = Vec((1+x)*(1-x+x^2)/((1-x)^2*(1+x^2)) + O(x^n)) \\ Iain Fox, Oct 17 2018
    
  • PARI
    a(n) = (2*n+1-(-1)^((n+1)*(n+2)/2))/2 \\ Iain Fox, Oct 17 2018

Formula

G.f.: (1+x)(1-x+x^2)/((1-x)^2(1+x^2)).
a(n) = sqrt(2)*sin(Pi*n/2+Pi/4)/2+n+1/2.
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4), n>3.
From Wesley Ivan Hurt, Apr 12 2015, Oct 13 2015: (Start)
a(n) = (2n+1-(-1)^((n+1)*(n+2)/2))/2.
a(n) = n + A002265(n) - A002265(n-2). (End)
E.g.f: (exp(-i*x)*((1+i) + (1-i)*exp(2*i*x) + exp((1+i)*x)*(2+4*x)))/4, where i = sqrt(-1). - Iain Fox, Oct 17 2018