%I #20 Sep 08 2022 08:46:15
%S 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,
%T 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,
%U 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
%N The characteristic function of the multiples of 9.
%C Decimal expansion of 100000000/999999999.
%C Period 9: repeat [1, 0, 0, 0, 0, 0, 0, 0, 0].
%C More generally, the ordinary generating function for the characteristic function of the multiples of k is 1/(1 - x^k).
%H Antti Karttunen, <a href="/A267142/b267142.txt">Table of n, a(n) for n = 0..999</a>
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%H <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,0,1).
%F G.f.: 1/(1 - x^9) = -1 / ( (x-1)*(1+x+x^2)*(x^6+x^3+1) ).
%F a(n) = abs(sign(n mod 9) - 1).
%F a(n) = abs(A168182(n)-1).
%F A007953(a(n)*n) mod 9 = 0.
%t Table[Boole[Divisible[n, 9]], {n, 0, 115}]
%t Table[Abs[Sign[Mod[n, 9]] - 1], {n, 0, 115}]
%t CoefficientList[Series[1 / (1 - x^9), {x, 0, 100}], x] (* _Vincenzo Librandi_, Jan 11 2016 *)
%o (Magma) &cat[&cat[[1],[0]^^8]^^14]; // _Vincenzo Librandi_, Jan 11 2016
%o (PARI) a(n) = n\9 - (n-1)\9; \\ _Altug Alkan_, Jan 11 2016
%o (PARI) A267142(n) = !(n%9); \\ _Antti Karttunen_, Oct 07 2017
%Y Cf. A008591, A079978, A079979, A079998, A082784, A121262, A168182, A253513.
%K nonn,easy
%O 0
%A _Ilya Gutkovskiy_, Jan 11 2016
|