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

A000695 Moser-de Bruijn sequence: sums of distinct powers of 4.

Original entry on oeis.org

0, 1, 4, 5, 16, 17, 20, 21, 64, 65, 68, 69, 80, 81, 84, 85, 256, 257, 260, 261, 272, 273, 276, 277, 320, 321, 324, 325, 336, 337, 340, 341, 1024, 1025, 1028, 1029, 1040, 1041, 1044, 1045, 1088, 1089, 1092, 1093, 1104, 1105, 1108, 1109, 1280, 1281, 1284, 1285
Offset: 0

Views

Author

Keywords

Comments

Although this is a list, it has offset 0 for both historical and mathematical reasons.
Numbers whose set of base-4 digits is a subset of {0,1}. - Ray Chandler, Aug 03 2004, corrected by M. F. Hasler, Oct 16 2018
Numbers k such that the sum of the base-2 digits of k = sum of the base-4 digits of k. - Clark Kimberling
Numbers having the same representation in both binary and negabinary (A039724). - Eric W. Weisstein
This sequence has many other interesting and useful properties. Every term k corresponds to a unique pair i,j with k = a(i) + 2*a(j) (i=A059905(n), j=A059906(n)) -- see A126684. Every list of numbers L = [L1,L2,L3,...] can be encoded uniquely by "recursive binary interleaving", where f(L) = a(L1) + 2*a(f([L2,L3,...])) with f([])=0. - Marc LeBrun, Feb 07 2001
This may be described concisely using the "rebase" notation b[n]q, which means "replace b with q in the expansion of n", thus "rebasing" n from base b into base q. The present sequence is 2[n]4. Many interesting operations (e.g., 10[n](1/10) = digit reverse, shifted) are nicely expressible this way. Note that q[n]b is (roughly) inverse to b[n]q. It's also natural to generalize the idea of "basis" so as to cover the likes of F[n]2, the so-called "fibbinary" numbers (A003714) and provide standard ready-made images of entities obeying other arithmetics, say like GF2[n]2 (e.g., primes = A014580, squares = the present sequence, etc.). - Marc LeBrun, Mar 24 2005
a(n) is also equal to the product n X n formed using carryless binary multiplication (A059729, A063010). - Henry Bottomley, Jul 03 2001
Numbers k such that A004117(k) is odd. - Pontus von Brömssen, Nov 25 2008
Fixed point of the morphism: 0 -> 01; 1 -> 45; 2 -> 89; ...; n -> (4n)(4n+1), starting from a(0)=0. - Philippe Deléham, Oct 22 2011
If n is even and present, so is n+1. - Robert G. Wilson v, Oct 24 2014
Also: interleave binary digits of n with 0's. (Equivalent to the "rebase" interpretation above.) - M. F. Hasler, Oct 16 2018
Named after the Austrian-Canadian mathematician Leo Moser (1921-1970) and the Dutch mathematician Nicolaas Govert de Bruijn (1918-2012). - Amiram Eldar, Jun 19 2021
Conjecture: The sums of distinct powers of k > 2 can be constructed as the following (k-1)-ary rooted tree. For each n the tree grows and a(n) is then the total number of nodes. For n = 1, the root of the tree is added. For n > 1, if n is odd one leaf of depth n-2 grows one child. If n is even all leaves of depth >= (n - 1 - A000225(A001511(n/2))) grow the maximum number of children. An illustration is provided in the links. - John Tyler Rascoe, Oct 09 2022

Examples

			G.f.: x + 4*x^2 + 5*x^3 + 16*x^4 + 17*x^5 + 20*x^6 + 21*x^7 + 64*x^8 + ...
If n=27, then b_0=1, b_1=1, b_2=0, b_3=1, b_4=1. Therefore a(27) = 4^4 + 4^3 + 4 + 1 = 325; k = b_0 + b_2*2 + b_4*2^2 = 5, l = b_1 + b_3*2 = 3, such that a(5)=17, a(3)=5 and 27 = 17 + 2*5. - _Vladimir Shevelev_, Nov 10 2008
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

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.
Main diagonal of A048720, second column of A048723.
A062880(n) = 2*a(n); A001196(n) = 3*a(n).
Row 4 of array A104257.

Programs

  • C
    uint32_t a_next(uint32_t a_n) { return (a_n + 0xaaaaaaab) & 0x55555555; } /* Falk Hüffner, Jan 24 2022 */
  • Haskell
    a000695 n = if n == 0 then 0 else 4 * a000695 n' + b
                where (n',b) = divMod n 2
    -- Reinhard Zumkeller, Feb 21 2014, Dec 03 2011
    
  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 2)
            r += b * q
            b *= 4
        end
    r end; [a(n) for n in 0:51] |> println # Peter Luschny, Jan 03 2021
    
  • Magma
    m:=60; R:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!( (&+[4^k*x^(2^k)/(1+x^(2^k)): k in [0..20]])/(1-x) )); // G. C. Greubel, Dec 06 2018
    
  • Maple
    a:= proc(n) local m, r, b; m, r, b:= n, 0, 1;
          while m>0 do r:= r+b*irem(m, 2, 'm'); b:= b*4 od; r
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 16 2013
  • Mathematica
    Table[FromDigits[Riffle[IntegerDigits[n, 2], 0], 2], {n, 0, 51}] (* Jacob A. Siehler, Jun 30 2010 *)
    Table[FromDigits[IntegerDigits[n, 2], 4], {n, 0, 51}] (* IWABUCHI Yu(u)ki, Apr 06 2013 *)
    Union@ Flatten@ NestList[ Join[ 4#, 4# + 1] &, {0}, 6] (* Robert G. Wilson v, Aug 30 2014 *)
    Select[ Range[0, 1320], Total@ IntegerDigits[#, 2] == Total@ IntegerDigits[#, 4] &] (* Robert G. Wilson v, Oct 24 2014 *)
    Union[FromDigits[#,4]&/@Flatten[Table[Tuples[{0,1},n],{n,6}],1]] (* Harvey P. Dale, Oct 03 2015 *)
    a[ n_] := Which[n < 1, 0, EvenQ[n], a[n/2] 4, True, a[n - 1] + 1]; (* Michael Somos, Nov 30 2016 *)
  • PARI
    a(n)=n=binary(n);sum(i=1,#n,n[i]*4^(#n-i)) \\ Charles R Greathouse IV, Mar 04 2013
    
  • PARI
    {a(n) = if( n<1, 0, n%2, a(n-1) + 1, a(n/2) * 4)}; /* Michael Somos, Nov 30 2016 */
    
  • PARI
    A000695(n)=fromdigits(binary(n),4) \\ M. F. Hasler, Oct 16 2018
    
  • Python
    def a(n):
        n = bin(n)[2:]
        x = len(n)
        return sum(int(n[i]) * 4**(x - 1 - i) for i in range(x))
    [a(n) for n in range(101)] # Indranil Ghosh, Jun 25 2017
    
  • Python
    def a():
        x = 0
        while True:
            yield x
            y = ~(x << 1)
            x = (x - y) & y # Falk Hüffner, Dec 21 2021
    
  • Python
    from itertools import count, islice
    def A000695_gen(): # generator of terms
        yield (a:=0)
        for n in count(1):
            yield (a := a+((1<<((~n & n-1).bit_length()<<1)+1)+1)//3)
    A000695_list = list(islice(A000695_gen(),30)) # Chai Wah Wu, Feb 22 2023
    
  • Python
    def A000695(n): return int(bin(n)[2:],4) # Chai Wah Wu, Aug 21 2023
    
  • Sage
    s=(sum(4^k*x^(2^k)/(1+x^(2^k)) for k in range(10))/(1-x)).series(x, 60); s.coefficients(x, sparse=False) # G. C. Greubel, Dec 06 2018
    

Formula

G.f.: 1/(1-x) * Sum_{k>=0} 4^k*x^2^k/(1+x^2^k). - Ralf Stephan, Apr 27 2003
Numbers k such that the coefficient of x^k is > 0 in Product_{n>=0} 1+x^(4^n). - Benoit Cloitre, Jul 29 2003
For n >= 1, a(n) = a(n-1) + (4^t+2)/6, where t is such that 2^t||2n,or t=A007814(2n). a(n) = (A145812(n+1) - 1)/2. - Vladimir Shevelev, Nov 07 2008
To get a(n), write n as Sum b_j*2^j, then a(n) = Sum b_j*2^(2j). The Diophantine equation a(k)+2a(l)=n has the unique solution: k=Sum b_(2j)*2^j, l=Sum b_(2j+1)*2^j. - Vladimir Shevelev, Nov 10 2008
If a(k)*a(l)=a(m), then k*l=m (the inverse, generally speaking, is not true). - Vladimir Shevelev, Nov 21 2008
Let F(x) be the generating function, then F(x)*F(x^2) = 1/(1-x). - Joerg Arndt, May 12 2010
a(n+1) = (a(n) + 1/3) & -1/3, where & is bitwise AND, -1/3 is represented as the infinite dyadic ...010101 (just as -1 is ...111111 in two's complement) and +1/3 is ...101011. - Marc LeBrun, Sep 30 2010
a(n) = Sum_{k>=0} {A030308(n,k)*b(k)} with b(k) = 4^k = A000302(k). - Philippe Deléham, Oct 18 2011
A182560(6*a(n)) = 0. - Reinhard Zumkeller, May 05 2012
G.f.: x/(1-x^2) + 4*x^2/((1-x)*(W(0) - 4*x - 4*x^2)), where W(k) = 1 + 4*x^(2^k) + 5*x^(2^(k+1)) - 4*x^(2^(k+1))*(1 + x^(2^(k+1)))^2/W(k+1); (continued fraction). - Sergei N. Gladkovskii, Jan 04 2014
liminf a(n)/n^2 = 1/3 and limsup a(n)/n^2 = 1. - Gheorghe Coserea, Sep 15 2015
Let f(x) = (Sum_{k=-oo..oo} floor(x*2^k)/4^k)/2. Then f(x) is a real-valued extension of a(n), which a(n) approximates in the sense that f(x) = lim_{k->oo} a(floor(x*2^k))/a(2^k). - Velin Yanev, Nov 28 2016
G.f. A(x) satisfies x/(1 - x^2) = A(x) - 4 * (1+x) * A(x^2). - Michael Somos, Nov 30 2016
a(2^k) = 4^k = A000302(k). a(n + 2^k) = a(n) + a(2^k) for 2^k > n >= 1. - David A. Corneth, Oct 16 2018
Sum_{n>=1} 1/a(n) = 1.886176434476107244547259512076353532930680508099044818673061351780360211128... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 12 2022

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

A033042 Sums of distinct powers of 5.

Original entry on oeis.org

0, 1, 5, 6, 25, 26, 30, 31, 125, 126, 130, 131, 150, 151, 155, 156, 625, 626, 630, 631, 650, 651, 655, 656, 750, 751, 755, 756, 775, 776, 780, 781, 3125, 3126, 3130, 3131, 3150, 3151, 3155, 3156, 3250, 3251, 3255, 3256, 3275, 3276, 3280, 3281, 3750, 3751
Offset: 0

Views

Author

Keywords

Comments

Numbers without any base-5 digits larger than 1.
a(n) modulo 2 is the Prouhet-Thue-Morse sequence A010060. - Philippe Deléham, Oct 17 2011
Values of k where A008977(k) does not end with 0. - Henry Bottomley, Nov 09 2022

Crossrefs

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 5 of array A104257.

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 2)
            r += b * q
            b *= 5
        end
    r end; [a(n) for n in 0:49] |> println # Peter Luschny, Jan 03 2021
    
  • Maple
    a:= proc(n) local m, r, b; m, r, b:= n, 0, 1;
          while m>0 do r:= r+b*irem(m, 2, 'm'); b:= b*5 od; r
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 16 2013
  • Mathematica
    t = Table[FromDigits[RealDigits[n, 2], 5], {n, 1, 100}]
    (* Clark Kimberling, Aug 02 2012 *)
    FromDigits[#,5]&/@Tuples[{0,1},7] (* Harvey P. Dale, May 22 2018 *)
  • PARI
    a(n) = subst(Pol(binary(n)), 'x, 5);
    vector(50, i, a(i-1))  \\ Gheorghe Coserea, Sep 15 2015
    
  • PARI
    a(n)=fromdigits(binary(n),5) \\ Charles R Greathouse IV, Jan 11 2017
    
  • Python
    def A033042(n): return int(bin(n)[2:],5) # Chai Wah Wu, Oct 30 2024

Formula

a(n) = Sum_{i=0..m} d(i)*5^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
Numbers j such that the coefficient of x^j is > 0 in Product_{k>=0} (1 + x^(5^k)). - Benoit Cloitre, Jul 29 2003
a(n) = A097251(n)/4.
a(2n) = 5*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*5^k. - Philippe Deléham, Oct 17 2011
liminf a(n)/n^(log(5)/log(2)) = 1/4 and limsup a(n)/n^(log(5)/log(2)) = 1. - Gheorghe Coserea, Sep 15 2015
G.f.: (1/(1 - x))*Sum_{k>=0} 5^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Extended by Ray Chandler, Aug 03 2004

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

A104258 Replace 2^i with n^i in binary representation of n.

Original entry on oeis.org

1, 2, 4, 16, 26, 42, 57, 512, 730, 1010, 1343, 1872, 2367, 2954, 3616, 65536, 83522, 104994, 130341, 160400, 194923, 234762, 280394, 345600, 406251, 474578, 551152, 637392, 732512, 837930, 954305, 33554432, 39135394, 45435458
Offset: 1

Views

Author

Ralf Stephan, Mar 05 2005

Keywords

Comments

The following sequences all appear to have the same parity: A003071, A029886, A061297, A092524, A093431, A102393, A104258, A122248, A128975. - Jeremy Gardiner, Dec 28 2008

Crossrefs

Cf. A104257.

Programs

  • PARI
    a(n) = my(b=binary(n)); sum(k=1, #b, b[k]*n^(#b-k)); \\ Michel Marcus, Mar 19 2015
    
  • Python
    def a(n): return sum(n**i*int(bi) for i, bi in enumerate(bin(n)[2:][::-1]))
    print([a(n) for n in range(1, 35)]) # Michael S. Branicky, Aug 02 2022

Formula

a(n) = A104257(n, n).
a(n) = [x^n] (1/(1 - x)) * Sum_{k>=0} n^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Aug 17 2019

A033043 Sums of distinct powers of 6.

Original entry on oeis.org

0, 1, 6, 7, 36, 37, 42, 43, 216, 217, 222, 223, 252, 253, 258, 259, 1296, 1297, 1302, 1303, 1332, 1333, 1338, 1339, 1512, 1513, 1518, 1519, 1548, 1549, 1554, 1555, 7776, 7777, 7782, 7783, 7812, 7813, 7818, 7819, 7992, 7993, 7998, 7999, 8028, 8029, 8034
Offset: 0

Views

Author

Keywords

Comments

Numbers without any base-6 digits greater than 1.

Crossrefs

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 2)
            r += b * q
            b *= 6
        end
    r end; [a(n) for n in 0:46] |> println # Peter Luschny, Jan 03 2021
    
  • Maple
    S:= {0,1}:
    for i from 1 to 6 do S:= S union (S +~ 6^i) od:
    sort(convert(S,list)); # Robert Israel, Apr 04 2025
  • Mathematica
    t = Table[FromDigits[RealDigits[n, 2], 6], {n, 0, 100}] (* Clark Kimberling, Aug 02 2012 *)
    FromDigits[#,6]&/@Tuples[{0,1},6] (* Harvey P. Dale, Mar 31 2016 *)
  • PARI
    A033043(n,b=6)=subst(Pol(binary(n)),'x,b) \\ M. F. Hasler, Feb 01 2016
    
  • PARI
    a(n)=fromdigits(binary(n), 6) \\ Charles R Greathouse IV, Jan 11 2017
    
  • Python
    def A033043(n): return int(bin(n)[2:],6) # Chai Wah Wu, Apr 04 2025

Formula

a(n) = Sum_{i=0..m} d(i)*6^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097252(n)/5.
a(2n) = 6*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*6^k. - Philippe Deléham, Oct 20 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 6^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Extended by Ray Chandler, Aug 03 2004

A033045 Sums of distinct powers of 8.

Original entry on oeis.org

0, 1, 8, 9, 64, 65, 72, 73, 512, 513, 520, 521, 576, 577, 584, 585, 4096, 4097, 4104, 4105, 4160, 4161, 4168, 4169, 4608, 4609, 4616, 4617, 4672, 4673, 4680, 4681, 32768, 32769, 32776, 32777, 32832, 32833, 32840, 32841, 33280, 33281, 33288
Offset: 0

Views

Author

Keywords

Comments

Numbers without any base-8 digits greater than 1.
Every nonnegative n is a unique sum of the form a(p)+2a(q)+4a(r). This gives a one-to-one map of the set N_0 of all nonnegative integers to (N_0)^3. Furthermore, if, for a fixed positive integer m, to consider all sums of distinct powers of 2^m, then one can obtain a one-to-one map of the set N_0 to (N_0)^m. - Vladimir Shevelev, Nov 15 2008

Examples

			a(7)=72 because 72_10 = 110_8.
		

Crossrefs

Row 8 of array A104257.

Programs

Formula

a(n) = Sum_{i=0..m} d(i)*8^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097254(n)/7.
a(2n) = 8*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*8^k. - Philippe Deléham, Oct 19 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 8^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

More terms from Patrick De Geest, Dec 23 2000

A033046 Sums of distinct powers of 9.

Original entry on oeis.org

0, 1, 9, 10, 81, 82, 90, 91, 729, 730, 738, 739, 810, 811, 819, 820, 6561, 6562, 6570, 6571, 6642, 6643, 6651, 6652, 7290, 7291, 7299, 7300, 7371, 7372, 7380, 7381, 59049, 59050, 59058, 59059, 59130, 59131, 59139, 59140, 59778, 59779, 59787
Offset: 0

Views

Author

Keywords

Comments

Numbers without any base-9 digits greater than 1.
a(n) modulo 2 is the Prouhet-Thue-Morse sequence A010060. - Philippe Deléham, Oct 17 2011

Crossrefs

Row 9 of array A104257.

Programs

Formula

a(n) = Sum_{i=0..m} d(i)*9^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097255(n)/8.
a(2n) = 9*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*9^k. - Philippe Deléham, Oct 17 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 9^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Extended by Ray Chandler, Aug 03 2004

A033044 Sums of distinct powers of 7.

Original entry on oeis.org

0, 1, 7, 8, 49, 50, 56, 57, 343, 344, 350, 351, 392, 393, 399, 400, 2401, 2402, 2408, 2409, 2450, 2451, 2457, 2458, 2744, 2745, 2751, 2752, 2793, 2794, 2800, 2801, 16807, 16808, 16814, 16815, 16856, 16857, 16863, 16864, 17150, 17151, 17157
Offset: 1

Views

Author

Keywords

Comments

Numbers without any base-7 digits greater than 1.
a(n) modulo 2 is the Prouhet-Thue-Morse sequence A010060. - Philippe Deléham, Oct 17 2011
Note that this sequence has offset 1, in contrast to A000695 and all others among A033043-A033052. - M. F. Hasler, Feb 01 2016

Crossrefs

Row 7 of array A104257.

Programs

Formula

a(n) = Sum_{i=0..m} d(i)*7^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097253(n)/6.
a(2n) = 7*a(n), a(2n+1) = a(2n)+1.
a(n+1) = Sum_{k>=0} A030308(n,k)*7^k. - Philippe Deléham, Oct 17 2011
G.f.: (x/(1 - x))*Sum_{k>=0} 7^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Extended by Ray Chandler, Aug 03 2004
Karol Bacik has pointed out that the first three formulas do not match the sequence. - N. J. A. Sloane, Oct 20 2012

A033048 Sums of distinct powers of 12.

Original entry on oeis.org

0, 1, 12, 13, 144, 145, 156, 157, 1728, 1729, 1740, 1741, 1872, 1873, 1884, 1885, 20736, 20737, 20748, 20749, 20880, 20881, 20892, 20893, 22464, 22465, 22476, 22477, 22608, 22609, 22620, 22621, 248832, 248833, 248844, 248845, 248976
Offset: 0

Views

Author

Keywords

Comments

Numbers without any base-12 digits greater than 1.

Crossrefs

Subsequence of A102487.
Row 11 of array A104257.

Programs

  • Haskell
    import Data.List (unfoldr)
    a033048 n = a033048_list !! (n-1)
    a033048_list = filter (all (< 2) . unfoldr (\x ->
       if x == 0 then Nothing else Just $ swap $ divMod x 12)) [1..]
    -- Reinhard Zumkeller, Apr 17 2011
  • Mathematica
    With[{k = 12}, Map[FromDigits[#, k] &, Tuples[{0, 1}, 6]]] (* Michael De Vlieger, Oct 28 2022 *)
  • PARI
    {maxn=37;
    for(vv=0,maxn,
    bvv=binary(vv);
    ll=length(bvv);texp=0;btod=0;
    forstep(i=ll,1,-1,btod=btod+bvv[i]*12^texp;texp++);
    print1(btod,", "))}
    \\ Douglas Latimer, Apr 16 2012
    
  • PARI
    a(n)=fromdigits(binary(n),12) \\ Charles R Greathouse IV, Jan 11 2017
    

Formula

a(n) = Sum_{i=0..m} d(i)*12^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097258(n)/11.
a(2n) = 12*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*b(k) with b(k) = 12^k = A001021(k). - Philippe Deléham, Oct 19 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 12^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Extended by Ray Chandler, Aug 03 2004
Showing 1-10 of 18 results. Next