login
The twice repeated nonnegative integers at even indices, the non-repeated nonnegative integers at odd indices.
1

%I #26 Oct 07 2018 11:19:02

%S 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,

%T 15,8,16,8,17,9,18,9,19,10,20,10,21,11,22,11,23,12,24,12,25,13,26,13,

%U 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

%N The twice repeated nonnegative integers at even indices, the non-repeated nonnegative integers at odd indices.

%F a(2*n) = A004526(n) = floor(n/2). a(2*n+1) = A001477(n) = n.

%F O.g.f.: (x^2+x+1)*x^3/((x-1)^2*(1+x)^2*(1+x^2)). - _R. J. Mathar_, Jul 07 2008

%F a(n) = A005044(n+2) - A005044(n-7). - _Johannes W. Meijer_, Oct 08 2013

%F a(n) = Sum_{i=1..floor(n/2)} sign((n-2i) mod 4). - _Wesley Ivan Hurt_, Apr 10 2018

%F a(n) = A106466(n-3) for n>=3. - _Georg Fischer_, Oct 07 2018

%p 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

%t Table[Sum[Sign[Mod[n - 2 i, 4]], {i, Floor[n/2]}], {n, 0, 100}] (* _Wesley Ivan Hurt_, Apr 10 2018 *)

%o (PARI) a(n) = if(n%2, n\2, n\4); \\ _Altug Alkan_, Apr 16 2018

%Y Cf. A001477, A004526, A005044.

%K nonn,easy

%O 0,6

%A _Paul Curtz_, Aug 16 2007

%E Edited by _R. J. Mathar_, Jul 07 2008