A253513 The characteristic function of the multiples of eight.
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
Links
- Antti Karttunen, Table of n, a(n) for n = 0..16384
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,1).
Programs
-
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 *)
-
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
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)
Comments