login
a(n) = 1 if A053669(n) [the smallest prime not dividing n] is of the form 6m-1, otherwise a(n) = 0.
8

%I #21 Apr 16 2024 02:39:42

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

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

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

%N a(n) = 1 if A053669(n) [the smallest prime not dividing n] is of the form 6m-1, otherwise a(n) = 0.

%C The XOR-formula involving A358842 corresponds to the XOR-formula given for A353529, which is based on the lemma given in A353516. A similar lemma exists for mod 6 case.

%H Antti Karttunen, <a href="/A358755/b358755.txt">Table of n, a(n) for n = 1..100000</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>.

%F a(n) = [A053669(n) == -1 (mod 6)], where [ ] is the Iverson bracket.

%F For all n >= 6, a(n) = A358842(n) XOR A358842(n-6), where XOR is bitwise-XOR, A003987.

%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{p prime, p == 5 (mod 6)} ((p-1)/(Product_{q prime, q <= p} q)) = 0.1376937818... . - _Amiram Eldar_, Apr 16 2024

%e For n = 6 = 2*3, the smallest prime that does not divide it is 5, which is of the form 6m-1, therefore a(6) = 1.

%e For n = 30 = 2*3*5, the smallest prime that does not divide it is 7, which is of the form 6m+1, therefore a(30) = 0.

%e For n = 210 = 2*3*5*7, the smallest prime that does not divide it is 11, which is of the form 6m-1, therefore a(210) = 1.

%e For n = 2310 = 2*3*5*7*11, the smallest prime that does not divide it is 13, which is of the form 6m+1, therefore a(2310) = 0.

%e For n = 30030 = 2*3*5*7*11*13, the smallest prime that does not divide it is 17, which is of the form 6m-1, therefore a(30030) = 1.

%e For n = 223092870 = 2*3*5*7*11*13*17*19*23, the smallest nondividing prime is 29, which is of the form 6m-1, therefore a(223092870) = 1. This is also the least n where this sequence differs from the characteristic function of the even terms of A342051, (numbers k such that k is even and A276084(k) is also even).

%t a[n_] := Module[{p = 2}, While[Divisible[n, p], p = NextPrime[p]]; Boole[Mod[p, 6] == 5]]; Array[a, 100] (* _Amiram Eldar_, Apr 16 2024 *)

%o (PARI)

%o A053669(n) = forprime(p=2, , if(n%p, return(p)));

%o A358755(n) = (5 == (A053669(n)%6));

%Y Characteristic function of A358757.

%Y Cf. A003987, A053669, A358754, A358842, A358847 [= a(6*n)].

%Y Differs from A353528 for the first time at n=210, as here a(210) = 1.

%Y Cf. also A276084, A342051, A353529.

%K nonn

%O 1

%A _Antti Karttunen_, Dec 03 2022