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.

A080512 a(n) = n if n is odd, a(n) = 3*n/2 if n is even.

Original entry on oeis.org

1, 3, 3, 6, 5, 9, 7, 12, 9, 15, 11, 18, 13, 21, 15, 24, 17, 27, 19, 30, 21, 33, 23, 36, 25, 39, 27, 42, 29, 45, 31, 48, 33, 51, 35, 54, 37, 57, 39, 60, 41, 63, 43, 66, 45, 69, 47, 72, 49, 75, 51, 78, 53, 81, 55, 84, 57, 87, 59, 90, 61, 93, 63, 96, 65, 99, 67, 102
Offset: 1

Views

Author

Amarnath Murthy, Mar 20 2003

Keywords

Comments

First differences of the generalized heptagonal numbers A085787. - Omar E. Pol, Sep 10 2011
Last term in n-th row of A080511.
Also A005408 and positive terms of A008585 interleaved. - Omar E. Pol, May 28 2012
a(n) is also the length of the n-th line segment of the rectangular spiral whose vertices are the generalized heptagonal numbers. - Omar E. Pol, Jul 27 2018

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a080512 n = if m == 0 then 3 * n' else n  where (n', m) = divMod n 2
    a080512_list = concat $ transpose [[1, 3 ..], [3, 6 ..]]
    -- Reinhard Zumkeller, Apr 06 2015
  • Magma
    [n*(5+(-1)^n)/4: n in [1..60]]; // Vincenzo Librandi, Sep 11 2011
    
  • Mathematica
    Table[If[EvenQ[n],3n/2,n],{n,68}] (* Jayanta Basu, May 20 2013 *)

Formula

a(n) = n if n is odd, a(n) = 3*n/2 if n is even.
a(n)*a(n+3) = -3 + a(n+1)*a(n+2).
From Paul Barry, Sep 04 2003: (Start)
G.f.: (1+3*x+x^2)/((1-x^2)^2);
a(n) = n*(5 + (-1)^n)/4. (End)
Multiplicative with a(2^e) = 3*2^(e-1), a(p^e) = p^e otherwise. - Christian G. Bower, May 17 2005
Equals A126988 * (1, 1, 0, 0, 0, ...) - Gary W. Adamson, Apr 17 2007
Dirichlet g.f.: zeta(s-1) * (1 + 1/2^s). - Amiram Eldar, Oct 25 2023
Sum_{d divides n} mu(n/d)*a(d) = A126246(n), where mu(n) = A008683(n) is the Möbius function. - Peter Bala, Dec 31 2023