login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A064680 Halve every even number, double every odd number. 16
0, 2, 1, 6, 2, 10, 3, 14, 4, 18, 5, 22, 6, 26, 7, 30, 8, 34, 9, 38, 10, 42, 11, 46, 12, 50, 13, 54, 14, 58, 15, 62, 16, 66, 17, 70, 18, 74, 19, 78, 20, 82, 21, 86, 22, 90, 23, 94, 24, 98, 25, 102, 26, 106, 27, 110, 28, 114, 29, 118, 30, 122, 31, 126, 32, 130, 33, 134, 34, 138, 35 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

a(a(m)) = m for all m with gcd(m, 4) <= 2.

LINKS

Harry J. Smith, Table of n, a(n) for n = 0..1000, (corrected by Peter Luschny, Jan 19 2019)

Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).

FORMULA

a(n) = n * 2^(2 * (n mod 2) - 1).

G.f.: x*(2+x+2*x^2)/(1-x^2)^2.

a(n) = 2*a(n-2) - a(n-4) for n>3.

a(n)*a(n+3) = -2 + a(n+1)*a(n+2).

a(2*n) = A001477(n), a(1+2*n) = A016825(n). - Paul Curtz, Mar 09 2011

a(n) = n*(5-3*(-1)^n)/4. - Bruno Berselli, Mar 09 2011

a(n)= (period 4 sequence: repeat 2, 2, 1, 2) * (A060819(n)=0,1,1,3,1,5,...). - Paul Curtz, Mar 10 2011

E.g.f.: x*(sinh(x) + 4*cosh(x))/2. - Ilya Gutkovskiy, Jul 24 2016

a(n) = lcm(numerator(n/2), denominator(n/2)). - Wesley Ivan Hurt, Jul 24 2016

a(n) = A176447(n) + n. - Filip Zaludek, Dec 10 2016

MAPLE

A064680:=n->n*(5-3*(-1)^n)/4: seq(A064680(n), n=0..100); # Wesley Ivan Hurt, Jul 24 2016

MATHEMATICA

f[n_] := 2^(2 Mod[n, 2] - 1) n; Array[f, 70, 0] (* Or *)

f[n_] := If[ OddQ@ n, 2 n, n/2]; Array[f, 71, 0] (* Or *)

CoefficientList[ Series[x (2 + x + 2 x^2)/(1 - x^2)^2, {x, 0, 70}], x] (* Robert G. Wilson v *)

PROG

(PARI) a(n) = if (n%2, 2*n, n/2); \\ Harry J. Smith, Sep 22 2009

(MAGMA) [IsEven(n) select n/2 else 2*n: n in [0..70]]; // Bruno Berselli, Mar 09 2011

(Haskell)

a064680 n = a064680_list !! n

a064680_list = zipWith ($) (cycle [(`div` 2), (* 2)]) [0..]

-- Reinhard Zumkeller, Jul 25 2012

CROSSREFS

Cf. A001477, A016825, A026741, A060819.

Sequence in context: A076891 A071883 A099304 * A239148 A057560 A085592

Adjacent sequences:  A064677 A064678 A064679 * A064681 A064682 A064683

KEYWORD

nonn,easy

AUTHOR

Reinhard Zumkeller, Oct 16 2001

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 14 19:47 EDT 2020. Contains 336483 sequences. (Running on oeis4.)