A130722 The twice repeated nonnegative integers at even indices, the non-repeated nonnegative integers at odd indices.
0, 0, 0, 1, 1, 2, 1, 3, 2, 4, 2, 5, 3, 6, 3, 7, 4, 8, 4, 9, 5, 10, 5, 11, 6, 12, 6, 13, 7, 14, 7, 15, 8, 16, 8, 17, 9, 18, 9, 19, 10, 20, 10, 21, 11, 22, 11, 23, 12, 24, 12, 25, 13, 26, 13, 27, 14, 28, 14, 29, 15, 30, 15, 31, 16, 32, 16, 33, 17, 34, 17, 35, 18, 36, 18, 37, 19, 38, 19, 39
Offset: 0
Programs
-
Maple
a := n -> A005044(n+2) - A005044(n-7): A005044 := n -> floor((1/48)*(n^2 + 3*n + 21 + (-1)^(n-1)*3*n)): seq(a(n), n=0..79); # Johannes W. Meijer, Oct 08 2013
-
Mathematica
Table[Sum[Sign[Mod[n - 2 i, 4]], {i, Floor[n/2]}], {n, 0, 100}] (* Wesley Ivan Hurt, Apr 10 2018 *)
-
PARI
a(n) = if(n%2, n\2, n\4); \\ Altug Alkan, Apr 16 2018
Formula
O.g.f.: (x^2+x+1)*x^3/((x-1)^2*(1+x)^2*(1+x^2)). - R. J. Mathar, Jul 07 2008
a(n) = Sum_{i=1..floor(n/2)} sign((n-2i) mod 4). - Wesley Ivan Hurt, Apr 10 2018
a(n) = A106466(n-3) for n>=3. - Georg Fischer, Oct 07 2018
Extensions
Edited by R. J. Mathar, Jul 07 2008