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 46 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

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.

A054238 Array read by downward antidiagonals: T(i,j) = bits of binary expansion of i interleaved with that of j.

Original entry on oeis.org

0, 1, 2, 4, 3, 8, 5, 6, 9, 10, 16, 7, 12, 11, 32, 17, 18, 13, 14, 33, 34, 20, 19, 24, 15, 36, 35, 40, 21, 22, 25, 26, 37, 38, 41, 42, 64, 23, 28, 27, 48, 39, 44, 43, 128, 65, 66, 29, 30, 49, 50, 45, 46, 129, 130, 68, 67, 72, 31, 52, 51, 56, 47, 132, 131, 136, 69, 70, 73, 74
Offset: 0

Views

Author

Marc LeBrun, Feb 07 2000

Keywords

Comments

Inverse of sequence A054239 considered as a permutation of the nonnegative integers.
Permutation of nonnegative integers. Can be used as natural alternate number casting for pairs/tables (vs. usual diagonalization).
This array is a Z-order curve in an N x N grid. - Max Barrentine, Sep 24 2015
Each row n of this array is the lexicographically earliest sequence such that no term occurs in a previous row, no three terms form an arithmetic progression, and the k-th term in the n-th row is equal to the k-th term in row 0 plus some constant (specifically, T(n,k) = T(0,k) + A062880(n)). - Max Barrentine, Jul 20 2016

Examples

			From _Philippe Deléham_, Oct 18 2011: (Start)
The array starts in row n=0 with columns k >= 0 as follows:
   0  1  4  5 16 17 20 21 ...
   2  3  6  7 18 19 22 23 ...
   8  9 12 13 24 25 28 29 ...
  10 11 14 15 26 27 30 31 ...
  32 33 36 37 48 49 52 53 ...
  34 35 38 39 50 51 54 55 ...
  40 41 44 45 56 57 60 61 ...
  42 43 46 47 58 59 62 63 ...
(End)
T(6,5)=57 because 1.1.0. (6) merged with .1.0.1 (5) is 111001 (57). [Corrected by _Georg Fischer_, Jan 21 2022]
		

Crossrefs

Cf. A000695 (row n=0), A062880 (column k=0), A001196 (main diagonal).
Cf. A059905, A059906, A346453 (by upwards antidiagonals).
See also A163357 and A163334 for other fractal curves in N x N grids.

Programs

  • Maple
    N:= 4: # to get the first 2^(2N+1)+2^N terms
    G:= 1/(1-y)/(1-x)*(add(2^(2*i+1)*x^(2^i)/(1+x^(2^i)),i=0..N) + add(2^(2*i)*y^(2^i)/(1+y^(2^i)),i=0..N)):
    S:= mtaylor(G,[x=0,y=0],2^(N+1)):
    seq(seq(coeff(coeff(S,x,i),y,m-i),i=0..m),m=0..2^(N+1)-1); # Robert Israel, Jul 21 2016
  • Mathematica
    Table[Total@ Map[FromDigits[#, 2] &, Insert[#, 0, {-1, -1}] &@ Map[Riffle[IntegerDigits[#, 2], 0, 2] &, {n - k, k}]], {n, 0, 11}, {k, 0, n}] // Flatten (* Michael De Vlieger, Jul 21 2016 *)

Formula

T(n,k) = A000695(k) + 2*A000695(n). - Philippe Deléham, Oct 18 2011
From Robert Israel, Jul 21 2016: (Start)
G.f. of array: g(x,y) = (1/(1-x)*(1-y)) * Sum_{i>=0}
(2^(2*i+1)*x^(2^i)/(1+x^(2^i)) + 2^(2*i)*y^(2^i)/(1+y^(2^i))).
T(2*n+i,2*k+j) = 4*T(n,k) + 2*i+j for i,j in {0,1}. (End)

A097262 Numbers whose set of base 16 digits is {0,F}, where F base 16 = 15 base 10.

Original entry on oeis.org

0, 15, 240, 255, 3840, 3855, 4080, 4095, 61440, 61455, 61680, 61695, 65280, 65295, 65520, 65535, 983040, 983055, 983280, 983295, 986880, 986895, 987120, 987135, 1044480, 1044495, 1044720, 1044735, 1048320, 1048335, 1048560, 1048575
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 16 for every i.

Crossrefs

Programs

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

Formula

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

A004780 Binary expansion contains 2 adjacent 1's.

Original entry on oeis.org

3, 6, 7, 11, 12, 13, 14, 15, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 35, 38, 39, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 70, 71, 75, 76, 77, 78, 79, 83, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
Offset: 1

Views

Author

Keywords

Comments

Complement of A003714. It appears that n is in the sequence if and only if C(3n,n) is even. - Benoit Cloitre, Mar 09 2003
Since the binary representation of these numbers contains two adjacent 1's, so for these values of n, we will have (n XOR 2n XOR 3n) != 0, and thus a two player Nim game with three heaps of (n, 2n, 3n) stones will be a winning configuration for the first player. - V. Raman, Sep 17 2012
A048728(a(n)) > 0. - Reinhard Zumkeller, May 13 2014
The set of numbers x such that Or(x,3*x) <> 3*x. - Gary Detlefs, Jun 04 2024

Crossrefs

Complement: A003714.
Subsequences (apart from any initial zero-term): A001196, A004755, A004767, A033428, A277335.

Programs

  • Haskell
    a004780 n = a004780_list !! (n-1)
    a004780_list = filter ((> 1) . a048728) [1..]
    -- Reinhard Zumkeller, May 13 2014
    
  • Maple
    q:= n-> verify([1$2], Bits[Split](n), 'sublist'):
    select(q, [$0..200])[];  # Alois P. Heinz, Oct 22 2021
  • PARI
    is(n)=bitand(n,n+n)>0 \\ Charles R Greathouse IV, Sep 19 2012
    
  • Python
    from itertools import count, islice
    def A004780_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:n&(n<<1), count(max(startvalue,1)))
    A004780_list = list(islice(A004780_gen(),30)) # Chai Wah Wu, Jul 13 2022

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 19 2012

Extensions

Offset corrected by Reinhard Zumkeller, Jul 28 2010

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.

A277335 Fibbinary numbers multiplied by three: a(n) = 3*A003714(n); Numbers where all 1-bits occur in runs of even length.

Original entry on oeis.org

0, 3, 6, 12, 15, 24, 27, 30, 48, 51, 54, 60, 63, 96, 99, 102, 108, 111, 120, 123, 126, 192, 195, 198, 204, 207, 216, 219, 222, 240, 243, 246, 252, 255, 384, 387, 390, 396, 399, 408, 411, 414, 432, 435, 438, 444, 447, 480, 483, 486, 492, 495, 504, 507, 510, 768, 771, 774, 780, 783, 792, 795, 798, 816, 819, 822, 828, 831, 864, 867, 870, 876, 879, 888
Offset: 0

Views

Author

Antti Karttunen, Oct 18 2016

Keywords

Comments

The positive entries are the viabin numbers of integer partitions into even parts. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [6,4,4,2]. The southeast border of its Ferrers board yields 110110011, leading to the viabin number 435 (a term of the sequence). - Emeric Deutsch, Sep 11 2017

Crossrefs

Cf. A003714.
Positions of odd terms in A106737.
Cf. also A001196 (a subsequence).

Programs

  • Mathematica
    3 Select[Range[300], BitAnd[#, 2 #]==0 &] (* Vincenzo Librandi, Sep 12 2017 *)
  • Python
    def A277335(n):
        tlist, s = [1,2], 0
        while tlist[-1]+tlist[-2] <= n: tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            s <<= 1
            if d <= n:
                s += 1
                n -= d
        return 3*s # Chai Wah Wu, Apr 24 2025
  • Scheme
    (define (A277335 n) (* 3 (A003714 n)))
    

Formula

a(n) = 3*A003714(n).

A338754 Duplicate each decimal digit of n, so 0 -> 00, ..., 9 -> 99.

Original entry on oeis.org

0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 1100, 1111, 1122, 1133, 1144, 1155, 1166, 1177, 1188, 1199, 2200, 2211, 2222, 2233, 2244, 2255, 2266, 2277, 2288, 2299, 3300, 3311, 3322, 3333, 3344, 3355, 3366, 3377, 3388, 3399, 4400, 4411, 4422, 4433, 4444, 4455, 4466
Offset: 0

Views

Author

Kevin Ryde, Nov 06 2020

Keywords

Comments

This is equivalent to changing decimal digits 0,1,..,9 to base 100 digits 0,11,..,99, so the sequence is numbers which can be written in base 100 using only digits 0,11,..,99. Also, numbers whose decimal digit runs are all even lengths (including 0 as no digits at all).
This sequence first differs from A044836 (apart from term 0) at a(100) = 110000 whereas A044836(100) = 10011, because A044836 allows odd length digit runs provided there are more even than odd.

Examples

			For n=5517, digits duplicate to a(n) = 55551177.
		

Crossrefs

Cf. A051022 (0 above each digit), A044836.
Other bases: A001196, A338086.

Programs

  • PARI
    a(n) = fromdigits(digits(n),100)*11;
    
  • Python
    def A338754(n): return int(''.join(d*2 for d in str(n))) # Chai Wah Wu, May 07 2022

Formula

a(n) = Sum_{i=0..k} 11*d[i]*100^i where the decimal expansion of n is n = Sum_{i=0..k} d[i]*10^i with digits 0 <= d[i] <= 9.
a(n) = A051022(n)*11 for n > 0. - Kritsada Moomuang, Oct 20 2019

A088698 Replace 1 with 11 in binary representation of n.

Original entry on oeis.org

0, 3, 6, 15, 12, 27, 30, 63, 24, 51, 54, 111, 60, 123, 126, 255, 48, 99, 102, 207, 108, 219, 222, 447, 120, 243, 246, 495, 252, 507, 510, 1023, 96, 195, 198, 399, 204, 411, 414, 831, 216, 435, 438, 879, 444, 891, 894, 1791, 240, 483, 486, 975, 492, 987, 990
Offset: 0

Views

Author

Ralf Stephan, Oct 07 2003

Keywords

Examples

			n=9: 1001 -> 110011 = 51, so a(9) = 51.
		

Crossrefs

Ordered terms plus one are in A048297.
Same sequence sorted into ascending order: A277335, A290258 (without 0).
Main diagonal of A341520, right edge of A341521.

Programs

  • PARI
    a(n)=if(n<1,0,if(n%2==0,2*a(n/2),4*a((n-1)/2)+3))
    
  • Python
    def a(n): return int(bin(n)[2:].replace('1', '11'), 2)
    print([a(n) for n in range(55)]) # Michael S. Branicky, Feb 20 2021

Formula

a(0)=0, a(2n) = 2a(n), a(2n+1) = 4a(n) + 3.
Showing 1-10 of 46 results. Next