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 A278341 #8 Sep 06 2025 11:05:38 %S A278341 0,0,0,0,0,1,0,1,1,2,1,1,2,2,1,2,3,2,2,1,2,2,1,2,2,1,3,2,2,2,2,0,3,2, %T A278341 1,2,2,1,3,1,2,2,1,2,3,1,2,2,1,1,3,0,2,2,0,0,3,0,2,1,0,1,2,0,1,0,1,1, %U A278341 2,1,1,0,1,1,1,2,1,1,2,0,1,1,1,2,2,0,2 %N A278341 a(n) is the number of decompositions of n into unordered form p + c*q, where p, q are terms of A274987 and the difference of trits for p and q is no more than 1, c=1 for even n-s and c=2 for odd n-s. %C A278341 p=q is allowed. %C A278341 It is conjectured that this sequence has only 208 zero terms listed in sequence A278342. %C A278341 This sequence is tested up to n=200000 without more zero terms. %C A278341 a(n) <= A276520(n). %e A278341 A274987 = {3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109...} %e A278341 For n=6, c=1, 6=3+3, 3=10 in balanced ternary(BT). 3 is a 2 trits BT number. 2-2=0<1, so this one counts, a(6)=1; %e A278341 ... %e A278341 For n=20, c=1, 20=3+17=7+13. For 3 and 17 pair, 3=10(BT), 17=1T0T(BT), the difference of trits of these two primes is 2. This does not count. For 7 and 13 pair, 7=1T1(BT), 13=111(BT), the difference of trits of these two primes is 0. This is counted. So a(20)=1; %e A278341 ... %e A278341 For n=29, c=2, 29=23+2*3=7+2*11=3+2*13. For 23 and 3 pair, 23=10TT(BT), 3=10(BT), the difference of trits of these two primes is 2, this does not count; for 7 and 11 pair, 7=1T1(BT), 11=11T(BT), the difference of trits of these two primes is , this is counted; for 3 and 13 pair, 3=10(BT), 13=111(BT), the difference of trits of these two primes is 1, this is counted. So a(29)=2. %t A278341 p = 3; sp = {p}; Table[l = Length[sp]; While[sp[[l]] < n, While[p = NextPrime[p]; cp = 2*3^(Floor[Log[3, 2*p - 1]]) - p; ! PrimeQ[cp]]; AppendTo[sp, p]; l++]; c = 2 - Mod[n + 1, 2]; ct = 0; Do[If[MemberQ[sp, n - c*sp[[i]]], If[Abs[Floor[Log[3, 2*sp[[i]] - 1]] - Floor[Log[3, 2*(n - c*sp[[i]]) - 1]]] <= 1, If[c == 1, If[(2*sp[[i]]) <= n, ct++], ct++]]], {i, 1, l}]; %t A278341 ct, {n, 1, 87}] %Y A278341 Cf. A276520, A274987. %K A278341 nonn,base,changed %O A278341 1,10 %A A278341 _Lei Zhou_, Nov 18 2016