|
|
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) = 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
|
|
LINKS
|
|
|
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
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
|
|
|
MATHEMATICA
|
|
|
PROG
|
(Haskell)
a096777 n = a096777_list !! (n-1)
a096777_list = 1 : zipWith (+) a096777_list
(scanl1 (+) (map (`mod` 2) a096777_list))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|