A005823 Numbers whose ternary expansion contains no 1's.
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
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).
Links
- Winston de Greef, Table of n, a(n) for n = 1..16384 (first 1024 terms from T. D. Noe)
- J.-P. Allouche and Jeffrey Shallit, The ring of k-regular sequences, Theoretical Computer Sci., Vol. 98, No. 2 (1992), pp. 163-197.
- J.-P. Allouche and Jeffrey Shallit, The ring of k-regular sequences, Theoretical Computer Sci., Vol. 98, No. 2 (1992), pp. 163-197.
- Robert Baillie and Thomas Schmelzer, Summing Kempner's Curious (Slowly-Convergent) Series, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008.
- Sajed Haque, Chapter 3.4 of Discriminators of Integer Sequences, 2017, See p. 45.
- Sajed Haque and Jeffrey Shallit, Discriminators and k-Regular Sequences, arXiv:1605.00092 [cs.DM], 2016.
- Clark Kimberling, Affinely recursive sets and orderings of languages, Discrete Math., Vol. 274, No. 1-3 (2004), pp. 147-160.
- Kurt Mahler, The representation of squares to the base 3, Acta Arith., Vol. 53, Issue 1 (1989), pp. 99-106.
- M. Mendes France and A. J. van der Poorten, From geometry to Euler identities, Theoret. Comput. Sci., Vol. 65, No. 2 (1989), pp. 213-220.
- Eric Weisstein's World of Mathematics, Cantor Set.
- Index entries for 3-automatic sequences.
Crossrefs
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.
Comments