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 16 results. Next

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.

A001196 Double-bitters: only even length runs in binary expansion.

Original entry on oeis.org

0, 3, 12, 15, 48, 51, 60, 63, 192, 195, 204, 207, 240, 243, 252, 255, 768, 771, 780, 783, 816, 819, 828, 831, 960, 963, 972, 975, 1008, 1011, 1020, 1023, 3072, 3075, 3084, 3087, 3120, 3123, 3132, 3135, 3264, 3267, 3276, 3279, 3312, 3315, 3324, 3327, 3840, 3843
Offset: 0

Views

Author

N. J. A. Sloane, based on an email from Bart la Bastide (bart(AT)xs4all.nl)

Keywords

Comments

Numbers whose set of base 4 digits is {0,3}. - Ray Chandler, Aug 03 2004
n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 4 for every i. - Ray Chandler, Aug 03 2004
The first 2^n terms of the sequence could be obtained using the Cantor-like process for the segment [0, 4^n-1]. E.g., for n=1 we have [0, {1, 2}, 3] such that numbers outside of braces are the first 2 terms of the sequence; for n=2 we have [0, {1, 2}, 3, {4, 5, 6, 7, 8, 9, 10, 11}, 12, {13, 14}, 15] such that the numbers outside of braces are the first 4 terms of the sequence, etc. - Vladimir Shevelev, Dec 17 2012
From Emeric Deutsch, Jan 26 2018: (Start)
Also, the indices of the compositions having only even parts. For the definition of the index of a composition, see A298644. For example, 195 is in the sequence since its binary form is 11000011 and the composition [2,4,2] has only even parts. 132 is not in the sequence since its binary form is 10000100 and the composition [1,4,1,2] also has odd parts.
The command c(n) from the Maple program yields the composition having index n. (End)
After the k-th step of generating the Koch snowflake curve, label the edges of the curve consecutively 0..3*4^k-1 starting from a vertex of the originating triangle. a(0), a(1), ... a(2^k-1) are the labels of the edges contained in one edge of the originating triangle. Add 4^k to each label to get the labels for the next edge of the triangle. Compare with A191108 in respect of the Sierpinski arrowhead curve. - Peter Munn, Aug 18 2019

Crossrefs

3 times the Moser-de Bruijn sequence A000695.
Two digits in other bases: A005823, A097252-A097262.
Digit duplication in other bases: A338086, A338754.
Main diagonal of A054238.
Cf. A191108.

Programs

  • C
    int a_next(int a_n) { int t = a_n << 1; return a_n ^ t ^ (t + 3); } /* Falk Hüffner, Jan 24 2022 */
  • Haskell
    a001196 n = if n == 0 then 0 else 4 * a001196 n' + 3 * b
                where (n',b) = divMod n 2
    -- Reinhard Zumkeller, Feb 21 2014
    
  • Maple
    Runs := proc (L) local j, r, i, k: j := 1: r[j] := L[1]: for i from 2 to nops(L) do if L[i] = L[i-1] then r[j] := r[j], L[i] else j := j+1: r[j] := L[i] end if end do: [seq([r[k]], k = 1 .. j)] end proc: RunLengths := proc (L) map(nops, Runs(L)) end proc: c := proc (n) ListTools:-Reverse(convert(n, base, 2)): RunLengths(%) end proc: A := {}: for n to 3350 do if type(product(1+c(n)[j], j = 1 .. nops(c(n))), odd) = true then A := `union`(A, {n}) else  end if end do: A; # most of the Maple  program is due to W. Edwin Clark. - Emeric Deutsch, Jan 26 2018
    # second Maple program:
    a:= proc(n) option remember;
         `if`(n<2, 3*n, 4*a(iquo(n, 2, 'r'))+3*r)
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Jan 24 2022
  • Mathematica
    fQ[n_] := Union@ Mod[Length@# & /@ Split@ IntegerDigits[n, 2], 2] == {0}; Select[ Range@ 10000, fQ] (* Or *)
    fQ[n_] := Union@ Join[IntegerDigits[n, 4], {0, 3}] == {0, 3}; Select[ Range@ 10000, fQ] (* Robert G. Wilson v, Dec 24 2012 *)
  • PARI
    a(n) = 3*fromdigits(binary(n),4); \\ Kevin Ryde, Nov 07 2020
    
  • Python
    def inA001196(n):
        while n != 0:
            if n%4 == 1 or n%4 == 2:
                return 0
            n = n//4
        return 1
    n, a = 0, 0
    while n < 20:
        if inA001196(a):
            print(n,a)
            n = n+1
        a = a+1 # A.H.M. Smeets, Aug 19 2019
    
  • Python
    from itertools import groupby
    def ok2lb(n):
      if n == 0: return True  # by convention
      return all(len(list(g))%2 == 0 for k, g in groupby(bin(n)[2:]))
    print([i for i in range(3313) if ok2lb(i)]) # Michael S. Branicky, Jan 04 2021
    
  • Python
    def A001196(n): return 3*int(bin(n)[2:],4) # Chai Wah Wu, Aug 21 2023
    

Formula

a(2n) = 4*a(n), a(2n+1) = 4*a(n) + 3.
a(n) = 3 * A000695(n).
Sum_{n>=1} 1/a(n) = 0.628725478158702414849086504025451177643560169366348272891020450593453403709... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 12 2022

A033052 a(1) = 1, a(2n) = 16a(n), a(2n+1) = a(2n)+1.

Original entry on oeis.org

0, 1, 16, 17, 256, 257, 272, 273, 4096, 4097, 4112, 4113, 4352, 4353, 4368, 4369, 65536, 65537, 65552, 65553, 65792, 65793, 65808, 65809, 69632, 69633, 69648, 69649, 69888, 69889, 69904, 69905, 1048576, 1048577, 1048592, 1048593, 1048832
Offset: 0

Views

Author

Keywords

Comments

Numbers whose set of base 16 digits is {0,1}.
a(n) = Xpower(n,4). - Antti Karttunen, Apr 26 1999
Sums of distinct powers of 16.
For every nonnegative n, A000695(n) is a unique sum of the form a(k) + 4a(l). Thus every nonnegative n is a unique sum of the form a(p) + 2a(q) + 4a(r) + 8a(s). This gives a one-to-one map of the set N_0 of all nonnegative integers to (N_0)^4. Furthermore, if, for a fixed positive integer m, to consider all sums of distinct powers of 4^m, then one can obtain a one-to-one map of the set N_0 to (N_0)^(2^m). - Vladimir Shevelev, Nov 14 2008

Crossrefs

Column 4 of A048723. Row 15 of array A104257.

Programs

Formula

a(n) = Sum_{i=0..m} d(i)*16^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097262(n)/15.
a(2n) = 16*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*16^k. - Philippe Deléham, Oct 19 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 16^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017
a(n) = A000695(A000695(n)). - Alan Michael Gómez Calderón, Mar 23 2025

Extensions

Extended by Ray Chandler, Aug 03 2004
Simpler definition from Ralf Stephan, Jun 18 2005

A097251 Numbers whose set of base 5 digits is {0,4}.

Original entry on oeis.org

0, 4, 20, 24, 100, 104, 120, 124, 500, 504, 520, 524, 600, 604, 620, 624, 2500, 2504, 2520, 2524, 2600, 2604, 2620, 2624, 3000, 3004, 3020, 3024, 3100, 3104, 3120, 3124, 12500, 12504, 12520, 12524, 12600, 12604, 12620, 12624, 13000, 13004, 13020
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 5 for every i.
The first 2^n terms of the sequence could be obtained using the Cantor-like process for the segment [0,5^n-1]. For example, for n=1 we have [0, {1,2,3},4] such that numbers outside of braces are the first 2 terms of the sequence; for n=2 we have [0, {1,2,3}, 4, {5,...,19}, 20, {21,22,23}, 24] such that the numbers outside of braces are the first 4 terms of the sequence, etc. - Vladimir Shevelev, Dec 17 2012

Crossrefs

Programs

  • Magma
    [n: n in [0..20000] | Set(IntegerToSequence(n, 5)) subset {0, 4}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,4},IntegerDigits[n,5]]=={0,4};Select[Range[0,20000],fQ] (* Vincenzo Librandi, May 25 2012 *)
    FromDigits[#,5]&/@Tuples[{0,4},6] (* Harvey P. Dale, Feb 01 2015 *)
  • Maxima
    a[0]:0$ a[n]:=5*a[floor(n/2)]+2*(1-(-1)^n)$ makelist(a[n], n, 0, 42); /* Bruno Berselli, May 25 2012 */
    
  • PARI
    a(n) = 4*fromdigits(binary(n),5); \\ Kevin Ryde, Jun 03 2020

Formula

a(n) = 4*A033042(n).
a(2n) = 5*a(n), a(2n+1) = a(2n)+4.

A097256 Numbers whose set of base 10 digits is {0,9}.

Original entry on oeis.org

0, 9, 90, 99, 900, 909, 990, 999, 9000, 9009, 9090, 9099, 9900, 9909, 9990, 9999, 90000, 90009, 90090, 90099, 90900, 90909, 90990, 90999, 99000, 99009, 99090, 99099, 99900, 99909, 99990, 99999, 900000, 900009, 900090, 900099, 900900
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 10 for every i.

Crossrefs

Programs

  • Haskell
    a097256 n = a097256_list !! n
    a097256_list = map (* 9) a007088_list
    -- Reinhard Zumkeller, Jan 10 2012
  • Maple
    A097256:=n->(9/2) * add((1-(-1)^floor(n/2^i))*10^i, i=0..n); seq(A097256(n), n=0..30); # Wesley Ivan Hurt, Feb 11 2014
  • Mathematica
    Table[(9/2) Sum[(1 - (-1)^Floor[n/2^i]) 10^i, {i, 0, n}], {n, 0, 30}] (* Wesley Ivan Hurt, Feb 11 2014 *)

Formula

a(n) = 9*A007088(n).
a(2n) = 10*a(n), a(2n+1) = a(2n)+9.

A097252 Numbers whose set of base 6 digits is {0,5}.

Original entry on oeis.org

0, 5, 30, 35, 180, 185, 210, 215, 1080, 1085, 1110, 1115, 1260, 1265, 1290, 1295, 6480, 6485, 6510, 6515, 6660, 6665, 6690, 6695, 7560, 7565, 7590, 7595, 7740, 7745, 7770, 7775, 38880, 38885, 38910, 38915, 39060, 39065, 39090, 39095, 39960, 39965
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 6 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..40000] | Set(IntegerToSequence(n, 6)) subset {0, 5}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,5},IntegerDigits[n,6]]=={0,5};Select[Range[0,40000],fQ] (* Vincenzo Librandi, May 25 2012 *)
    FromDigits[#,6]&/@Tuples[{ 0,5},6] (* Harvey P. Dale, Aug 15 2021 *)
  • Python
    def A079252(n): return 5*int(bin(n)[2:],6) # Chai Wah Wu, Apr 04 2025

Formula

a(n) = 5*A033043(n).
a(2n) = 6*a(n), a(2n+1) = a(2n)+5.

A097254 Numbers whose set of base 8 digits is {0,7}.

Original entry on oeis.org

0, 7, 56, 63, 448, 455, 504, 511, 3584, 3591, 3640, 3647, 4032, 4039, 4088, 4095, 28672, 28679, 28728, 28735, 29120, 29127, 29176, 29183, 32256, 32263, 32312, 32319, 32704, 32711, 32760, 32767, 229376, 229383, 229432, 229439, 229824
Offset: 1

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 8 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..250000] | Set(IntegerToSequence(n, 8)) subset {0, 7}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,7},IntegerDigits[n,8]]=={0,7};Select[Range[0,300000],fQ] (* Vincenzo Librandi, May 25 2012 *)
    FromDigits[#,8]&/@Tuples[{0,7},6] (* Harvey P. Dale, Aug 10 2021 *)
  • Maxima
    a[1]:0$ a[n]:=8*a[floor((n+1)/2)]+7*(1+(-1)^n)/2$ makelist(a[n], n, 1, 37); /* Bruno Berselli, May 25 2012 */
    
  • PARI
    a(n) = 7*fromdigits(binary(n-1), 8) \\ Rémy Sigrist, Dec 06 2018

Formula

a(n) = 7*A033045(n-1).
a(2n-1) = 8*a(n), a(2n) = 8*a(n)+7.

A097261 Numbers whose set of base 15 digits is {0,E}, where E base 15 = 14 base 10.

Original entry on oeis.org

0, 14, 210, 224, 3150, 3164, 3360, 3374, 47250, 47264, 47460, 47474, 50400, 50414, 50610, 50624, 708750, 708764, 708960, 708974, 711900, 711914, 712110, 712124, 756000, 756014, 756210, 756224, 759150, 759164, 759360, 759374, 10631250
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 15 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..4500000] | Set(IntegerToSequence(n, 15)) subset {0, 14}]; // Vincenzo Librandi, Jun 05 2012
  • Mathematica
    f[n_] := FromDigits[ IntegerDigits[n, 2] /. {1 -> 14}, 15]; Array[f, 33, 0] (* or *)
    FromDigits[#, 15] & /@ Tuples[{0, 14}, 6] (* Harvey P. Dale, Sep 22 2011 *) (* or much slower *)
    fQ[n_] := Union@ Join[{0, 14}, IntegerDigits[n, 15]] == {0, 14}; Select[ Range[0, 10634414 ], fQ] (* Robert G. Wilson v, May 12 2012 *)

Formula

a(n) = 14*A033051(n).
a(2n) = 15*a(n), a(2n+1) = a(2n)+14.

A097253 Numbers whose set of base 7 digits is {0,6}.

Original entry on oeis.org

0, 6, 42, 48, 294, 300, 336, 342, 2058, 2064, 2100, 2106, 2352, 2358, 2394, 2400, 14406, 14412, 14448, 14454, 14700, 14706, 14742, 14748, 16464, 16470, 16506, 16512, 16758, 16764, 16800, 16806, 100842, 100848, 100884, 100890, 101136
Offset: 1

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 7 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..200000] | Set(IntegerToSequence(n, 7)) subset {0, 6}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,6},IntegerDigits[n,7]]=={0,6};Select[Range[0,140000],fQ] (* Vincenzo Librandi, May 25 2012 *)
    FromDigits[#,7]&/@Tuples[{0,6},6] (* This program is several thousand times faster than the first program, above. *) (* Harvey P. Dale, Aug 12 2023 *)
  • Maxima
    a[0]:0$ a[n]:=7*a[floor(n/2)]+3*(1-(-1)^n)$ makelist(a[n], n, 0, 36); /* Bruno Berselli, May 25 2012 */

Formula

a(n) = 6*A033044(n).
a(2n) = 7*a(n), a(2n+1) = a(2n)+6.

Extensions

Offset corrected by Arkadiusz Wesolowski, Nov 09 2013

A097255 Numbers whose set of base 9 digits is {0,8}.

Original entry on oeis.org

0, 8, 72, 80, 648, 656, 720, 728, 5832, 5840, 5904, 5912, 6480, 6488, 6552, 6560, 52488, 52496, 52560, 52568, 53136, 53144, 53208, 53216, 58320, 58328, 58392, 58400, 58968, 58976, 59040, 59048, 472392, 472400, 472464, 472472, 473040
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 9 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..500000] | Set(IntegerToSequence(n, 9)) subset {0, 8}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,8},IntegerDigits[n,9]]=={0,8};Select[Range[0,500000],fQ] (* or *) FromDigits[#,9]&/@Tuples[{0,8},6](* Vincenzo Librandi, May 25 2012 *)
  • Maxima
    a[0]:0$ a[n]:=9*a[floor(n/2)]+4*(1-(-1)^n)$ makelist(a[n], n, 0, 36); /* Bruno Berselli, May 26 2012 */

Formula

a(n) = 8*A033046(n).
a(2n) = 9*a(n), a(2n+1) = a(2n)+8.
Showing 1-10 of 16 results. Next