This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A276982 #45 Feb 27 2020 20:52:22 %S A276982 4,6,8,10,10,10,7,19,18,16,19,17,16,11,20,19,21,22,21,19,30,21,22,23, %T A276982 30,22,30,30,30,7,24,27,23,28,24,29,45,25,29,20,53,28,50,45,50,30,24, %U A276982 25,48,25,45,40,45,26,53,48,53,45,50,45,10,27,26,32,24,26 %N A276982 a(n) = number of primes p whose balanced ternary representation is compatible with the binary representation of A276194(n). %C A276982 Let B = binary representation of A276194(n), and let C = C(p) = balanced ternary (bt) representation of a prime p (see A117966). Thus C is a string of 0's, 1's, and -1's. We will write T instead of -1. %C A276982 We say that C is compatible with B if (i) length(C) = length(B); (ii) C has a 1 or T wherever B has a 1; and (iii) there is exactly one 1 or T in C in the positions where B is 0, and otherwise C has a 0 whenever B has a 0. %C A276982 Then a(n) is the number of primes p for which C(p) is compatible with B. %C A276982 It is conjectured that all a(n) > 0. This has been checked for n <= 100000. But it is possible that there is a counterexample for very large n. %H A276982 Lei Zhou, <a href="/A276982/b276982.txt">Table of n, a(n) for n = 1..10000</a> %e A276982 n=1, A276194(1) = 5, or 101 in binary form. Using this as mask to generate positive balanced ternary numbers that allow 1 or T on all 1 digits, but only one digits 1 or T falls on a 0 digits, the following balanced ternary numbers can be generated: 1TT=5, 1T1=7, 11T=11, 111=13. All the four numbers are primes. So a(1)=4. %e A276982 n=2, A276194(2) = 9, or 1001 in binary form. Using this as mask to generate positive balanced ternary numbers that allow 1 or T on all 1 digits, but only one digits 1 or T falls on a 0 digits, the following balanced ternary numbers can be generated: 1T0T=17, 1T01=19, 10TT=23, 10T1=25, 101T=29, 1011=31, 110T=35, 1101=37. Among the 8 numbers, 6 of them (17, 19, 23, 29, 31, and 37) are primes. So a(2)=6. %t A276982 BNDigits[m_Integer] := Module[{n = m, d, t = {}}, %t A276982 While[n > 0, d = Mod[n, 2]; PrependTo[t, d]; n = (n - d)/2]; t]; %t A276982 c = 1; %t A276982 Table[ While[c = c + 2; d = BNDigits[c]; ld = Length[d]; %t A276982 c1 = Total[d]; !(EvenQ[c1] && (c1 < ld))]; %t A276982 l = Length[d]; flps = Flatten[Position[Reverse[d], 1]] - 1; %t A276982 flps = Delete[flps, Length[flps]]; %t A276982 sfts = Flatten[Position[Reverse[d], 0]] - 1; lf = Length[flps]; ls = Length[sfts]; ct = 0; %t A276982 Do[Do[cp10 = 3^(l - 1) + 3^(sfts[[i]]); %t A276982 cp20 = 3^(l - 1) - 3^(sfts[[i]]); di = BNDigits[j]; %t A276982 While[Length[di] < lf, PrependTo[di, 0]]; Do[ %t A276982 If[di[[k]] == 0, cp10 = cp10 - 3^flps[[k]]; %t A276982 cp20 = cp20 - 3^flps[[k]], cp10 = cp10 + 3^flps[[k]]; %t A276982 cp20 = cp20 + 3^flps[[k]]], {k, 1, lf}]; %t A276982 If[PrimeQ[cp10], ct++]; If[PrimeQ[cp20], ct++], {j, 0, 2^lf - 1}], {i, 1, ls}]; ct, {n, 1, 66}] %Y A276982 Cf. A276194. %K A276982 nonn,base %O A276982 1,1 %A A276982 _Lei Zhou_, Oct 20 2016 %E A276982 Edited by _N. J. A. Sloane_, Nov 05 2016