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!)
A096777 a(n) = a(n-1) + Sum_{k=1..n-1}(a(k) mod 2), a(1) = 1. 9
1, 2, 3, 5, 8, 11, 15, 20, 25, 31, 38, 45, 53, 62, 71, 81, 92, 103, 115, 128, 141, 155, 170, 185, 201, 218, 235, 253, 272, 291, 311, 332, 353, 375, 398, 421, 445, 470, 495, 521, 548, 575, 603, 632, 661, 691, 722, 753, 785, 818, 851, 885, 920, 955, 991, 1028 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(n+1) - a(n) = A004396(n).

a(n) = a(n-1) + (number of odd terms so far in the sequence). Example: 15 is 11 + 4 odd terms so far in the sequence (they are 1,3,5,11). See A007980 for the same construction with even integers. - Eric Angelini, Aug 05 2007

A016789 and A032766 give positions where even and odd terms occur; a(3*n)=A056106(n); a(3*n-1)=A077588(n); a(3*n-2)=A056108(n). - Reinhard Zumkeller, Dec 29 2007

LINKS

R. Zumkeller, Table of n, a(n) for n = 1..10000

J.-L. Baril, T. Mansour, A. Petrossian, Equivalence classes of permutations modulo excedances, 2014.

Eric Weisstein's World of Mathematics, Odd Number

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

FORMULA

a(n) = floor(n/3) * (3*floor(n/3) + 2*(n mod 3) - 1) + n mod 3 + 0^(n mod 3). - Reinhard Zumkeller, Dec 29 2007

a(n) = floor((n-2)^2/3) + n. - Christopher Hunt Gribble, Mar 06 2014

G.f.: -x*(x^4+1) / ((x-1)^3*(x^2+x+1)). - Colin Barker, Mar 07 2014

Euler transform of finite sequence [2, 0, 1, 1, 0, 0, 0, -1]. - Michael Somos, Apr 18 2020

EXAMPLE

G.f. = x + 2*x^2 + 3*x^3 + 5*x^4 + 8*x^5 + 11*x^6 + 15*x^7 + 20*x^8 + ... - Michael Somos, Apr 18 2020

MAPLE

A096777:=n->n + floor((n-2)^2/3); seq(A096777(n), n=1..100); # Wesley Ivan Hurt, Mar 06 2014

MATHEMATICA

Table[n + Floor[(n-2)^2/3], {n, 100}] (* Wesley Ivan Hurt, Mar 06 2014 *)

PROG

(PARI) a(n)=(n-2)^2\3+n \\ Charles R Greathouse IV, Mar 06 2014

(Haskell)

a096777 n = a096777_list !! (n-1)

a096777_list = 1 : zipWith (+) a096777_list

                               (scanl1 (+) (map (`mod` 2) a096777_list))

-- Reinhard Zumkeller, Mar 11 2014

(MAGMA) [Floor((n-2)^2/3)+n: n in [1..60]]; // Vincenzo Librandi, Dec 27 2015

CROSSREFS

Cf. A131093, A097602.

Sequence in context: A062485 A175143 A137179 * A125811 A281706 A071424

Adjacent sequences:  A096774 A096775 A096776 * A096778 A096779 A096780

KEYWORD

nonn,easy

AUTHOR

Reinhard Zumkeller, Jul 09 2004

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 February 24 18:55 EST 2021. Contains 341584 sequences. (Running on oeis4.)