cp's OEIS Frontend

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.

A277514 Irregular triangle read by rows: T(n,k) is the number of primes with n balanced ternary digits of which 2k+1 (3 <= 2k+1 <= n) are nonzero.

This page as a plain text file.
%I A277514 #23 Nov 10 2019 14:40:44
%S A277514 4,6,8,10,7,35,11,70,30,7,129,143,10,191,458,93,11,262,1112,605,11,
%T A277514 370,2209,2513,273,8,484,4007,7646,2562,10,595,6683,19361,12878,938,9,
%U A277514 765,10697,42633,47555,10311,11,917,16103,85860,143382,62541,3183
%N A277514 Irregular triangle read by rows: T(n,k) is the number of primes with n balanced ternary digits of which 2k+1 (3 <= 2k+1 <= n) are nonzero.
%C A277514 This sequence has the same indexing rule as A277513.
%C A277514 There are no zeros in this sequence up to the (10^5)-th term.
%C A277514 It is conjectured that all terms of this sequence are greater than zero, or else there are infinitely many zero terms. The first zero term might appear beyond 10^6.
%e A277514 When n=3 and k=1, there are the following three trits balanced ternary numbers: 5=1TT, 7=1T1, 11=11T, 13=111. All four of them are primes, so T(3,1) = 4;
%e A277514 When n=4 and k=1, there are the following balanced ternary numbers with 2k+1=3 nonzero trits: 17=1T0T, 19=1T01, 23=10TT, 25=10T1, 29=101T, 31=1011, 35=110T, 37=1101. Among these 8 numbers, 6 of them are prime, so T(4,1) = 6.
%e A277514 By listing the first few rows, this sequence appears as:
%e A277514         k=1        2        3        4
%e A277514 n=3       4
%e A277514 n=4       6
%e A277514 n=5       8       10
%e A277514 n=6       7       35
%e A277514 n=8      11       70       30
%e A277514 n=9       7      129      143
%e A277514 n=10     10      191      458       93
%t A277514 (* This converts number m to balanced ternary form, stores the result in list t. *)
%t A277514 BTDigits[m_Integer, g_] :=
%t A277514   Module[{n = m, d, sign, t = g},
%t A277514    If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
%t A277514     d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
%t A277514     While[Length[t] < d, PrependTo[t, 0]];
%t A277514     t[[Length[t] + 1 - d]] = sign;
%t A277514     t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
%t A277514 (* This calculates j and k for balanced ternary form of number m. *)
%t A277514 BTnonzeroNumofDigits[m_Integer] :=
%t A277514   Module[{n = m}, t = BTDigits[n, {}]; j = Length[t];
%t A277514    k = 0; Do[If[t[[i]] != 0, k++], {i, 1, j}];
%t A277514    k = (k - 1)/2; {j, k}];
%t A277514 (* This calculates the category index n as defined in A277513 for a {j,k} pair. *)
%t A277514 IndexA277513[{j_, k_}] :=
%t A277514   Module[{m, i},
%t A277514    If[OddQ[j], m = (j - 1)/2; i = m^2 - m + k, m = j/2;
%t A277514     i = m^2 - 2 m + 1 + k]];
%t A277514 (* This counts a(n). *)
%t A277514 p=3;a={} ;While[p = NextPrime[p]; jk = BTnonzeroNumofDigits[p]; jk[[1]] <= 15, id = IndexA277513[jk]; While[Length[a] < id, AppendTo[a, 0]];
%t A277514   a[[id]]++];a
%Y A277514 2 together with the column 1 gives A196698.
%Y A277514 Cf. A277513, A134023.
%K A277514 nonn,base,tabf
%O A277514 3,1
%A A277514 _Lei Zhou_, Oct 18 2016