login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #5 Nov 22 2016 21:26:12

%S 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 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 2,1,1,0,1,1,1,2,1,1,2,0,1,1,1,2,2,0,2

%N 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 p=q is allowed.

%C It is conjectured that this sequence has only 208 zero terms listed in sequence A278342.

%C This sequence is tested up to n=200000 without more zero terms.

%C a(n) <= A276520(n).

%e A274987 = {3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109...}

%e 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 ...

%e 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 ...

%e 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 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 ct, {n, 1, 87}]

%Y Cf. A276520, A274987.

%K nonn,base,look

%O 1,10

%A _Lei Zhou_, Nov 18 2016