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.

A187715 a(n) = 5*n - (9 + (-1)^n)/2.

Original entry on oeis.org

1, 5, 11, 15, 21, 25, 31, 35, 41, 45, 51, 55, 61, 65, 71, 75, 81, 85, 91, 95, 101, 105, 111, 115, 121, 125, 131, 135, 141, 145, 151, 155, 161, 165, 171, 175, 181, 185, 191, 195, 201, 205, 211, 215, 221, 225
Offset: 1

Views

Author

Vincenzo Librandi, Mar 13 2011

Keywords

Comments

Numbers congruent to {1,5} mod 10. - Bruno Berselli, Mar 31 2012

Crossrefs

Cf. A001622, A010711 (first differences), A017281, A017329.

Programs

  • GAP
    Filtered([1..250],n-> n mod 10 =1 or n mod 10 = 5); # Muniru A Asiru, Nov 25 2018
    
  • Magma
    [5*n -(9+(-1)^n)/2: n in [1..60]];
    
  • Maple
    [5*n-(9+(-1)^n)/2$n=1..50]; # Muniru A Asiru, Nov 25 2018
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[EvenQ[n+1],a+4,a+6]}; Transpose[NestList[nxt,{1,1},50]][[2]] (* Harvey P. Dale, Feb 16 2013 *)
    Table[BitOr[5*n, 1], {n, 0, 50}] (* Jon Maiga, Nov 24 2018 *)
  • PARI
    vector(50, n, (10*n -9-(-1)^n)/2) \\ G. C. Greubel, Dec 04 2018
    
  • Python
    for n in range(1,60): print(int(5*n - (9 + (-1)**n)/2), end=', ') # Stefano Spezia, Nov 30 2018
    
  • Sage
    [(10*n -9-(-1)^n)/2 for n in (1..50)] # G. C. Greubel, Dec 04 2018

Formula

a(n) = a(n-1) + 4 if n is even, a(n) = a(n-1) + 6 if n is odd.
a(n) = 2*a(n-1) - a(n-2) - 2*(-1)^n.
From R. J. Mathar, Mar 15 2011: (Start)
G.f.: x*(1 + 4*x + 5*x^2)/( (1+x)*(1-x)^2 ).
Bisections: a(2*n+1) = A017281(n), a(2*n) = A017329(n-1). (End)
a(n) = 5*(n-1) bitwise-OR 1. - Jon Maiga, Nov 24 2018
E.g.f.: ((10*x-9)*exp(x) - exp(-x) + 10)/2. - G. C. Greubel, Dec 04 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(5+2*sqrt(5))*Pi/20 + 3*log(phi)/(4*sqrt(5)) + log(5)/8, where phi is the golden ratio (A001622). - Amiram Eldar, Apr 15 2023

Extensions

Definition rewritten by R. J. Mathar, Mar 15 2011