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

A032924 Numbers whose ternary expansion contains no 0.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 13, 14, 16, 17, 22, 23, 25, 26, 40, 41, 43, 44, 49, 50, 52, 53, 67, 68, 70, 71, 76, 77, 79, 80, 121, 122, 124, 125, 130, 131, 133, 134, 148, 149, 151, 152, 157, 158, 160, 161, 202, 203, 205, 206, 211, 212, 214, 215, 229, 230, 232, 233, 238, 239
Offset: 1

Views

Author

Keywords

Comments

Complement of A081605. - Reinhard Zumkeller, Mar 23 2003
Subsequence of A154314. - Reinhard Zumkeller, Jan 07 2009
The first 28 terms are the range of A059852 (Morse codes for letters, when written in base 3) union {44, 50} (which correspond to Morse codes of Ü and Ä). Subsequent terms represent the Morse code of other symbols in the same coding. - M. F. Hasler, Jun 22 2020

Crossrefs

Zeroless numbers in some other bases <= 10: A000042 (base 2), A023705 (base 4), A248910 (base 6), A255805 (base 8), A255808 (base 9), A052382 (base 10).

Programs

  • Haskell
    a032924 n = a032924_list !! (n-1)
    a032924_list = iterate f 1 where
       f x = 1 + if r < 2 then x else 3 * f x'  where (x', r) = divMod x 3
    -- Reinhard Zumkeller, Mar 07 2015, May 04 2012
    
  • Maple
    f:= proc(n) local L,i,m;
       L:= convert(n,base,2);
       m:= nops(L);
       add((1+L[i])*3^(i-1),i=1..m-1);
    end proc:
    map(f, [$2..101]); # Robert Israel, Aug 04 2015
  • Mathematica
    Select[Range@ 240, Last@ DigitCount[#, 3] == 0 &] (* Michael De Vlieger, Aug 05 2015 *)
    Flatten[Table[FromDigits[#,3]&/@Tuples[{1,2},n],{n,5}]] (* Harvey P. Dale, May 28 2016 *)
  • PARI
    apply( {A032924(n)=if(n<3,n,3*self()((n-1)\2)+2-n%2)}, [1..99]) \\ M. F. Hasler, Jun 22 2020
    
  • PARI
    a(n) = fromdigits(apply(d->d+1,binary(n+1)[^1]), 3); \\ Kevin Ryde, Jun 23 2020
    
  • Python
    def a(n): return sum(3**i*(int(b)+1) for i, b in enumerate(bin(n+1)[:2:-1]))
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Aug 15 2022
    
  • Python
    def is_A032924(n):
        while n > 2:
           n,r = divmod(n,3)
           if r==0: return False
        return n > 0
    print([n for n in range(250) if is_A032924(n)]) # M. F. Hasler, Feb 15 2023
    
  • Python
    def A032924(n): return int(bin(m:=n+1)[3:],3) + (3**(m.bit_length()-1)-1>>1) # Chai Wah Wu, Oct 13 2023

Formula

a(n) = A107680(n) + A107681(n). - Reinhard Zumkeller, May 20 2005
A081604(A107681(n)) <= A081604(A107680(n)) = A081604(a(n)) = A000523(n+1). - Reinhard Zumkeller, May 20 2005
A077267(a(n)) = 0. - Reinhard Zumkeller, Mar 02 2008
a(1)=1, a(n+1) = f(a(n)+1,a(n)+1) where f(x,y) = if x<3 and x<>0 then y, else if x mod 3 = 0 then f(y+1,y+1), else f(floor(x/3),y). - Reinhard Zumkeller, Mar 02 2008
a(2*n) = a(2*n-1)+1, n>0. - Zak Seidov, Jul 27 2009
A212193(a(n)) = 0. - Reinhard Zumkeller, May 04 2012
a(2*n+1) = 3*a(n)+1. - Robert Israel, Aug 05 2015
G.f.: x/(1-x)^2 + Sum_{m >= 1} 3^(m-1)*x^(2^(m+1)-1)/((1-x^(2^m))*(1-x)). - Robert Israel, Aug 04 2015
A065361(a(n)) = n. - Rémy Sigrist, Feb 06 2023
Sum_{n>=1} 1/a(n) = 3.4977362637842652509313189236131190039368413460747606236619907531632476445332666030262441154353753276457... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Apr 14 2025

A002977 Klarner-Rado sequence: a(1) = 1; subsequent terms are defined by the rule that if m is present so are 2m+1 and 3m+1.

Original entry on oeis.org

1, 3, 4, 7, 9, 10, 13, 15, 19, 21, 22, 27, 28, 31, 39, 40, 43, 45, 46, 55, 57, 58, 63, 64, 67, 79, 81, 82, 85, 87, 91, 93, 94, 111, 115, 117, 118, 121, 127, 129, 130, 135, 136, 139, 159, 163, 165, 166, 171, 172, 175, 183, 187, 189, 190, 193, 202, 223, 231, 235, 237
Offset: 1

Views

Author

Keywords

Comments

Complement of A132142: A132138(a(n)) = 1; for all terms m there exists at least one x such that A132140(x)=m. - Reinhard Zumkeller, Aug 20 2007
a(n+1) = A007448(a(n)), which also gives the record values of A007448 and their positions. - Reinhard Zumkeller, Jul 14 2010
Named after the American mathematician David Anthony Klarner (1940-1999) and the German-British mathematician Richard Rado (1906-1989). - Amiram Eldar, Jun 24 2021

Examples

			a(10) = 21 = 2*(3*(2*1+1)+1)+1: A132139(A132140(10)) = A132139(43) = 21;
a(14) = 31 = 3*(3*(2*1+1)+1)+1 = 2*(2*(2*(2*1+1)+1)+1)+1: A132139(A132140(14)) = A132139(52) = 31 and A132139(A132140(16)) = A132139(121) = 31.
		

References

  • Michael L. Fredman and Donald E. Knuth, Recurrence relations based on minimization, Abstract 71T-B234, Notices Amer. Math. Soc., Vol. 18 (1971), p. 960.
  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 78.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence)
  • Niklaus Wirth, Systematisches Programmieren, 1975, exercise 15.12.

Crossrefs

See A276786 for multi-set version.

Programs

  • Haskell
    import Data.Set
    a002977 n = a002977_list !! (n-1)
    a002977_list = f $ singleton 1 where
       f :: Set Integer -> [Integer]
       f s = m : (f $ insert (3*m+1) $ insert (2*m+1) s') where
            (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Feb 10 2011
    
  • Haskell
    See Niemeijer link.
    import Data.List.Ordered (union)
    a002977_list = 1 : union
       (map ((+1) . (*2)) a002977_list) (map ((+1) . (*3)) a002977_list)
    -- Reinhard Zumkeller, Nov 12 2014
    
  • Mathematica
    Union[ Flatten[ NestList[{2# + 1, 3# + 1} &, 1, 6]]] (* Robert G. Wilson v, May 11 2005 *)
  • PARI
    list(lim)=my(u=List(),v=List([1]),t,sz); while(#v, listput(u,v[1]); t=2*v[1]+1; if(t>lim, listpop(v,1); next); listput(v,t); t=3*v[1]+1; listpop(v,1); if(t<=lim, listput(v,t)); if(#v>sz, u=Set(u); v=List(setminus(Set(v),u)); u=List(u); sz=2*#v)); Set(u) \\ Charles R Greathouse IV, Aug 21 2017

Formula

It seems that lim_{n->infinity} log(A002977(n))/log(n) = C = 1.3... and probably A002977(n) is asymptotic to u*n^C with u=1.0... - Benoit Cloitre, Nov 06 2002
Limit_{n->infinity} log(A002977(n))/log(n) = C = 1.269220905243564855888589424556..., and lim_{n->infinity} A002977(n)/n^C = u = 1.335... - Yi Yang, Jul 23 2011, Aug 21 2017

Extensions

More terms from Ray Chandler, Sep 06 2003

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

A132141 Numbers whose ternary representation begins with 1.

Original entry on oeis.org

1, 3, 4, 5, 9, 10, 11, 12, 13, 14, 15, 16, 17, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 20 2007

Keywords

Comments

The lower and upper asymptotic densities of this sequence are 1/2 and 3/4, respectively. - Amiram Eldar, Feb 28 2021

Crossrefs

Programs

  • Haskell
    a132141 n = a132141_list !! (n-1)
    a132141_list = filter ((== 1) . until (< 3) (flip div 3)) [1..]
    -- Reinhard Zumkeller, Feb 06 2015
  • Mathematica
    Flatten[(Range[3^#,2 3^#-1])&/@Range[0,4]] (* Zak Seidov, Mar 03 2009 *)
  • PARI
    s=[];for(n=0,4,for(x=3^n,2*3^n-1,s=concat(s,x)));s \\ Zak Seidov, Mar 03 2009
    
  • PARI
    a(n) = n + 3^logint(n<<1,3) >> 1; \\ Kevin Ryde, Feb 19 2022
    

Formula

A number n is a term iff 3^m <= n < 2*3^m -1, for m=0,1,2,... - Zak Seidov, Mar 03 2009
a(n) = n + (3^floor(log_3(2*n)) - 1)/2. - Kevin Ryde, Feb 19 2022
Showing 1-4 of 4 results.