OFFSET
1,2
COMMENTS
First differences of the generalized heptagonal numbers A085787. - Omar E. Pol, Sep 10 2011
Last term in n-th row of A080511.
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
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
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
MATHEMATICA
Table[If[EvenQ[n], 3n/2, n], {n, 68}] (* Jayanta Basu, May 20 2013 *)
PROG
(Magma) [n*(5+(-1)^n)/4: n in [1..60]]; // Vincenzo Librandi, Sep 11 2011
(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
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Amarnath Murthy, Mar 20 2003
STATUS
approved