login
A267142
The characteristic function of the multiples of 9.
6
1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
OFFSET
0
COMMENTS
Decimal expansion of 100000000/999999999.
Period 9: repeat [1, 0, 0, 0, 0, 0, 0, 0, 0].
More generally, the ordinary generating function for the characteristic function of the multiples of k is 1/(1 - x^k).
FORMULA
G.f.: 1/(1 - x^9) = -1 / ( (x-1)*(1+x+x^2)*(x^6+x^3+1) ).
a(n) = abs(sign(n mod 9) - 1).
a(n) = abs(A168182(n)-1).
A007953(a(n)*n) mod 9 = 0.
MATHEMATICA
Table[Boole[Divisible[n, 9]], {n, 0, 115}]
Table[Abs[Sign[Mod[n, 9]] - 1], {n, 0, 115}]
CoefficientList[Series[1 / (1 - x^9), {x, 0, 100}], x] (* Vincenzo Librandi, Jan 11 2016 *)
PROG
(Magma) &cat[&cat[[1], [0]^^8]^^14]; // Vincenzo Librandi, Jan 11 2016
(PARI) a(n) = n\9 - (n-1)\9; \\ Altug Alkan, Jan 11 2016
(PARI) A267142(n) = !(n%9); \\ Antti Karttunen, Oct 07 2017
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Jan 11 2016
STATUS
approved