A168185 Characteristic function of numbers that are not multiples of 12.
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
- Index entries for characteristic functions
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,0,0,1).
Crossrefs
Programs
-
Maple
a:=n->`if`(modp(n,12)=0,0,1); seq(a(n),n=0..150); # Muniru A Asiru, Sep 21 2018
-
Mathematica
If[Divisible[#,12],0,1]&/@Range[0,120] (* Harvey P. Dale, Apr 03 2015 *)
-
PARI
a(n)=!!(n%12) \\ Charles R Greathouse IV, Aug 21 2011
Formula
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
Comments