login
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.
1
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, 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, 2, 1, 1, 0, 1, 1, 1, 2, 1, 1, 2, 0, 1, 1, 1, 2, 2, 0, 2
OFFSET
1,10
COMMENTS
p=q is allowed.
It is conjectured that this sequence has only 208 zero terms listed in sequence A278342.
This sequence is tested up to n=200000 without more zero terms.
a(n) <= A276520(n).
EXAMPLE
A274987 = {3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109...}
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;
...
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;
...
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.
MATHEMATICA
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}];
ct, {n, 1, 87}]
CROSSREFS
Sequence in context: A305875 A109705 A352578 * A276520 A242062 A025848
KEYWORD
nonn,base,look
AUTHOR
Lei Zhou, Nov 18 2016
STATUS
approved