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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A065599 If n odd, a(n) = n^2 else a(n) = n. 3
0, 1, 2, 9, 4, 25, 6, 49, 8, 81, 10, 121, 12, 169, 14, 225, 16, 289, 18, 361, 20, 441, 22, 529, 24, 625, 26, 729, 28, 841, 30, 961, 32, 1089, 34, 1225, 36, 1369, 38, 1521, 40, 1681, 42, 1849, 44, 2025, 46, 2209, 48, 2401, 50, 2601, 52, 2809, 54, 3025, 56, 3249 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

a(n) = ABS(alternating sum of n-th row of the triangle in A176271), n>0. [Reinhard Zumkeller, Apr 13 2010]

LINKS

Harry J. Smith, Table of n, a(n) for n = 0..1000

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

FORMULA

a(n) = n^( n (mod 2) + 1 ).

O.g.f.: (x + 2*x^2 + 6*x^3 - 2*x^4 + x^5)/(1 - x^2)^3. - Len Smiley, Dec 04 2001

a(n) = A000217(n)-(-1)^n*A000217(n-1) with A000217(-1)=0. [Bruno Berselli, Jun 07 2013]

MATHEMATICA

Table[ n^(Mod[n, 2] + 1), {n, 1, 60} ]

LinearRecurrence[{0, 3, 0, -3, 0, 1}, {0, 1, 2, 9, 4, 25}, 80] (* Harvey P. Dale, Sep 10 2017 *)

PROG

(PARI) { for (n = 0, 1000, if (n%2, a=n^2, a=n); write("b065599.txt", n, " ", a) ) } // Harry J. Smith, Oct 23 2009

CROSSREFS

Sequence in context: A228967 A213821 A022157 * A171228 A328618 A318680

Adjacent sequences:  A065596 A065597 A065598 * A065600 A065601 A065602

KEYWORD

nonn,easy

AUTHOR

George E. Antoniou (george.antoniou(AT)montclair.edu), Dec 01 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 November 18 09:46 EST 2019. Contains 329261 sequences. (Running on oeis4.)