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.

Showing 1-6 of 6 results.

A005823 Numbers whose ternary expansion contains no 1's.

Original entry on oeis.org

0, 2, 6, 8, 18, 20, 24, 26, 54, 56, 60, 62, 72, 74, 78, 80, 162, 164, 168, 170, 180, 182, 186, 188, 216, 218, 222, 224, 234, 236, 240, 242, 486, 488, 492, 494, 504, 506, 510, 512, 540, 542, 546, 548, 558, 560, 564, 566, 648, 650, 654, 656, 666, 668, 672, 674
Offset: 1

Views

Author

Keywords

Comments

The set of real numbers between 0 and 1 that contain no 1's in their ternary expansion is the well-known Cantor set with Hausdorff dimension log 2 / log 3.
Complement of A081606. - Reinhard Zumkeller, Mar 23 2003
Numbers k such that the k-th Apery number is congruent to 1 (mod 3) (cf. A005258). - Benoit Cloitre, Nov 30 2003
Numbers k such that the k-th central Delannoy number is congruent to 1 (mod 3) (cf. A001850). - Benoit Cloitre, Nov 30 2003
Numbers k such that there exists a permutation p_1, ..., p_k of 1, ..., k such that i + p_i is a power of 3 for every i. - Ray Chandler, Aug 03 2004
Subsequence of A125292. - Reinhard Zumkeller, Nov 26 2006
The first 2^n terms of the sequence could be obtained using the Cantor process for the segment [0,3^n-1]. E.g., for n=2 we have [0,{1},2,{3,4,5},6,{7},8]. The numbers outside of braces are the first 4 terms of the sequence. Therefore the terms of the sequence could be called "Cantor's numbers". - Vladimir Shevelev, Jun 13 2008
Mahler proved that positive a(n) is never a square. - Michel Marcus, Nov 12 2012
Define t: Z -> P(R) so that t(k) is the translated Cantor ternary set spanning [k, k+1], and let T be the union of t(a(n)) for all n. T = T * 3 = T / 3 is the closure of the Cantor ternary set under multiplication by 3. - Peter Munn, Oct 30 2019

References

  • K. J. Falconer, The Geometry of Fractal Sets, Cambridge, 1985; p. 14.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Twice A005836.
Cf. A088917 (characteristic function), A306556.

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n=1, 0, `if`(irem (n, 2, 'q')=0, 3*a(q)+2, 3*a(q+1)))
        end:
    seq(a(n), n=1..100); # Alois P. Heinz, Apr 19 2012
  • Mathematica
    Select[ Range[ 0, 729 ], (Count[ IntegerDigits[ #, 3 ], 1 ]==0)& ]
    Select[Range[0,700],DigitCount[#,3,1]==0&] (* Harvey P. Dale, Mar 12 2016 *)
  • PARI
    is(n)=while(n,if(n%3==1,return(0),n\=3));1 \\ Charles R Greathouse IV, Apr 20 2012
    
  • PARI
    a(n)=n=binary(n-1);sum(i=1,#n,2*n[i]*3^(#n-i)) \\ Charles R Greathouse IV, Apr 20 2012
    
  • PARI
    a(n)=2*fromdigits(binary(n-1),3) \\ Charles R Greathouse IV, Aug 24 2016
    
  • Python
    def A005823(n):
        return 2*int(format(n-1,'b'),3) # Chai Wah Wu, Jan 04 2015

Formula

a(n) = 2 * A005836(n).
a(2n) = 3*a(n)+2, a(2n+1) = 3*a(n+1), a(1) = 0.
a(n) = Sum_{k = 1..n} 1 + 3^A007814(k). - Philippe Deléham, Jul 09 2005
A125291(a(n)) = 1 for n>0. - Reinhard Zumkeller, Nov 26 2006
From Reinhard Zumkeller, Mar 02 2008: (Start)
A062756(a(n)) = 0.
If the offset were changed to zero, then: a(0) = 0, a(n+1) = f(a(n)+1, a(n)+1) where f(x, y) = if x < 3 and x <> 1 then y else if x mod 3 = 1 then f(y+1, y+1) else f(floor(x/3), y). (End)
G.f. g(x) satisfies g(x) = 3*g(x^2)*(1+1/x) + 2*x^2/(1-x^2). - Robert Israel, Jan 04 2015
Sum_{n>=2} 1/a(n) = 1.341426555483087715426958452292349687410838545707857407585878304836140592352... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 12 2022

Extensions

More terms from Sascha Kurz, Mar 24 2002
Offset corrected by N. J. A. Sloane, Mar 02 2008. This may require some of the formulas to be adjusted.

A147991 Sequence S such that 1 is in S and if x is in S, then 3x-1 and 3x+1 are in S.

Original entry on oeis.org

1, 2, 4, 5, 7, 11, 13, 14, 16, 20, 22, 32, 34, 38, 40, 41, 43, 47, 49, 59, 61, 65, 67, 95, 97, 101, 103, 113, 115, 119, 121, 122, 124, 128, 130, 140, 142, 146, 148, 176, 178, 182, 184, 194, 196, 200, 202, 284, 286, 290, 292, 302, 304, 308, 310, 338, 340, 344, 346
Offset: 1

Views

Author

Clark Kimberling, Dec 07 2008

Keywords

Comments

Positive numbers that can be written in balanced ternary without a 0 trit. - J. Hufford, Jun 30 2015
Let S be the set of terms. Define c: Z -> P(R) so that c(m) is the translated Cantor ternary set spanning [m-0.5, m+0.5], and let C be the union of c(m) for all m in S U {0} U -S. C is the closure of the translated Cantor ternary set spanning [-0.5, 0.5] under multiplication by 3. - Peter Munn, Jan 31 2022

Examples

			0th generation: 1;
1st generation: 2 4;
2nd generation: 5 7 11 13.
		

Crossrefs

Cf. A006288, A351243 (non-quotients).
See also the related sequences listed in A191106.
One half of each position > 0 where A307744 sets or equals a record.
Cf. A030300.
Column k=3 of A360099.

Programs

  • Haskell
    import Data.Set (singleton, insert, deleteFindMin)
    a147991 n = a147991_list !! (n-1)
    a147991_list = f $ singleton 1 where
       f s = m : (f $ insert (3*m - 1) $ insert (3*m + 1) s')
             where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Feb 21 2012, Jan 23 2011
    
  • Maple
    A147991:= proc(n) option remember; if n::even then 3*procname(n/2)-1 else 3*procname((n-1)/2)+1 fi end proc:
    A147991(1):= 1:
    [seq](A147991(i),i=1..1000); # Robert Israel, May 05 2014
  • Mathematica
    nn=346; s={1}; While[s1=Select[Union[s, 3*s-1, 3*s+1], # <= nn &];  s != s1, s=s1]; s
    a[ n_] := If[ n < -1 || n > 0, 3 a[Quotient[n, 2]] - (-1)^Mod[n, 2], 0]; (* Michael Somos, Dec 22 2018 *)
  • PARI
    {a(n) = if( n<-1 || n>0, 3*a(n\2) - (-1)^(n%2), 0)}; /* Michael Somos, Dec 22 2018 */
    
  • PARI
    a(n) = fromdigits(apply(b->if(b,1,-1),binary(n)), 3); \\ Kevin Ryde, Feb 06 2022

Formula

a(n) = 3*a(n/2) - 1 if n>=2 is even, 3*a((n-1)/2) + 1 if n is odd, a(0)=0. - Robert Israel, May 05 2014
G.f. g(x) satisfies g(x) = 3*(x+1)*g(x^2) + x/(1+x). - Robert Israel, May 05 2014
Product_{j=0..n-1} cos(3^j) = 2^(-n+1)*Sum_{i=2^(n-1)..2^n-1} cos(a(i)). - Gevorg Hmayakyan, Jan 15 2017
Sum_{i=2^(n-1)..2^n-1} cos(a(i)/3^(n-1)*Pi/2) = 0. - Gevorg Hmayakyan, Jan 15 2017
a(n) = -a(-1-n) for all n in Z. - Michael Somos, Dec 22 2018
For n > 0, A307744(2*a(2n)) = A307744(2*a(2n+1)) = A307744(2*a(n)) + 1. - Peter Munn, Jan 31 2022
a(n) mod 2 = A030300(n). - Alois P. Heinz, Jan 29 2023

A191108 Increasing sequence generated by these rules: a(1)=1, and if x is in a then 3x-2 and 3x+2 are in a.

Original entry on oeis.org

1, 5, 13, 17, 37, 41, 49, 53, 109, 113, 121, 125, 145, 149, 157, 161, 325, 329, 337, 341, 361, 365, 373, 377, 433, 437, 445, 449, 469, 473, 481, 485, 973, 977, 985, 989, 1009, 1013, 1021, 1025, 1081, 1085, 1093, 1097, 1117, 1121, 1129, 1133, 1297, 1301, 1309, 1313, 1333, 1337, 1345, 1349, 1405, 1409, 1417, 1421, 1441, 1445
Offset: 1

Views

Author

Clark Kimberling, May 26 2011

Keywords

Comments

See discussions at A190803, A191106. The sequence a=A191108 has closure properties: the positive integers in (2+A191108)/3 comprise A191108, as do those in (-2+A191108)/3.
From Peter Munn, May 13 2019: (Start)
The closure of {1} in the positive integers under reflection about 3^k, k >= 1.
Asymptotic density is 0.
Consider a Sierpinski arrowhead curve formed of edges numbered consecutively from 0 at its axis of symmetry. The m-th edge is contained in the boundary of the plane sector occupied by the arrowhead if and only if m or -m is in this sequence.
For k >= 0, a(2^k) = 2*3^k - 1 and {a(i)/(2*3^k) | 1 <= i <= 2^k} is the set of center points of surviving intervals at the k-th step of generating the Cantor set, and therefore the set of center points of deleted middle-third intervals at the (k+1)-th step.
Define t: Z -> P(R) so that t(n) is the translated Cantor ternary set spanning [(n-1)/2, (n+1)/2], and let T be the union of t(a(n)) for all n. T = T * 3 = T / 3 is the closure of the Cantor ternary set under multiplication by 3.
(End)

Crossrefs

Programs

  • Mathematica
    h = 3; i = -2; j = 3; k = 2; f = 1; g = 7;
    a = Union[Flatten[NestList[{h # + i, j # + k} &, f, g]]]  (* A191108 *)
    b = (a + 2)/3; c = (a - 2)/3; r = Range[1, 900];
    d = Intersection[b, r] (* A191108 closure property  *)
    e = Intersection[c, r] (* A191108 closure property  *)
  • PARI
    a(n) = fromdigits(binary(n-1),3)<<2 + 1; \\ Kevin Ryde, Aug 05 2022

Formula

From Peter Munn, May 25 2019: (Start)
a(n) = (A055247(2n-1) + A055247(2n)) / 3.
a(n) = A306556(2n)*2 - 1 = A306556(2n-1) + A306556(2n).
a(n) = 2*A005823(n) + 1 = 4*A005836(n) + 1 = 2*A191106(n) - 1.
a(2^k+i) = 2*A147991(2^k+i-1) + 3^(k+1) for k >= 0, 1 <= i <= 2^k.
(End)

A153775 Sequence S such that 1 is in S and if x is in S, then 3x-1 and 3x are in S.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 9, 14, 15, 17, 18, 23, 24, 26, 27, 41, 42, 44, 45, 50, 51, 53, 54, 68, 69, 71, 72, 77, 78, 80, 81, 122, 123, 125, 126, 131, 132, 134, 135, 149, 150, 152, 153, 158, 159, 161, 162, 203, 204, 206, 207, 212, 213, 215, 216, 230, 231, 233, 234, 239, 240, 242
Offset: 1

Views

Author

Clark Kimberling, Jan 02 2009

Keywords

Comments

Subsequences include A007051, A000244, A153773, A153774.
First generation: 1
2nd generation: 2, 3
3rd generation: 5, 6, 8, 9
4th generation: 14, 15, 17, 18, 23, 24, 26, 27
Does every generation contain a prime?
From Peter Munn, Feb 10 2022: (Start)
Consider a Sierpinski arrowhead curve formed of edges indexed consecutively from 0 at its axis of symmetry and aligned with an infinite Sierpinski gasket so that each edge is contained in the boundary of either the plane sector occupied by the gasket or a triangular region of the gasket's complement. The numbers {4*a(n)-1 : n >= 1} (that is, 3, 7, 11, 19, 23, 31, 35, 55, 59, ...) index the edges that are contained in the boundaries of certain triangular regions: each is the first region encountered of each successively larger size that does not lie across the axis of symmetry.
Let S be the set of terms. Define c: N -> P(R) so that c(m) is the scaled and translated Cantor ternary set spanning [m-0.5, m], and let C be the union of c(m) for all m in S. C is the closure under multiplication by 3 of the scaled and translated Cantor ternary set spanning [0.5, 1.0].
(End)
Positive numbers whose balanced ternary expansions contain exactly one digit 1. - Rémy Sigrist, May 08 2022

Crossrefs

See also the related sequences listed in A191106.

Programs

  • Mathematica
    nxt[n_] := Flatten[3 # + {-1, 0} & /@ n]; Union[Flatten[NestList[nxt,{1},5]]] (* G. C. Greubel, Aug 28 2016 *)

Formula

From Peter Munn, Feb 04 2022: (Start)
For k >= 0, 2^k <= n <= 2^(k+1)-1, a(n) = A005836(n+1) - (3^k-1)/2.
For n >= 1, A307744(4*a(2n)-1) = A307744(4*a(2n+1)-1) = A307744(4*a(n)-1) + 1.
(End)

A307744 A fractal function, related to ruler functions and the Cantor set. a(1) = 0; for m >= 0, a(3m) = 1; for m >= 1, a(3m-1) = a(m-1) + sign(a(m-1)), a(3m+1) = a(m+1) + sign(a(m+1)).

Original entry on oeis.org

1, 0, 2, 1, 3, 0, 1, 2, 3, 1, 4, 2, 1, 0, 4, 1, 2, 0, 1, 3, 2, 1, 4, 3, 1, 2, 4, 1, 5, 2, 1, 3, 5, 1, 2, 3, 1, 0, 2, 1, 5, 0, 1, 2, 5, 1, 3, 2, 1, 0, 3, 1, 2, 0, 1, 4, 2, 1, 3, 4, 1, 2, 3, 1, 5, 2, 1, 4, 5, 1, 2, 4, 1, 3, 2, 1, 5, 3, 1, 2, 5, 1, 6, 2, 1
Offset: 0

Views

Author

Peter Munn, Apr 26 2019

Keywords

Comments

The sequence extends to negative n by defining a(n) = a(-n).
For k >= 1 numbers 1..k occur with the same periodic and mirror symmetries as in ruler function A051064, in which k occurs 3 times more frequently than k+1. Here k occurs 3/2 times more frequently than k+1, precisely 2^(k-1) times in every 3^k terms. 0 has asymptotic density 0. Taking a trisection shows some scale symmetry, again comparable to ruler functions, as illustrated in the example section.
The links include a pin plot of a(0..162) aligned above an inverted plot of A051064 (the emphatic marking of 0's is significant). Between each n_k where A051064(n_k) = k >= 2 and the nearest n_k' where A051064(n_k') > k (or n_k' = 0 if nearer), there are 2^(k-2) indices where k occurs in this sequence, forming a 2^(k-2)-tuple. The 2^(k-2)-tuples have identical patterns and each has symmetry about an n_(k-1) where A051064(n_(k-1)) = k-1.
For a given k, the tuples described above are periodic with two per fundamental period, and the closest pairs of these tuples jointly form the pattern of one of the equivalent tuples for k+1. These patterns relate to the nonperiodic pattern for 0's and to the Cantor set as follows.
Let S_k be the sequence of positive indices at which k occurs, with 3^(k-2) subtracted when k >= 2. Given its ruler-type symmetries, S_k k >= 2 is determined by its first 2^(k-2) terms, which are the same as the first 2^(k-2) terms of S_i for i > k. The limiting sequence as k goes to infinity is S_0, which is A191108. {A191108(i)/(2*3^k) | 1 <= i <= 2^k} is the set of center points of the intervals deleted at step k+1 when generating the Cantor ternary set. This leads to the following scaling property.
Define c: Z -> P(R) so that c(n) is the scaled and translated Cantor ternary set spanning [n-1, n+1], and let C_k be the union of c(n) for all integer n with a(n) = k. Clearly C_1 consists of a scaled Cantor set repeated with period 3. (The set's two nonempty thirds occur at alternating intervals of 4/3 and 5/3.) For k >= 1, C_k is C_1 scaled by 3^(k-1), consisting therefore of a scaled Cantor set repeated with period 3^k. C_0 is special: C_0 = (C_0)*3 = (C_0)/3 = -C_0. Specifically, (C_0)/2 is the closure of the Cantor ternary set under multiplication by 3 and by -1.
Take a Sierpinski arrowhead curve formed of unit edges numbered consecutively from 0 at its axis of symmetry and aligned with an infinite Sierpinski gasket so that each edge is contained in the boundary of either the plane sector occupied by the gasket or a triangular region of the gasket's complement. If a(n) = 0, the n-th edge is contained in the sector boundary, otherwise the relevant triangular region seems to have side 2^(a(n)-1). See A307672 for a fuller description. The conjectured formulas below (that use A094373) derive from summing areas of regions within the gasket. - Corrected by Peter Munn, Aug 09 2019
From Charlie Neder, Jul 05 2019: (Start)
For each n, define the "2-balanced ternary expansion" E(n) as follows:
- E(n) begins with 0 or 1, according to the parity of n.
- The following digits are +, 0, or - as in standard balanced ternary, except + and - correspond to +2 and -2, respectively.
For example, we have E(4) = 0+-, E(7) = 10-, and E(13) = 1+-.
Then a(n) is the distance from the end of the rightmost 0, counting the last digit as 1, or 0 if 0 never appears. (End)

Examples

			As 4 is congruent to 1 modulo 3, a(4) = a(3*1 + 1) = a(1+1) + sign (a(1+1)) = a(2) + sign(a(2)).
As 2 is congruent to -1 modulo 3, a(2) = a(3*1 - 1) = a(1-1) + sign (a(1-1)) = a(0) + sign(a(0)).
As 0 is congruent to 0 modulo 3, a(0) = 1.  So a(2) = a(0) + sign(a(0)) = 1 + 1 = 2.  So a(4) = a(2) + sign(a(2)) = 2 + 1 = 3.
For any m, the sequence from 9m - 9 to 9m + 9 can be represented by the table below. x, y and z represent distinct integers unless m = 0, in which case x = z = 0. Distinct values are shown in their own column to highlight patterns.
  n     a(n)
9m-9   1
9m-8          y     - starts pattern (9m-8, 9m-4, 9m+4, 9m+8)
9m-7    2
9m-6   1
9m-5       x
9m-4          y
9m-3   1
9m-2    2
9m-1       x        - ends pattern (9m-17, 9m-13, 9m-5, 9m-1)
9m     1
9m+1             z  - starts pattern (9m+1, 9m+5, 9m+13, 9m+17)
9m+2    2
9m+3   1
9m+4          y
9m+5             z
9m+6   1
9m+7    2
9m+8          y     - ends pattern (9m-8, 9m-4, 9m+4, 9m+8)
9m+9   1
For all m, one of x, y, z represents 3 in this table. Note the identical patterns indicated for "x", "y", "z" quadruples, and how the "x" quadruple ends 2 before the "z" quadruple starts, with the "y" quadruple overlapping both. For k >= 1, there are equivalent 2^k-tuples that overlap similarly, notably (3m-2, 3m+2) for all m.
Larger 2^k-tuples look more fractal, more obviously related to the Cantor set. See the pin plot of a(0..162) aligned above an inverted plot of ruler function A051064 in the links. 0's are emphasized with a fainter line running off the top of the plot, partly because 0 is used here as a conventional value and occurs with some properties (such as zero asymptotic density) that could be considered appropriate to the largest rather than smallest value in the sequence.
The table below illustrates the symmetries of scale of this sequence and ruler function A051064. Note the column for this sequence is indexed by k+1, 3k+1, 9k+1, whereas that for A051064 is indexed by k, 3k, 9k.
                         a(n+1)                   A051064(n)
n=k, k=16..27    0,1,3,2,1,4,3,1,2,4,1,5    1,1,3,1,1,2,1,1,2,1,1,4
n=3k,k=16..27    0,2,4,3,2,5,4,2,3,5,2,6    2,2,4,2,2,3,2,2,3,2,2,5
n=9k,k=16..27    0,3,5,4,3,6,5,3,4,6,3,7    3,3,5,3,3,4,3,3,4,3,3,6
		

Crossrefs

Sequences with similar definitions: A309054, A335933.
A055246, A191108, A306556 relate to the Cantor set.

Programs

  • PARI
    a(n) = if (n==1, 0, my(m=n%3); if (m==0, 1, my(kk = (if (m==1, a(n\3+1), a((n-2)\3)))); kk + sign(kk)));
    for (n=0, 100, print1(a(n), ", ")) \\ Michel Marcus, Jul 06 2019

Formula

Alternative definition: (Start)
a(m*3^k - 3^(k-1) + A191108(i)) = k for k >= 1, 1 <= i <= 2^(k-1), all integer m.
a(A191108(i)) = a(-A191108(i)) = 0 for i >= 1.
(End)
if a(n) = k >= 1, a(3^k+n) = a(3^k-n) = k.
a(n) = a(12*3^k + n) for k >= 0, 0 <= n <= 3^k.
if a(n) = a(n') and a(n+1) = a(n'+1) then a(n*3^k + i) = a(n'*3^k + i) for k >= 0, 0 <= i <= 3^k.
a((m-1)*3^k + 1) = a((m+1)*3^k - 1) for k >= 1, all integer m.
Upper bound relations: (Start)
for k >= 2, let m_k = A034472(k-2) = 3^(k-2)+1.
a(n) < k, for -m_k < n < m_k.
a(-m_k) = a(m_k) = k.
(End)
for k>=0, a( 3^k-1) = k+1, a( 3^k+1) = k+2.
for k>=0, a(2*3^k-1) = 0, a(2*3^k+1) = k+1.
for k>=0, a(4*3^k-1) = k+1, a(4*3^k+1) = 0.
for k>=0, a(5*3^k-1) = k+3, a(5*3^k+1) = k+1.
for k>=0, a(7*3^k-1) = k+1, a(7*3^k+1) = k+3.
for k>=0, a(8*3^k-1) = k+2, a(8*3^k+1) = k+1.
A051064(i) = min{a(n) : |n-i| = 1, a(n) > 0}.
A055246(i+1) = min{n : n > A055246(i) + 1, a(n) = a(A055246(i) + 1)}.
Sum_{n=-3^k..3^k-1} A094373(a(n)) = 3 * 4^k (conjectured).
Sum_{n=-3m..3m-1} A094373(a(n)) = 4 * Sum_{n=-m..m-1} A094373(a(n)) (conjectured).
From Charlie Neder, Jul 05 2019: (Start)
Let P(n) be the power of 3 (greater than 1) closest to n and T(n) be the distance from the end - counting the last digit as 1 - of the rightmost 0 in the balanced ternary expansion of n.
If n is even, a(n) = T(n/2).
If n is odd, a(n) = T((P(n)-n)/2), or 0 if this number exceeds log_3(P(n)). (End)

A173934 Irregular triangle in which row n consists of numbers m < k/2 such that m/k is in the Cantor set, where k= A173931(n) and gcd(m,k) = 1.

Original entry on oeis.org

1, 1, 3, 1, 3, 4, 1, 3, 9, 1, 3, 9, 13, 1, 3, 7, 9, 19, 21, 25, 27, 1, 3, 9, 10, 27, 30, 1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 31, 36, 37, 39, 40, 5, 11, 15, 33, 45, 47, 5, 15, 41, 45, 47, 59, 7, 16, 21, 22, 48, 61, 63, 66, 1, 3, 7, 9, 19, 21, 25, 27, 55, 57, 63, 73, 75, 79, 81, 1, 3, 9, 27
Offset: 1

Views

Author

T. D. Noe, Mar 03 2010

Keywords

Comments

The length of row n is A173933(n). Observe that the m are actually less than k/3. Note that (k-m)/k is also in the Cantor set. If m appears in a row, then 3m does also. Let A and B be the first and last numbers in row n, then it appears that k = A + 3B. This implies A = k (mod 3). The interesting graph of this triangle shows that some ranges of m are not allowed.
When k is a prime of the form (3^r-1)/2, then the row consists of the 2^(r-1)-1 numbers (greater than 0) whose base-3 representation consists of only 0's and 1's. Hence, for r=3,7, and 13, the primes k are 13, 1093, and 797161, and the number of m < k/2 is 3, 63, and 4095.

Crossrefs

Programs

  • Mathematica
    Flatten[Last[Transpose[cantor]]] (* see A173931 *)

Extensions

Name qualified by Peter Munn, Jul 06 2019
Showing 1-6 of 6 results.