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

A257345 Regard the terms of A004290 as binary numbers and convert to base 10.

Original entry on oeis.org

0, 1, 2, 7, 4, 2, 14, 9, 8, 511, 2, 3, 28, 9, 18, 14, 16, 29, 1022, 25, 4, 21, 6, 53, 56, 4, 18, 895, 36, 109, 14, 59, 32, 63, 58, 18, 2044, 7, 50, 21, 8, 31, 42, 109, 12, 1022, 106, 19, 112, 97, 4, 35, 36, 35, 1790, 6, 72, 25, 218, 223, 28, 37, 118, 991, 64
Offset: 0

Views

Author

N. J. A. Sloane, Apr 29 2015

Keywords

Comments

Of course the terms of A004290 are already in base 10 (they just happen to involve only the digits 0 and 1), so there is no justification for this sequence other than curiosity.
a(n) < 2^n. - Chai Wah Wu, Apr 29 2015

Crossrefs

Programs

  • Mathematica
    s = With[{c = Rest[Union[FromDigits /@ Flatten[Table[Tuples[{1, 0}, i], {i, 10}], 1]]]}, Join[{0}, Flatten[Table[Select[c, Divisible[#, n] &, 1], {n, 120}]]]]; FromDigits[IntegerDigits@ #, 2] & /@ s (* Michael De Vlieger, Apr 29 2015, after Harvey P. Dale at A004290 *)
  • Python
    def A257345(n):
        if n > 0:
            for i in range(1, 2**n):
                x = int(format(i, 'b'))
                if not x % n:
                    return int(str(x), 2)
        return 0 # Chai Wah Wu, Apr 29 2015

Extensions

More terms from Chai Wah Wu, Apr 29 2015

A268609 Record values in A004290.

Original entry on oeis.org

1, 10, 111, 1110, 111111111, 1111111110, 11111111100, 111111111000, 111111111111111111, 1111111111111111110, 11111111111111111100, 111111111111111111000, 111111111111111111111111111, 1111111111111111111111111110, 11111111111111111111111111100, 111111111111111111111111111000
Offset: 1

Views

Author

David Radcliffe, Feb 08 2016

Keywords

Comments

a(18) is the first term that is neither a repunit nor the product of a repunit and a power of 10.

Examples

			1110 is a term because A004290(6) = 1110 and A004290(n) < 1110 for all n < 6, where A004290(n) is the least positive multiple of n that when written in base 10 uses only 0's and 1's.
		

Crossrefs

Cf. A004290, A268610. Subsequence of A007088.

Programs

  • Maple
    A004290:= proc(n)
    local L,x,m,r,k,j;
    for x from 2 to n-1 do L[0,x]:= 0 od:
    L[0,0]:= 1: L[0,1]:= 1;
    for m from 1 do
       if L[m-1,(-10^m) mod n] = 1 then break fi;
       L[m,0]:= 1;
       for k from 1 to n-1 do
         L[m,k]:= max(L[m-1,k],L[m-1,k-10^m mod n])
       od;
    od;
    r:= 10^m; k:= -10^m mod n;
    for j from m-1 by -1 to 1 do
        if L[j-1,k] = 0 then
          r:= r + 10^j; k:= k - 10^j mod n;
        fi
    od;
    if k = 1 then r:= r + 1 fi;
    r
    end proc:
    A004290(1):= 1:
    count:= 0: m:= 0;
    for n from 1 to 20000 do
      v:= A004290(n);
      if v > m then
        count:= count+1;
        A[count]:= v;
        m:= v;
      fi
    od:
    seq(A[i],i=1..count); # Robert Israel, Feb 09 2016

Extensions

a(1)=0 prepended to terms, b-file and Maple by Georg Fischer, Jun 24 2020
Initial 0 removed for consistency with change in A004290 by Sean A. Irvine, Feb 19 2024

A257344 Erroneous version of A004290.

Original entry on oeis.org

1, 10, 111, 100, 10, 1110, 10101, 1000, 111111111, 10, 11, 11100, 1001, 10010, 1110, 10000, 11101, 1111111110, 100111, 100, 10101, 110, 1011011, 111000
Offset: 1

Views

Author

N. J. A. Sloane, Apr 29 2015

Keywords

Comments

Included in accordance with OEIS policy of including published but erroneous sequences so as to give links to the correct versions.

References

  • Popular Computing (Calabasas, CA), Z-Sequences, Vol. 4 (No. 34, Apr 1976), pages PC36-4 to PC37-6, but there are many errors (cf. A079339, A004290).

Crossrefs

A268610 Indices of records in A004290.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 36, 72, 99, 198, 396, 792, 999, 1998, 3996, 7992, 9999, 10989, 19998, 21978, 39996, 43956, 76923, 99999, 199998, 399996, 729927, 999999
Offset: 1

Views

Author

David Radcliffe, Feb 08 2016

Keywords

Comments

a(n+1) <= 2*a(n) for all n >= 2.

Examples

			6 is a term because A004290(n) < A004290(6) for all n < 6, where A004290(n) is the least positive multiple of n that when written in base 10 uses only 0's and 1's.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(k, r=0); for(n=1, nn, k=1; while(fromdigits(binary(k))%n>0, k++); if(k>r, r=k; print1(n, ", "))); } \\ Jinyuan Wang, May 16 2020; a(1)=0 inserted by Georg Fischer, Jun 24 2020; a(1)=0 removed again by David A. Corneth, Feb 19 2024

Extensions

a(1)=0 inserted by Georg Fischer, Jun 24 2020
Initial 0 removed for consistency with change in A004290 by Sean A. Irvine, Feb 19 2024
a(26)-a(28) from David Radcliffe, Aug 02 2025

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

A079339 Least k such that the decimal representation of k*n contains only 1's and 0's.

Original entry on oeis.org

1, 5, 37, 25, 2, 185, 143, 125, 12345679, 1, 1, 925, 77, 715, 74, 625, 653, 61728395, 579, 5, 481, 5, 4787, 4625, 4, 385, 40781893, 3575, 37969, 37, 3581, 3125, 3367, 3265, 286, 308641975, 3, 2895, 259, 25, 271, 2405, 25607, 25, 24691358, 23935, 213, 23125
Offset: 1

Views

Author

Benoit Cloitre, Feb 13 2003

Keywords

Comments

From David Amar (dpamar(AT)gmail.com), Jul 12 2010: (Start)
This sequence is well defined.
In the n+1 first repunits (see A002275), there are at least 2 numbers that have the same value modulo n (pigeonhole principle).
The difference between those two numbers contains only 1's and 0's in decimal representation. (End)
This actually proves the stronger statement that there is always a multiple of the form 111...000 (Thm. 1 in Wu, 2014), cf. A244859 for these multiples and A244927 for the k-values. - M. F. Hasler, Mar 04 2025

Examples

			3*37 = 111 and no integer k < 37 has this property, hence a(3)=37.
		

References

  • Popular Computing (Calabasas, CA), Z-Sequences, Vol. 4 (No. 34, A pr 1976), pages PC36-4 to PC37-6, but there are many errors (cf. A257343, A257344).

Crossrefs

Programs

  • PARI
    d(n,i)=floor(n/10^(i-1))-10*floor(n/10^i);
    test(n)=sum(i=1,ceil(log(n)/log(10)),if(d(n,i)*(1-d(n,i)),1,0));
    a(n)=if(n<0,0,s=1; while(test(n*s)>0,s++); s)

Formula

a(n) = A004290(n)/n.
a(n) < 10^(n+1) / (9n). - Charles R Greathouse IV, Jan 09 2012
a(n) <= A244927(n), with equality for n <= 6. - M. F. Hasler, Mar 04 2025

Extensions

More terms from Vladeta Jovovic and Matthew Vandermast, Feb 14 2003
Definition simplified by Franklin T. Adams-Watters, Jan 09 2012

A078241 Smallest multiple of n using only digits 0 and 2.

Original entry on oeis.org

2, 2, 222, 20, 20, 222, 2002, 200, 222222222, 20, 22, 2220, 2002, 2002, 2220, 2000, 22202, 222222222, 22002, 20, 20202, 22, 220202, 22200, 200, 2002, 2202222222, 20020, 2202202, 2220, 222022, 20000, 222222, 22202, 20020, 2222222220, 222
Offset: 1

Views

Author

Amarnath Murthy, Nov 23 2002

Keywords

Comments

a(n) = min{A169965(k): k > 1 and A169965(k) mod n = 0}. - Reinhard Zumkeller, Jan 10 2012

Crossrefs

Programs

  • Haskell
    a078241 n = head [x | x <- tail a169965_list, mod x n == 0]
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Mathematica
    Module[{m=Rest[FromDigits/@Tuples[{0,2},12]]},Table[Select[m,Divisible[ #,n]&,1],{n,40}]]//Flatten (* Harvey P. Dale, Jul 31 2017 *)
  • Python
    def A078241(n):
        if n > 0:
            for i in range(1,2**n):
                x = 2*int(bin(i)[2:])
                if not x % n:
                    return x
        return 0 # Chai Wah Wu, Dec 30 2014

Formula

a(n) < 10^n / (0.45 n). - Charles R Greathouse IV, Jan 09 2012
a(n) <= A216812(n) <= 2(10^n - 1)/9. - N. J. A. Sloane, Sep 18 2012

Extensions

More terms from Ray Chandler, Jul 12 2004

A078248 Smallest multiple of n using only digits 0 and 9.

Original entry on oeis.org

9, 90, 9, 900, 90, 90, 9009, 9000, 9, 90, 99, 900, 9009, 90090, 90, 90000, 99909, 90, 99009, 900, 9009, 990, 990909, 9000, 900, 90090, 999, 900900, 9909909, 90, 999099, 900000, 99, 999090, 90090, 900, 999, 990090, 9009, 9000, 99999, 90090, 9909909
Offset: 1

Views

Author

Amarnath Murthy, Nov 23 2002

Keywords

Comments

a(n) = min{A097256(k): k > 0 and A097256(k) mod n = 0}. [Reinhard Zumkeller, Jan 10 2012]

Crossrefs

Programs

  • Haskell
    a078248 n = head [x | x <- tail a097256_list, mod x n == 0]
    -- Reinhard Zumkeller, Jan 10 2012
  • Mathematica
    With[{t=Flatten[Table[FromDigits[Join[{9},#]]&/@Tuples[{0,9},n],{n,0,6}]]},Flatten[Table[Select[t,Divisible[#,i]&,1],{i,50}]]] (* Harvey P. Dale, May 31 2014 *)

Extensions

More terms from Ray Chandler, Jul 12 2004

A096688 Least k such that decimal representation of k*n contains only digits 0 and 9.

Original entry on oeis.org

9, 45, 3, 225, 18, 15, 1287, 1125, 1, 9, 9, 75, 693, 6435, 6, 5625, 5877, 5, 5211, 45, 429, 45, 43083, 375, 36, 3465, 37, 32175, 341721, 3, 32229, 28125, 3, 29385, 2574, 25, 27, 26055, 231, 225, 2439, 2145, 230463, 225, 2, 215415, 1917, 1875, 202041, 18, 1959
Offset: 1

Views

Author

Ray Chandler, Jul 12 2004

Keywords

Crossrefs

Formula

a(n) = A078248(n)/n.

A096681 Least k such that decimal representation of k*n contains only digits 0 and 2.

Original entry on oeis.org

2, 1, 74, 5, 4, 37, 286, 25, 24691358, 2, 2, 185, 154, 143, 148, 125, 1306, 12345679, 1158, 1, 962, 1, 9574, 925, 8, 77, 81563786, 715, 75938, 74, 7162, 625, 6734, 653, 572, 61728395, 6, 579, 518, 5, 542, 481, 51214, 5, 49382716, 4787, 426, 4625, 44898, 4
Offset: 1

Views

Author

Ray Chandler, Jul 12 2004

Keywords

Crossrefs

Programs

  • PARI
    isok(n) = my(vd = vecsort(digits(n),,8)); (vd == [0,2]) || (vd == [2]);
    a(n) = my(k=1); while(!isok(k*n), k++); k; \\ Michel Marcus, Sep 25 2016
    
  • Python
    def next02(n):
      s = str(n)
      if s > '2'*len(s): return int('2' + '0'*len(s))
      for i, c in enumerate(s):
        if c == '1': return int(s[:i] + '2' + '0'*(len(s)-i-1))
        elif s[i:] > '2'*(len(s)-i): return int(s[:i-1] + '2' + '0'*(len(s)-i))
    def a(n):
      k = 1
      while set(str(k*n)) - set('02') != set(): k = max(k+1, next02(k*n)//n)
      return k
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Feb 01 2021

Formula

a(n) = A078241(n)/n.
Showing 1-10 of 44 results. Next