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-10 of 11 results. Next

A170830 A121153 \ A005836.

Original entry on oeis.org

949, 1036, 2362, 2812, 2847, 3108, 7086, 8436, 8541, 9324, 21258, 25308, 25623, 27972, 28009, 63774, 63973, 66124, 75924, 76869, 83916, 84027, 84253, 191322, 191919, 198372, 227772, 230607, 235228, 251748, 252081, 252759, 253216, 573966, 575757
Offset: 1

Views

Author

N. J. A. Sloane, Feb 22 2010

Keywords

Comments

If n is in this sequence then so is 3n. - Charlie Neder, Feb 25 2019

Crossrefs

Cf. A170853, A005836, and the Cantor set sequence A121153.

Programs

  • PARI
    is1(n, R=divrem(3^logint(n, 3), n), S=0)={while(R[1]!=1&&!bittest(S, R[2]), S+=1<1, return(0)); n\=3); 1;}
    for(n = 1, 1000000, if(is1(n), if(is2(n),,print(n)))) \\ Charlie Neder, Feb 26 2019, from programs for A121153 and A005836

Extensions

Data corrected by Charlie Neder, Feb 25 2019

A170853 A005836 \ A121153.

Original entry on oeis.org

0, 31, 37, 85, 93, 94, 109, 111, 112, 118, 247, 253, 255, 256, 271, 274, 279, 280, 282, 283, 325, 327, 333, 334, 336, 337, 352, 354, 355, 361, 733, 739, 741, 742, 759, 760, 765, 766, 768, 769, 811, 813, 814, 822, 823, 837, 838, 840, 841, 846, 847, 849, 850, 973, 975, 976, 981, 982
Offset: 1

Views

Author

N. J. A. Sloane, Feb 22 2010

Keywords

Crossrefs

Cf. A170830, A005836 and the Cantor set sequence A121153.

Extensions

More terms from Hakan Icoz, Dec 25 2021

A170944 Complement of A121153.

Original entry on oeis.org

2, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 31, 32, 33, 34, 35, 37, 38, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 83, 85, 86, 87, 88, 89
Offset: 1

Views

Author

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

Keywords

Comments

If n is a term in this sequence then i/n is not in the Cantor set.

Crossrefs

A170952 Take the Cantor set sequence A121153 and if the entry m = A121153(n) is in the range 3^k <= m < 3^(k+1), subtract 3^k from it.

Original entry on oeis.org

0, 0, 1, 0, 1, 3, 4, 0, 1, 3, 9, 12, 13, 0, 1, 3, 9, 10, 27, 36, 39, 40, 0, 1, 3, 9, 27, 30, 81, 85, 108, 117, 120, 121, 0, 1, 3, 9, 27, 28, 81, 90, 91, 220, 243, 255, 307, 324, 351, 360, 363, 364, 0, 1, 3, 9, 27, 81, 84, 175, 243, 270, 273, 625, 660, 729, 733, 765, 921, 972, 1053
Offset: 1

Views

Author

J. H. Conway, T. D. Noe and N. J. A. Sloane, Feb 22 2010

Keywords

Examples

			If written as a triangle:
0,
0, 1,
0, 1, 3, 4,
0, 1, 3, 9, 12, 13,
0, 1, 3, 9, 10, 27, 36, 39, 40,
0, 1, 3, 9, 27, 30, 81, 85, 108, 117, 120, 121,
0, 1, 3, 9, 27, 28, 81, 90, 91, 220, 243, 255, 307, 324, 351, 360, 363, 364,
0, 1, 3, 9, 27, 81, 84, 175, 243, 270, 273, 625, 660, 729, 733, 765, 921, 972, 1053, 1080, 1089, 1092, 1093,
...
		

Crossrefs

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

A170943 Numbers n with the property that when 1/n is written in base 3 (in either of the two representations, if the representation is ambiguous) the fractional part contains no 1's.

Original entry on oeis.org

1, 4, 10, 12, 13, 28, 30, 36, 39, 40, 82, 84, 90, 91, 108, 117, 120, 121, 244, 246, 252, 270, 273, 324, 328, 351, 360, 363, 364, 730, 732, 738, 756, 757, 810, 819, 820, 949, 972, 984, 1036, 1053, 1080, 1089, 1092, 1093, 2188, 2190, 2196, 2214, 2268, 2271, 2362, 2430
Offset: 1

Views

Author

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

Keywords

Comments

That is, neither of the two representations of 1/n in base 3 contain a 1.
This is A121153 without the numbers 3^k, k >= 1. See that entry for further information.

Examples

			1/3 in base 3 can be written as either .1 or .0222222... The first version contains a 1, so 3 is not in the sequence.
1/4 in base 3 is .02020202020..., so 4 is in the sequence.
		

Crossrefs

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

A173793 Primitive numbers n such that 1/n is in the Cantor set.

Original entry on oeis.org

1, 4, 10, 13, 28, 40, 82, 91, 121, 244, 328, 364, 730, 757, 820, 949, 1036, 1093, 2188, 2362, 2812, 2920, 3280, 6562, 6643, 7381, 9490, 9841, 19684, 20440, 26248, 26572, 28009, 29524, 59050, 59293, 63973, 65620, 66124, 66430, 84253, 88573, 177148
Offset: 1

Views

Author

T. D. Noe, Feb 24 2010

Keywords

Comments

Sequence A121153 gives the n such that 1/n is in the Cantor set. Most of those n are 3 times a smaller number in that sequence. This sequence has only those terms in A121153 that are not 3 times a smaller number in the sequence. Note that A076270 is a subsequence.

A173784 Number of numbers k such that 1/k is in the Cantor set and 3^n <= k < 3^(n+1).

Original entry on oeis.org

1, 2, 4, 6, 9, 12, 18, 23, 28, 34, 42, 49, 61, 68, 80, 91, 103, 111, 128, 138, 156
Offset: 0

Views

Author

T. D. Noe, Feb 24 2010

Keywords

Comments

This sequence gives the length of the rows in the irregular triangle A170952. See A121153 for the values of k.
Showing 1-10 of 11 results. Next