login
Characteristic function of numbers that are congruent to {0, 1, 3, 4} mod 5.
1

%I #35 Dec 12 2023 07:41:07

%S 1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,

%T 1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,

%U 1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1

%N Characteristic function of numbers that are congruent to {0, 1, 3, 4} mod 5.

%C a(n) is also the characteristic sequence for the mod m reduced odd numbers (i.e., gcd(2*n+1,m)=1, n>=0) for each modulus m from 5*A003592 = [5, 10, 20, 25, 40, 50, 80, 100, 125,...]. [_Wolfdieter Lang_, Feb 04 2012]

%H Antti Karttunen, <a href="/A179850/b179850.txt">Table of n, a(n) for n = 0..4999</a>

%H Michael Somos, <a href="http://grail.eecs.csuohio.edu/~somos/rfmc.html">Rational Function Multiplicative Coefficients</a>

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,1).

%F a(n) = b(2*n + 1) where b(n) is completely multiplicative with b(2) = b(5) = 0, otherwise b(p) = 1.

%F Coefficient of q^(2*n + 1) in q * (1 - q^4) * (1 - q^12) / ((1 - q^2) * (1 - q^6) * (1 - q^10)).

%F Euler transform of length 6 sequence [1, -1, 1, 0, 1, -1].

%F G.f.: (1 + x) * (1 + x^3) / (1 - x^5).

%F a(n) = a(-n) = a(n + 5) = A011558(n + 3) for all n in Z.

%F Period 5 sequence [1, 1, 0, 1, 1, ...].

%F a(n) = A130782(n) mod 2. - _Antti Karttunen_, Aug 31 2017

%e G.f. = 1 + x + x^3 + x^4 + x^5 + x^6 + x^8 + x^9 + x^10 + x^11 + x^13 + ...

%e G.f. = q + q^3 + q^7 + q^9 + q^11 + q^13 + q^17 + q^19 + q^21 + q^23 + ...

%t a[ n_] := Sign @ Mod[n - 2, 5]; (* _Michael Somos_, Jun 17 2015 *)

%t a[ n_] := {1, 0, 1, 1, 1}[[Mod[n, 5, 1]]]; (* _Michael Somos_, Jun 17 2015 *)

%o (PARI) {a(n) = sign( (n - 2) % 5 )};

%o (PARI) {a(n) = [1, 1, 0, 1, 1][n%5 + 1]};

%Y Cf. A003592, A047207, A011558, A130782.

%K nonn

%O 0,1

%A _Michael Somos_, Jan 10 2011