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-9 of 9 results.

A135666 Members of A054591 that are not members of A121153.

Original entry on oeis.org

146, 182, 205, 386, 438, 546, 615, 656, 671, 1158, 1314, 1342, 1638, 1640, 1845, 1968, 2013, 2044, 2555, 2644, 2684, 3474, 3640, 3796, 3851, 3942, 4026, 4088, 4561, 4745, 4914, 4920, 5110, 5535, 5904, 6039, 6132, 6176, 7592, 7665, 7913, 7932, 8052, 9139, 10220
Offset: 1

Views

Author

N. J. A. Sloane, Feb 22 2010

Keywords

Examples

			1/146 in base 3 = .000011222211000011222211000..., which contains 1's, so 146 is not in A121153, but 5/146 = .0002202220020002202220020002202220020... only contains 2's, so 146 is in A054591.
		

Crossrefs

Related to the Cantor set sequences A054591, A121153.

Extensions

More terms from Amiram Eldar, Feb 02 2024

A005836 Numbers whose base-3 representation contains no 2.

Original entry on oeis.org

0, 1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 31, 36, 37, 39, 40, 81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121, 243, 244, 246, 247, 252, 253, 255, 256, 270, 271, 273, 274, 279, 280, 282, 283, 324, 325, 327, 328, 333, 334, 336, 337, 351, 352
Offset: 1

Views

Author

Keywords

Comments

3 does not divide binomial(2s, s) if and only if s is a member of this sequence, where binomial(2s, s) = A000984(s) are the central binomial coefficients.
This is the lexicographically earliest increasing sequence of nonnegative numbers that contains no arithmetic progression of length 3. - Robert Craigen (craigenr(AT)cc.umanitoba.ca), Jan 29 2001
In the notation of A185256 this is the Stanley Sequence S(0,1). - N. J. A. Sloane, Mar 19 2010
Complement of A074940. - Reinhard Zumkeller, Mar 23 2003
Sums of distinct powers of 3. - Ralf Stephan, Apr 27 2003
Numbers n such that central trinomial coefficient A002426(n) == 1 (mod 3). - Emeric Deutsch and Bruce E. Sagan, Dec 04 2003
A039966(a(n)+1) = 1; A104406(n) = number of terms <= n.
Subsequence of A125292; A125291(a(n)) = 1 for n>1. - Reinhard Zumkeller, Nov 26 2006
Also final value of n - 1 written in base 2 and then read in base 3 and with finally the result translated in base 10. - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 23 2007
a(n) modulo 2 is the Thue-Morse sequence A010060. - Dennis Tseng, Jul 16 2009
Also numbers such that the balanced ternary representation is the same as the base 3 representation. - Alonso del Arte, Feb 25 2011
Fixed point of the morphism: 0 -> 01; 1 -> 34; 2 -> 67; ...; n -> (3n)(3n+1), starting from a(1) = 0. - Philippe Deléham, Oct 22 2011
It appears that this sequence lists the values of n which satisfy the condition sum(binomial(n, k)^(2*j), k = 0..n) mod 3 <> 0, for any j, with offset 0. See Maple code. - Gary Detlefs, Nov 28 2011
Also, it follows from the above comment by Philippe Lallouet that the sequence must be generated by the rules: a(1) = 0, and if m is in the sequence then so are 3*m and 3*m + 1. - L. Edson Jeffery, Nov 20 2015
Add 1 to each term and we get A003278. - N. J. A. Sloane, Dec 01 2019

Examples

			12 is a term because 12 = 110_3.
This sequence regarded as a triangle with rows of lengths 1, 1, 2, 4, 8, 16, ...:
   0
   1
   3,  4
   9, 10, 12, 13
  27, 28, 30, 31, 36, 37, 39, 40
  81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121
... - _Philippe Deléham_, Jun 06 2015
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section E10, pp. 317-323.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A039966 (characteristic function).
For generating functions Product_{k>=0} (1+a*x^(b^k)) for the following values of (a,b) see: (1,2) A000012 and A000027, (1,3) A039966 and A005836, (1,4) A151666 and A000695, (1,5) A151667 and A033042, (2,2) A001316, (2,3) A151668, (2,4) A151669, (2,5) A151670, (3,2) A048883, (3,3) A117940, (3,4) A151665, (3,5) A151671, (4,2) A102376, (4,3) A151672, (4,4) A151673, (4,5) A151674.
Row 3 of array A104257.
Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
3-term AP: A005836 (>=0), A003278 (>0);
4-term AP: A005839 (>=0), A005837 (>0);
5-term AP: A020654 (>=0), A020655 (>0);
6-term AP: A020656 (>=0), A005838 (>0);
7-term AP: A020657 (>=0), A020658 (>0);
8-term AP: A020659 (>=0), A020660 (>0);
9-term AP: A020661 (>=0), A020662 (>0);
10-term AP: A020663 (>=0), A020664 (>0).
See also A000452.

Programs

  • Haskell
    a005836 n = a005836_list !! (n-1)
    a005836_list = filter ((== 1) . a039966) [0..]
    -- Reinhard Zumkeller, Jun 09 2012, Sep 29 2011
    
  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 2)
            r += b * q
            b *= 3
        end
    r end; [a(n) for n in 0:57] |> println # Peter Luschny, Jan 03 2021
  • Maple
    t := (j, n) -> add(binomial(n,k)^j, k=0..n):
    for i from 1 to 400 do
        if(t(4,i) mod 3 <>0) then print(i) fi
    od; # Gary Detlefs, Nov 28 2011
    # alternative Maple program:
    a:= proc(n) option remember: local k, m:
    if n=1 then 0 elif n=2 then 1 elif n>2 then k:=floor(log[2](n-1)): m:=n-2^k: procname(m)+3^k: fi: end proc:
    seq(a(n), n=1.. 20); # Paul Weisenhorn, Mar 22 2020
    # third Maple program:
    a:= n-> `if`(n=1, 0, irem(n-1, 2, 'q')+3*a(q+1)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 26 2022
  • Mathematica
    Table[FromDigits[IntegerDigits[k, 2], 3], {k, 60}]
    Select[Range[0, 400], DigitCount[#, 3, 2] == 0 &] (* Harvey P. Dale, Jan 04 2012 *)
    Join[{0}, Accumulate[Table[(3^IntegerExponent[n, 2] + 1)/2, {n, 57}]]] (* IWABUCHI Yu(u)ki, Aug 01 2012 *)
    FromDigits[#,3]&/@Tuples[{0,1},7] (* Harvey P. Dale, May 10 2019 *)
  • PARI
    A=vector(100);for(n=2,#A,A[n]=if(n%2,3*A[n\2+1],A[n-1]+1));A \\ Charles R Greathouse IV, Jul 24 2012
    
  • PARI
    is(n)=while(n,if(n%3>1,return(0));n\=3);1 \\ Charles R Greathouse IV, Mar 07 2013
    
  • PARI
    a(n) = fromdigits(binary(n-1),3);  \\ Gheorghe Coserea, Jun 15 2018
    
  • Python
    def A005836(n):
        return int(format(n-1,'b'),3) # Chai Wah Wu, Jan 04 2015
    

Formula

a(n) = A005823(n)/2 = A003278(n)-1 = A033159(n)-2 = A033162(n)-3.
Numbers n such that the coefficient of x^n is > 0 in prod (k >= 0, 1 + x^(3^k)). - Benoit Cloitre, Jul 29 2003
a(n+1) = Sum_{k=0..m} b(k)* 3^k and n = Sum( b(k)* 2^k ).
a(2n+1) = 3a(n+1), a(2n+2) = a(2n+1) + 1, a(0) = 0.
a(n+1) = 3*a(floor(n/2)) + n - 2*floor(n/2). - Ralf Stephan, Apr 27 2003
G.f.: (x/(1-x)) * Sum_{k>=0} 3^k*x^2^k/(1+x^2^k). - Ralf Stephan, Apr 27 2003
a(n) = Sum_{k = 1..n-1} (1 + 3^A007814(k)) / 2. - Philippe Deléham, Jul 09 2005
From Reinhard Zumkeller, Mar 02 2008: (Start)
A081603(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 <> 2 then y else if x mod 3 = 2 then f(y+1, y+1) else f(floor(x/3), y). (End)
With offset a(0) = 0: a(n) = Sum_{k>=0} A030308(n,k)*3^k. - Philippe Deléham, Oct 15 2011
a(2^n) = A003462(n). - Philippe Deléham, Jun 06 2015
We have liminf_{n->infinity} a(n)/n^(log(3)/log(2)) = 1/2 and limsup_{n->infinity} a(n)/n^(log(3)/log(2)) = 1. - Gheorghe Coserea, Sep 13 2015
a(2^k+m) = a(m) + 3^k with 1 <= m <= 2^k and 1 <= k, a(1)=0, a(2)=1. - Paul Weisenhorn, Mar 22 2020
Sum_{n>=2} 1/a(n) = 2.682853110966175430853916904584699374821677091415714815171756609672281184705... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 12 2022
A065361(a(n)) = n-1. - Rémy Sigrist, Feb 06 2023
a(n) ≍ n^k, where k = log 3/log 2 = 1.5849625007. (I believe the constant varies from 1/2 to 1.) - Charles R Greathouse IV, Mar 29 2024

Extensions

Offset corrected by N. J. A. Sloane, Mar 02 2008
Edited by the Associate Editors of the OEIS, Apr 07 2009

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

Original entry on oeis.org

1, 3, 7, 9, 19, 21, 25, 27, 55, 57, 61, 63, 73, 75, 79, 81, 163, 165, 169, 171, 181, 183, 187, 189, 217, 219, 223, 225, 235, 237, 241, 243, 487, 489, 493, 495, 505, 507, 511, 513, 541, 543, 547, 549, 559, 561, 565, 567, 649, 651, 655, 657, 667, 669, 673, 675, 703, 705, 709, 711, 721, 723, 727, 729, 1459, 1461, 1465, 1467, 1477
Offset: 1

Views

Author

Clark Kimberling, May 26 2011

Keywords

Comments

Related sequences for various choices of i and k as defined in A190803:
A003278: (i,k) = (-2,-1)
A191106: (i,k) = (-2, 0)
A191107: (i,k) = (-2, 1)
A191108: (i,k) = (-2, 2)
A153775: (i,k) = (-1, 0)
A147991: (i,k) = (-1, 1)
A191109: (i,k) = (-1, 2)
A005836: (i,k) = ( 0, 1)
A191110: (i,k) = ( 0, 2)
A132140: (i,k) = ( 1, 2)
For a=A191106, we have closure properties: the integers in (2+a)/3 comprise a; the integers in a/3 comprise a.
For k >= 1, m = a(i), 1 <= i <= 2^k seems to be m such that m/(3^k+1) is in the Cantor set (except that m = 0 and m = 3^k+1 do not appear). For k >= 2, m = (a(i)-1)/2, 1 <= i <= 2^k seems to be m such that m/((3^k-1)/2) is in the Cantor set. - Peter Munn, Jul 06 2019
Every even number is the sum of two (possibly equal) terms. More specifically: terms a(1) through a(2^n) = 3^n sum to even numbers 2 times 1 through 3^n. Every even number is infinitely often the difference of two terms. Since the sequence is equal to 2*A005836(n) + 1, these properties follow immediately from similar properties of A005836 for every number. - Aad Thoen, Feb 17 2022
if A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+2*3^n), similar to A003278. - Arie Bos, Jul 26 2022

Examples

			1 -> 3 -> 7,9 -> 19,21,25,27 -> ...
		

Crossrefs

Cf. A005823, A005836, A054591, A088917 (characteristic function), A173934, A190803, A191108.
Partial sums of A061393.
Similar formula as A003278, A_(n+1)=(A_n,A_n+2*3^n).

Programs

  • Mathematica
    h = 3; i = -2; j = 3; k = 0; f = 1; g = 9;
    a = Union[Flatten[NestList[{h # + i, j # + k} &, f, g]]]  (* A191106; regarding g, see note at A190803 *)
    b = (a + 2)/3; c = a/3; r = Range[1, 900];
    d = Intersection[b, r](* illustrates closure property *)
    e = Intersection[c, r](* illustrates closure property *)
    2 FromDigits[#, 3]&/@Tuples[{0, 1}, 7] + 1 (* Vincenzo Librandi, Jul 10 2019 *)

Formula

a(n) = 2*A005836(n) + 1. - Charles R Greathouse IV, Sep 06 2011
a(n) = A005823(n) + 1. - Vladimir Shevelev, Dec 17 2012
a(n) = (A191108(n) + 1)/2. - Peter Munn, Jul 09 2019

A121153 Numbers k with the property that 1/k can be written in base 3 in such a way that the fractional part contains no 1's.

Original entry on oeis.org

1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 36, 39, 40, 81, 82, 84, 90, 91, 108, 117, 120, 121, 243, 244, 246, 252, 270, 273, 324, 328, 351, 360, 363, 364, 729, 730, 732, 738, 756, 757, 810, 819, 820, 949, 972, 984, 1036, 1053, 1080, 1089, 1092, 1093, 2187
Offset: 1

Views

Author

Jack W Grahl, Aug 12 2006

Keywords

Comments

Numbers k such that 1/k is in the Cantor set.
A subsequence of A054591. The first member of A054591 which does not belong to this sequence is 146. See A135666.
This is not a subsequence of A005836 (949 belongs to the present sequence but not to A005836). See A170830, A170853.

Examples

			1/3 in base 3 can be written as either .1 or .0222222... The latter version contains no 1's, so 3 is in the sequence.
1/4 in base 3 is .02020202020..., so 4 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    (* Mma code from T. D. Noe, Feb 20 2010. This produces the sequence except for the powers of 3. *)
    (* Find the length of the periodic part of the fraction: *)
    FracLen[n_] := Module[{r = n/3^IntegerExponent[n, 3]}, MultiplicativeOrder[3, r]]
    (* Generate the fractions and select those that have no 1's: *)
    Select[Range[100000], ! MemberQ[Union[RealDigits[1/#, 3, FracLen[ # ]][[1]]], 1] &]
  • PARI
    is(n,R=divrem(3^logint(n,3),n),S=0)={while(R[1]!=1&&!bittest(S,R[2]), S+=1<M. F. Hasler, Feb 27 2018

Extensions

Extended to 10^5 by T. D. Noe and N. J. A. Sloane, Feb 20 2010
Entry revised by N. J. A. Sloane, Feb 22 2010

A306556 Integers that appear as (unreduced) numerators of segment endpoints when a ternary Cantor set is created.

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 8, 9, 18, 19, 20, 21, 24, 25, 26, 27, 54, 55, 56, 57, 60, 61, 62, 63, 72, 73, 74, 75, 78, 79, 80, 81, 162, 163, 164, 165, 168, 169, 170, 171, 180, 181, 182, 183, 186, 187, 188, 189, 216, 217, 218, 219, 222, 223, 224, 225, 234, 235, 236, 237, 240, 241, 242, 243
Offset: 1

Views

Author

Dan Dima, Feb 23 2019

Keywords

Comments

Nonnegative integers whose ternary representation contains only digits 0 and 2 except for at most a single digit 1 that is followed only by 0's.
Nonnegative integers that can be written in base 3 using only 0's and 2's, allowing the use of the "decimal" point (.) and replacing ....10..0(.) by ....02..2(.)2222...
Note that fractions are not reduced.
List of integers in the closure of the ternary Cantor set under multiplication by 3. The closure is the union of the translated ternary Cantor sets spanning [a(1), a(2)], [a(3), a(4)], [a(5), a(6)], ... . - Peter Munn, Jul 09 2019

Examples

			On 1st step we have [0,1/3] U [2/3,3/3] so we get a(1)=0, a(2)=1, a(3)=2, a(4)=3.
On 2nd step we have [0,1/9] U [2/9,3/9] U [6/9,7/9] U [8/9,9/9] so we get in addition a(5)=6, a(6)=7, a(7)=8, a(8)=9.
		

Crossrefs

Programs

  • PARI
    A306556(n) = {sm=0;while(n>1,ex=floor(log(n)/log(2));if(n-2^ex==0,sm=sm+3^(ex-1),sm=sm+2*3^(ex-1));n=n-2^ex);return(sm)}
    
  • PARI
    a(n) = n--; fromdigits(binary(n>>1),3)*2 + (n%2); \\ Kevin Ryde, Apr 23 2021

Formula

a(1)=0, a(2)=1;
a(2^n) = 3^(n-1) for n >= 1;
a(2^n+k) = 2*3^(n-1) + a(k) for 1 <= k <= 2^n.
From Peter Munn, Jul 09 2019: (Start)
a(2n-1) = A005823(n) = A191106(n)-1.
a(2n) = A191106(n) = A005823(n)+1.
a(2n-1) = (A055247(2n-1)-1)/3.
a(2n) = (A055247(2n) +1)/3.
a(2n-1) = (A191108(n)-1)/2.
a(2n) = (A191108(n)+1)/2.
(End)

A170951 Numbers n with the property that some of the fractions i/n (with gcd(i,n)=1, 0 < i/n < 1) are in the Cantor set and some are not.

Original entry on oeis.org

9, 12, 13, 27, 28, 30, 36, 39, 40, 81, 82, 84, 90, 91, 108, 117, 120, 121, 243, 244, 246, 252, 270, 273, 324, 328, 351, 360, 363, 364, 729, 730, 732, 738, 756, 757, 810, 819, 820, 949, 972, 984, 1036, 1053, 1080, 1089, 1092, 1093, 2187
Offset: 1

Views

Author

J. H. Conway and N. J. A. Sloane, Feb 20 2010

Keywords

Comments

Equals A054591 \ {1,3,4,10}.
The natural numbers may be divided into three sets: denominators which force membership in the Cantor set, denominators which deny membership in the Cantor set and denominators which neither force nor deny membership. The first set contains just the numbers 1, 3, 4, 10. The second set is A170944. The third set is the present sequence.

Examples

			1/9 is in the Cantor set, but 4/9 is not.
		

Crossrefs

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

A173931 Primitive numbers k such that m/k is in the Cantor set for some m.

Original entry on oeis.org

4, 10, 13, 28, 40, 82, 91, 121, 146, 182, 205, 244, 328, 364, 386, 656, 671, 730, 757, 820, 949, 1036, 1093, 1342, 1640, 2044, 2188, 2362, 2555, 2644, 2684, 2812, 2920, 3280, 3640, 3796, 3851, 4088, 4561, 4745, 5110, 6176, 6562, 6643, 7381, 7592, 7913
Offset: 1

Views

Author

T. D. Noe, Mar 03 2010

Keywords

Comments

Primitive means no k is a multiple of 3. This is sequence A054591 without the multiples of 3. Sequence A173793 is a subsequence. Sequence A173932 gives the least m such for each k. Sequence A173933 gives the number of m < k/2 such that m/k is in the Cantor set. Irregular triangle A173934 gives a row of m values for each k.
The remaining terms <10000 are 9139, 9490, 9841.
It is assumed that gcd(m,k) = 1.

Programs

  • Mathematica
    InCantorQ[m_, n_] := !MemberQ[Union[Flatten[RealDigits[m/n,3][[1]]]], 1]; cantor=Reap[Do[If[Mod[n,3] > 0, s=Select[Range[Ceiling[n/2]], GCD[n,# ]==1 && InCantorQ[ #,n] &]; If[s != {}, Sow[{n, s}]]], {n,10000}]][[2,1]]; First[Transpose[cantor]]

A368558 Number of fractions i/n that are in the Cantor set.

Original entry on oeis.org

2, 2, 4, 4, 2, 4, 2, 4, 8, 6, 2, 8, 8, 2, 4, 4, 2, 8, 2, 8, 4, 2, 2, 8, 2, 8, 16, 10, 2, 12, 2, 4, 4, 2, 2, 16, 2, 2, 16, 16, 2, 4, 2, 4, 8, 2, 2, 8, 2, 6, 4, 10, 2, 16, 2, 10, 4, 2, 2, 16, 2, 2, 8, 4, 8, 4, 2, 4, 4, 6, 2, 16, 2, 2, 4, 4, 2, 16, 2, 16
Offset: 1

Views

Author

Jason Yuen, Dec 30 2023

Keywords

Comments

The Cantor set is all reals in the range [0,1] which can be written in ternary without using digit 1 (including allowing 0222... to be used instead of 1000...).
All terms are even.
a(n) = O(n^(log_3(2))).
a(n) is the number of solutions to CCC 2023, Problem S5.
Does this sequence contain every positive even integer?

Examples

			For n = 12, there are a(12) = 8 fractions, and their numerators are i = 0, 1, 3, 4, 8, 9, 11, 12.
		

Crossrefs

Programs

  • Python
    def is_member(i, n):  # Returns True if i/n is in the Cantor set
      visited = set()
      while True:
        if n < 3 * i < 2 * n: return False
        if i in visited: return True
        visited.add(i)
        i = 3 * min(i, n - i)
    def a(n): return sum(is_member(i, n) for i in range(n + 1))
Showing 1-9 of 9 results.