login
a(n) = 1 if the primorial base representation of 6*n has alternating digit sum (A373605) that is a multiple of 3, otherwise 0.
3

%I #30 Jun 19 2024 09:37:13

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

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

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

%N a(n) = 1 if the primorial base representation of 6*n has alternating digit sum (A373605) that is a multiple of 3, otherwise 0.

%C a(n) = 1 iff the sum of even-indexed digits and the sum of odd-indexed digits in the primorial base representation (A049345) of 6*n are equal modulo 3, i.e., iff the multiplicities of prime factors of A276086(6*n) [all by necessity > 3] that are even-indexed (A031215) and odd-indexed (A031368) are equal modulo 3.

%C First n where a(n) = a(n-1) = 1 are 105, 210, 315, 420, 525, 630, ...

%C a(n) differs from A373601(6*n) for the first time at x=37182146. Note that 6*x = 223092876 = A002110(9) + A002110(2) = 1000000100 in primorial base, so a(x) = 1 [see the example], while on the other hand, A373601(6*x) = 0, as A276086(6*x) = 145 = prime(3) * prime(10) = 5 * 29, and 5+29 = 34 is not a multiple of 3. This happens because it is at the tenth prime where the alternating pattern of 2, 1, 2, 1, 2, 1, ... of congruences of primes >= 5 (mod 3) breaks for the first time (see A039701 and A112632), as both 23 (the ninth) and 29 (the tenth prime) are congruent to 2 (mod 3).

%H Antti Karttunen, <a href="/A373604/b373604.txt">Table of n, a(n) for n = 0..100000</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Chebyshev%27s_bias">Chebyshev's bias</a>

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

%H <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a>

%F a(n) = A373830(6*n).

%e For n=3, we have A049345(3*6) = 300, thus the sum of digits in even positions (when the rightmost digit is considered to be in the position 0), which here is 3, and the sum of digits in odd positions, which here is 0, are equal modulo 3, and therefore a(3) = 1.

%e For n=6, A049345(6*6) = 1100, thus the sum of digits in even positions (1) and in odd positions (1) are equal modulo 3, and a(6) = 1.

%e For n=9, A049345(9*6) = 1400, thus the sum of digits in even positions (4) and in odd positions (1) are equal modulo 3, and a(9) = 1.

%e For n=37182146, A049345(37182146*6) = 1000000100, thus A373605(37182146*6) = 0, and a(37182146) = 1.

%o (PARI) A373604(n) = { my(p=2, i=1, c1=0, c2=0); n *= 6; while(n, if(p>3, if(i%2, c1 += (n%p), c2 += (n%p))); n = n\p; p = nextprime(1+p); i = !i); 0==((c1-c2)%3); };

%Y A 6-section of A373830.

%Y Cf. A002110, A049345, A031215, A031368, A039701, A112632, A276086, A373601, A373605.

%Y After n=0 differs from A100283 for the next time at n=36, where a(36) = 0, while A100283(36) = 1.

%K nonn,base

%O 0

%A _Antti Karttunen_, Jun 18 2024