login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A168181
Characteristic function of numbers that are not multiples of 8.
16
0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0
OFFSET
0,1
COMMENTS
Multiplicative with a(p^e) = (if p=2 then A019590(e) else 1), p prime and e>0.
Period 8 Repeat: [0, 1, 1, 1, 1, 1, 1, 1]. - Wesley Ivan Hurt, Jun 21 2014
FORMULA
a(n+8) = a(n);
a(n) = A000007(A010877(n));
a(A047592(n)) = 1; a(A008590(n)) = 0;
A033440(n) = Sum_{k=0..n} a(k)*(n-k).
Dirichlet g.f. (1-1/8^s)*zeta(s). - R. J. Mathar, Feb 19 2011
For the general case: the characteristic function of numbers that are not multiples of m is a(n) = floor((n-1)/m) - floor(n/m) + 1, m,n > 0. - Boris Putievskiy, May 08 2013
a(n) = sign(n mod 8). - Wesley Ivan Hurt, Jun 21 2014
a(n) = sign( 1 - floor(cos(Pi*n/4)) ). - Wesley Ivan Hurt, Jun 21 2014
Euler transform of length 8 sequence [ 1, 0, 0, 0, 0, 0, -1, 1]. - Michael Somos, Jun 24 2014
Moebius transform is length 8 sequence [ 1, 0, 0, 0, 0, 0, 0, -1]. - Michael Somos, Jun 24 2014
G.f.: x * (1 - x^7) / ((1 - x) * (1 - x^8)). - Michael Somos, Jun 24 2014
a(n) = 1-A253513(n). - Antti Karttunen, Oct 08 2017
EXAMPLE
G.f. = x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^9 + x^10 + x^11 + ...
MAPLE
with(numtheory); A168181:=n->signum(n mod 8); seq(A168181(n), n=0..100); # Wesley Ivan Hurt, Jun 21 2014
MATHEMATICA
Table[Sign[Mod[n, 8]], {n, 0, 100}] (* Wesley Ivan Hurt, Jun 21 2014 *)
PROG
(Magma) [Sign(n mod 8) : n in [0..100]]; // Wesley Ivan Hurt, Jun 21 2014
(PARI) a(n)=n%8 > 0 \\ Felix Fröhlich, Aug 11 2014
(Python)
def A168181(n): return int(bool(n&7)) # Chai Wah Wu, Jul 09 2022
KEYWORD
mult,nonn,easy
AUTHOR
Reinhard Zumkeller, Nov 30 2009
STATUS
approved