login
A253513
The characteristic function of the multiples of eight.
5
1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
OFFSET
0,1
COMMENTS
Period 8: repeat [1, 0, 0, 0, 0, 0, 0, 0].
FORMULA
a(n) = floor(n/8) - floor((n-1)/8).
a(n) = sin((sin(Pi*(n+1)/2)^2)*Pi*(n+2)/4)/2 + (sin(Pi*(n+1)/2)^2)/4 + sin(Pi*(n+1)/2)/4.
a(n) = abs(A014025(n)).
From Alois P. Heinz, Jan 03 2015: (Start)
a(n) = 1 - A168181(n).
G.f.: 1/(1-x^8). (End)
MATHEMATICA
Table[Boole[IntegerQ[n/8]], {n, 0, 127}] (* Michael De Vlieger, Jan 03 2015, after Alonso del Arte at A121262 *)
LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0}, 120] (* or *) PadRight[ {}, 120, {1, 0, 0, 0, 0, 0, 0, 0}] (* Harvey P. Dale, Apr 07 2017 *)
Array[ Boole[ Mod[#, 8] == 0] &, 105, 0] (* Robert G. Wilson v, Oct 08 2017 *)
PROG
(PARI) A253513(n) = !(n%8); \\ Antti Karttunen, Oct 08 2017
(Python)
def A253513(n): return int(not(n&7)) # Chai Wah Wu, Jul 09 2022
CROSSREFS
Cf. A008590 (multiples of 8), A010877, A014025, A168181, A244413.
Sequence in context: A052434 A369034 A015241 * A014025 A279760 A287457
KEYWORD
nonn,easy
AUTHOR
Mikael Aaltonen, Jan 03 2015
STATUS
approved