OFFSET
0,5
COMMENTS
Number of vertical pairs in a wheel with n equal sections. - Wesley Ivan Hurt, Jan 22 2012
Number of even terms of n-th row in the triangles A162610 and A209297. - Reinhard Zumkeller, Jan 19 2013
Also the result of writing n-1 in base 2 and multiplying the last digit with the number with its last digit removed. See A115273 and A257844-A257850 for generalization to other bases. - M. F. Hasler, May 10 2015
Also follows the rule: a(n+1) is the number of terms that are identical with a(n) for a(0..n-1). - Marc Morgenegg, Jul 08 2019
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Reinhard Zumkeller, Logical Convolutions
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(n) = XOR{k AND (n-k): 0<=k<=n}.
a(n) = (n/2)*0^(n mod 2); a(2*n)=n and a(2*n+1)=0.
a(n) = floor(n^2/2) mod n. - Enrique Pérez Herrero, Jul 29 2009
a(n) = A027656(n-2). - Reinhard Zumkeller, Nov 05 2009
a(n) = Sum_{k=0..n} (k mod 2)*((n-k) mod 2). - Reinhard Zumkeller, Nov 05 2009
a(n+1) = A000217(n) mod A000027(n+1) = A000217(n) mod A001477(n+1). - Edgar Almeida Ribeiro (edgar.a.ribeiro(AT)gmail.com), May 19 2010
From Bruno Berselli, Oct 19 2010: (Start)
a(n) = n*(1+(-1)^n)/4.
G.f.: x^2/(1-x^2)^2.
a(n) = 2*a(n-2)-a(n-4) for n > 3.
Sum_{i=0..n} a(i) = (2*n*(n+1)+(2*n+1)*(-1)^n-1)/16 (see A008805). (End)
a(n) = Sum_{i=1..n} floor((2*i-n)/2). - Wesley Ivan Hurt, Aug 21 2014
a(n-1) = floor(n/2)*(n mod 2), where (n mod 2) is the parity of n, or remainder of division by 2. - M. F. Hasler, May 10 2015
a(n) = A158416(n) - 1. - Filip Zaludek, Oct 30 2016
E.g.f.: x*sinh(x)/2. - Ilya Gutkovskiy, Oct 30 2016
a(n) = A000007(a(n-1)) + a(n-2) for n > 1. - Nicolas Bělohoubek, Oct 06 2024
MAPLE
MATHEMATICA
Table[Mod[Floor[n^2/2], n], {n, 200}] (* Enrique Pérez Herrero, Jul 29 2009 *)
Riffle[Range[0, 50], 0] (* Paolo Xausa, Feb 08 2024 *)
PROG
(Haskell)
a142150 = uncurry (*) . (`divMod` 2) . (+ 1)
a142150_list = scanl (+) 0 a001057_list
-- Reinhard Zumkeller, Apr 02 2012
(Magma) [n*(1+(-1)^n)/4 : n in [0..100]]; // Wesley Ivan Hurt, Aug 21 2014
(PARI) a(n)=!bittest(n, 0)*n>>1 \\ M. F. Hasler, May 10 2015
(Magma) &cat[[n, 0]: n in [0..50]]; // Vincenzo Librandi, Oct 31 2016
(Python)
def A142150(n): return (n+1>>1)*(n&1^1) # Chai Wah Wu, Jan 19 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Jul 15 2008
STATUS
approved