login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A022998 If n is odd then n else 2n. 40
0, 1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32, 17, 36, 19, 40, 21, 44, 23, 48, 25, 52, 27, 56, 29, 60, 31, 64, 33, 68, 35, 72, 37, 76, 39, 80, 41, 84, 43, 88, 45, 92, 47, 96, 49, 100, 51, 104, 53, 108, 55, 112, 57, 116, 59, 120, 61, 124, 63, 128, 65, 132, 67 (list; graph; refs; listen; history; internal format)
OFFSET

0,3

COMMENTS

Also for n>0: numerator of sum{2/(i*(i+1))|1<=i<=n}, denominator=A026741. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Jul 25 2002

For n>2: a(n) = GCD(A143051((n-1)^2),A143051(1+(n-1)^2)) = A050873(A000290(n-1),A002522(n-1)). - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Jul 20 2008

Partial sums give the generalized octagonal numbers A001082. - Omar E. Pol, Sep 10 2011

Multiples of 4 and odd numbers interleaved. - Omar E. Pol, Sep 25 2011

The Pisano period lengths modulo m appear to be A066043(m). - R. J. Mathar, Oct 08 2011

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 0..10000

Index to sequences with linear recurrences with constant coefficients, signature (0,2,0,-1).

FORMULA

Denominator of (n+1)*(n-1)*(2*n+1)/(2*n) (for n>0).

a(n+1) = lcm(n, n+2)/n + lcm(n, n+2)/(n+2) for all n >= 1 - Asher Auel (asher.auel(AT)reed.edu) Dec 15 2000

Multiplicative with a(2^e)=2^(e+1), a(p^e)=p^e, p>2.

G.f. x(x^2+4x+1)/(1-x^2)^2. - Ralf Stephan, Jun 10 2003

a(n) = 3n/2+n(-1)^n/2 = n(3+(-1)^n)/2. - Paul Barry (pbarry(AT)wit.ie), Sep 04 2003

a(n) = A059029(n-1)+1 = A043547(n+2)-2.

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

a(n) = n*(mod(n+1,2)+1) = n^2 + 2n - 2n*floor((n+1)/2) - William A. Tedeschi (fynmun(AT)hotmail.com), Feb 29 2008

Contribution from Johannes W. Meijer (meijgia(AT)hotmail.com), Jun 18 2009: (Start)

a(n) = denom((n+1)/(2*n)) for n =>1; A026741 (n+1) = numer((n+1)/(2*n)) for n =>1.

(End)

a(n) = 2*a(n-2)-a(n-4).

Dirichlet g.f. zeta(s-1)*(1+2^(1-s)). - R. J. Mathar, Mar 10 2011

MAPLE

A022998 := proc(n) if type(n, 'odd') then n ; else 2*n; end if; end proc: # R. J. Mathar, Mar 10 2011

PROG

(PARI) a(n)=if(n%2, n, 2*n)

(Other) sage: [n/2*power_mod(2, n, 6) for n in xrange(0, 68)] #A [From Zerinvary Lajos (zerinvarylajos(AT)yahoo.com), Nov 03 2009]

(MAGMA) [((-1)^n+3)*n/2: n in [0..70]]; // Vincenzo Librandi, Sep 17 2011

CROSSREFS

Cf. A059026.

Column 4 of A195151. - Omar E. Pol, Sep 25 2011

Sequence in context: A092383 A156028 A021232 * A082895 A086938 A126084

Adjacent sequences:  A022995 A022996 A022997 * A022999 A023000 A023001

KEYWORD

nonn,easy,mult

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

EXTENSIONS

More terms from Michael Somos, Aug 07 2000.

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 11:46 EST 2012. Contains 206011 sequences.