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

A186943 Number of lunar divisors (in base 10) of the n-th number whose decimal expansion contains only 0's and 1's and begins and ends with a 1 (A099821(n)).

Original entry on oeis.org

9, 90, 90, 819, 90, 738, 738, 7461, 90, 738, 819, 6570, 738, 6732, 6570, 67968, 90, 738, 738, 6570, 738, 6570, 6732, 59868, 738, 6732, 6570, 59868, 6570, 59868, 59868, 619902, 90, 738, 738, 6570, 819, 6570, 6570, 59058, 738, 6570, 7461, 59058, 6570, 59868, 59058, 539550, 738, 6732, 6570, 59868, 6570, 59058, 59868, 538821, 6570, 59868, 59058, 538902, 59058, 538821, 539550, 5660208, 90, 738, 738, 6570, 738, 6570, 6570
Offset: 1

Views

Author

N. J. A. Sloane, Mar 01 2011

Keywords

Comments

Number of lunar divisors of A099821(n), that is, A087029(A099821(n))..

Examples

			1 has 9 divisors: 1,2,3,4,5,6,7,8,9, so a(1)=9. 11 has 90 divisors, 1 through 9 and the numbers 11 through 99 that do not end in 0, so a(2)=90.
		

Crossrefs

A007088 The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.

Original entry on oeis.org

0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 100111
Offset: 0

Views

Author

Keywords

Comments

List of binary numbers. (This comment is to assist people searching for that particular phrase. - N. J. A. Sloane, Apr 08 2016)
Or, numbers that are sums of distinct powers of 10.
Or, numbers having only digits 0 and 1 in their decimal representation.
Complement of A136399; A064770(a(n)) = a(n). - Reinhard Zumkeller, Dec 30 2007
From Rick L. Shepherd, Jun 25 2009: (Start)
Nonnegative integers with no decimal digit > 1.
Thus nonnegative integers n in base 10 such that kn can be calculated by normal addition (i.e., n + n + ... + n, with k n's (but not necessarily k + k + ... + k, with n k's)) or multiplication without requiring any carry operations for 0 <= k <= 9. (End)
For n > 1: A257773(a(n)) = 10, numbers that are Belgian-k for k=0..9. - Reinhard Zumkeller, May 08 2015
For any integer n>=0, find the binary representation and then interpret as decimal representation giving a(n). - Michael Somos, Nov 15 2015
N is in this sequence iff A007953(N) = A101337(N). A028897 is a left inverse. - M. F. Hasler, Nov 18 2019
For n > 0, numbers whose largest decimal digit is 1. - Stefano Spezia, Nov 15 2023

Examples

			a(6)=110 because (1/2)*((1-(-1)^6)*10^0 + (1-(-1)^3)*10^1 + (1-(-1)^1)*10^2) = 10 + 100.
G.f. = x + 10*x^2 + 11*x^3 + 100*x^4 + 101*x^5 + 110*x^6 + 111*x^7 + 1000*x^8 + ...
.
  000    The numbers < 2^n can be regarded as vectors with
  001    a fixed length n if padded with zeros on the left
  010    side. This represents the n-fold Cartesian product
  011    over the set {0, 1}. In the example on the left,
  100    n = 3. (See also the second Python program.)
  101    Binary vectors in this format can also be seen as a
  110    representation of the subsets of a set with n elements.
  111    - _Peter Luschny_, Jan 22 2024
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 21.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §2.8 Binary, Octal, Hexadecimal, p. 64.
  • Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W. H. Freeman, 1991, p. 383.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

The basic sequences concerning the binary expansion of n are this one, A000120 (Hammingweight: sum of bits), A000788 (partial sums of A000120), A000069 (A000120 is odd), A001969 (A000120 is even), A023416 (number of bits 0), A059015 (partial sums). Bisections A099820 and A099821.
Cf. A028897 (convert binary to decimal).

Programs

  • Haskell
    a007088 0 = 0
    a007088 n = 10 * a007088 n' + m where (n',m) = divMod n 2
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Maple
    A007088 := n-> convert(n, binary): seq(A007088(n), n=0..50); # R. J. Mathar, Aug 11 2009
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 39}]
    Table[Sum[ (Floor[( Mod[f/2 ^n, 2])])*(10^n) , {n, 0, Floor[Log[2, f]]}], {f, 1, 100}] (* José de Jesús Camacho Medina, Jul 24 2014 *)
    FromDigits/@Tuples[{1,0},6]//Sort (* Harvey P. Dale, Aug 10 2017 *)
  • PARI
    {a(n) = subst( Pol( binary(n)), x, 10)}; /* Michael Somos, Jun 07 2002 */
    
  • PARI
    {a(n) = if( n<=0, 0, n%2 + 10*a(n\2))}; /* Michael Somos, Jun 07 2002 */
    
  • PARI
    a(n)=fromdigits(binary(n),10) \\ Charles R Greathouse IV, Apr 08 2015
    
  • Python
    def a(n): return int(bin(n)[2:])
    print([a(n) for n in range(40)]) # Michael S. Branicky, Jan 10 2021
    
  • Python
    from itertools import product
    n = 4
    for p in product([0, 1], repeat=n): print(''.join(str(x) for x in p))
    # Peter Luschny, Jan 22 2024

Formula

a(n) = Sum_{i=0..m} d(i)*10^i, where Sum_{i=0..m} d(i)*2^i is the base 2 representation of n.
a(n) = (1/2)*Sum_{i>=0} (1-(-1)^floor(n/2^i))*10^i. - Benoit Cloitre, Nov 20 2001
a(n) = A097256(n)/9.
a(2n) = 10*a(n), a(2n+1) = a(2n)+1.
G.f.: 1/(1-x) * Sum_{k>=0} 10^k * x^(2^k)/(1+x^(2^k)) - for sequence as decimal integers. - Franklin T. Adams-Watters, Jun 16 2006
a(A000290(n)) = A001737(n). - Reinhard Zumkeller, Apr 25 2009
a(n) = Sum_{k>=0} A030308(n,k)*10^k. - Philippe Deléham, Oct 19 2011
For n > 0: A054055(a(n)) = 1. - Reinhard Zumkeller, Apr 25 2012
a(n) = Sum_{k=0..floor(log_2(n))} floor((Mod(n/2^k, 2)))*(10^k). - José de Jesús Camacho Medina, Jul 24 2014

A030317 Write the odd numbers 2n - 1 in base 2 and juxtapose these binary expansions; read the result bit-by-bit.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Examples

			1 in binary is 1.
3 in binary is 11.
5 in binary is 101.
7 in binary is 111.
9 in binary is 1001.
Putting those together, we obtain 1111011111001. Then, splitting bit by bit, we get 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, the beginning of this sequence.
		

Crossrefs

Cf. A099821 (odd positive integers in base 2).

Programs

  • Maple
    twon := 1 :
    dig := 1:
    A030317 := proc()
        global twon,dig ;
        local a,dgs;
        dgs := convert(twon,base,2) ;
        a := op(-dig,%) ;
        if dig = nops(dgs) then
            twon := twon+2 ;
            dig :=1 ;
        else
            dig := dig+1 ;
        end if;
        return a;
    end proc:
    seq(A030317(),n=1..100) ; # R. J. Mathar, Jul 22 2025
  • Mathematica
    Flatten[Table[IntegerDigits[2n - 1, 2], {n, 50}]] (* Harvey P. Dale, Aug 06 2013 *)
  • Scala
    (1 to 31 by 2).map(Integer.toString(, 2)).mkString.split("").map(Integer.parseInt()).toList // Alonso del Arte, Feb 10 2020

A099820 Even nonnegative integers in base 2 (bisection of A007088).

Original entry on oeis.org

0, 10, 100, 110, 1000, 1010, 1100, 1110, 10000, 10010, 10100, 10110, 11000, 11010, 11100, 11110, 100000, 100010, 100100, 100110, 101000, 101010, 101100, 101110, 110000, 110010, 110100, 110110, 111000, 111010, 111100, 111110, 1000000
Offset: 0

Views

Author

N. J. A. Sloane, Nov 19 2004

Keywords

Crossrefs

Programs

  • Maple
    seq(convert(2*n,binary),n=0..37); # Emeric Deutsch, Dec 15 2004

Extensions

More terms from Emeric Deutsch, Dec 15 2004

A333415 Odd positive integers in base 2 read backwards.

Original entry on oeis.org

1, 11, 101, 111, 1001, 1101, 1011, 1111, 10001, 11001, 10101, 11101, 10011, 11011, 10111, 11111, 100001, 110001, 101001, 111001, 100101, 110101, 101101, 111101, 100011, 110011, 101011, 111011, 100111, 110111, 101111, 111111, 1000001, 1100001, 1010001, 1110001, 1001001
Offset: 1

Views

Author

Devansh Singh, Mar 20 2020

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,i;
     L:= convert(n,base,2);
     add(L[-i]*10^(i-1),i=1..nops(L));
    end proc
    map(f, [seq(i,i=1..100,2)]); # Robert Israel, May 19 2024
  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[n, 2]]], {n, 1, 75, 2}] (* Amiram Eldar, Apr 27 2020 *)
  • PARI
    a(n) = fromdigits(Vecrev(binary(2*n-1))); \\ Michel Marcus, May 19 2024

Formula

From Michel Marcus, Apr 23 2020: (Start)
a(n) = A007088(A145341(n)).
a(n) = A004086(A099821(n)). (End)

Extensions

New name, a(1)=1 and more terms from Michel Marcus, Apr 23 2020

A347911 A 4 X 4 pandiagonal magic square read by rows: the entries have digits which are only 0's and 1's and form a magic square in any base b >= 2.

Original entry on oeis.org

11111, 10001, 1011, 101, 1001, 111, 11101, 10011, 10101, 11011, 1, 1111, 11, 1101, 10111, 11001
Offset: 1

Views

Author

Chittaranjan Pardeshi, Oct 07 2021

Keywords

Comments

The magic square is:
[ 11111 10001 1011 101 ]
[ 1001 111 11101 10011 ]
[ 10101 11011 1 1111 ]
[ 11 1101 10111 11001 ]
The magic sum of any row, column or diagonal is:
1000000 (base 2),
100001 (base 3),
22230 (base 4),
22224 (base 5 and above).

Crossrefs

Showing 1-6 of 6 results.