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

A004290 Least positive multiple of n that when written in base 10 uses only 0's and 1's.

Original entry on oeis.org

1, 10, 111, 100, 10, 1110, 1001, 1000, 111111111, 10, 11, 11100, 1001, 10010, 1110, 10000, 11101, 1111111110, 11001, 100, 10101, 110, 110101, 111000, 100, 10010, 1101111111, 100100, 1101101, 1110, 111011, 100000, 111111, 111010
Offset: 1

Views

Author

Keywords

Comments

It is easy to show that a(n) always exists and in fact has at most n digits [Wu, 2014]. - N. J. A. Sloane, Jun 13 2014
a(n) = min{A007088(k): k > 0 and A007088(k) mod n = 0}. - Reinhard Zumkeller, Jan 10 2012
a(10^k) = 10^k and a(10^k - 1) = (10^(9k) - 1) / 9 for all k. Is a(n) < a(10^k - 1) for all n < 10^k - 1? - David Radcliffe, Aug 01 2025

Crossrefs

Programs

  • Haskell
    a004290 0 = 0
    a004290 n = head [x | x <- tail a007088_list, mod x n == 0]
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Maple
    f:= proc(n)
    local L,x,m,r,k,j;
    if n<2 then return n fi;
    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:
    seq(f(n),n=1..100); # Robert Israel, Feb 09 2016
  • Mathematica
    a[n_] := For[k = 1, True, k++, b = FromDigits[ IntegerDigits[k, 2] ]; If[Mod[b, n] == 0, Return[b]]]; a[0] = 0; Table[a[n], {n, 0, 34}] (* Jean-François Alcover, Jun 14 2013, after Reinhard Zumkeller *)
    With[{c=Rest[Union[FromDigits/@Flatten[Table[Tuples[{1,0},i],{i,10}], 1]]]}, Join[{0},Flatten[ Table[ Select[c,Divisible[#,n]&,1],{n,40}]]]] (* Harvey P. Dale, Dec 07 2013 *)
  • PARI
    a(n) = {if( n==0, return (0)); my(m = n); while (vecmax(digits(m)) != 1, m+=n); m;} \\ Michel Marcus, Feb 09 2016, May 27 2020
    
  • PARI
    apply( {A004290(n)=for(k=1,2^n,(t=fromdigits(binary(k)))%n||return(t))}, [1..44]) \\ M. F. Hasler, Mar 04 2025
  • Python
    def A004290(n):
        if n > 0:
            for i in range(1,2**n):
                x = int(bin(i)[2:])
                if not x % n:
                    return x
        return 0
    # Chai Wah Wu, Dec 30 2014
    

Formula

a(n) = n*A079339(n). - Jonathan Sondow, Jun 15 2014

Extensions

Initial 0 deleted and offset corrected by N. J. A. Sloane, Jan 31 2024

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

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.

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.

A078242 Smallest multiple of n using only digits 0 and 3.

Original entry on oeis.org

3, 30, 3, 300, 30, 30, 3003, 3000, 333, 30, 33, 300, 3003, 30030, 30, 30000, 33303, 3330, 33003, 300, 3003, 330, 330303, 3000, 300, 30030, 333333333, 300300, 3303303, 30, 333033, 300000, 33, 333030, 30030, 33300, 333, 330030, 3003, 3000, 33333
Offset: 1

Views

Author

Amarnath Murthy, Nov 23 2002

Keywords

Comments

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

Crossrefs

Programs

  • Haskell
    a078242 n = head [x | x <- tail a169966_list, mod x n == 0]
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Mathematica
    With[{lst=Rest[FromDigits/@Tuples[{0,3},10]]},Table[SelectFirst[lst,Mod[#,n]==0&],{n,50}]] (* Harvey P. Dale, May 31 2025 *)
  • Python
    def A078242(n):
        if n > 0:
            for i in range(1,2**n):
                x = 3*int(bin(i)[2:])
                if not x % n:
                    return x
        return 0 # Chai Wah Wu, Dec 31 2014

Extensions

More terms from Ray Chandler, Jul 12 2004

A078243 Smallest multiple of n using only digits 0 and 4.

Original entry on oeis.org

4, 4, 444, 4, 40, 444, 4004, 40, 444444444, 40, 44, 444, 4004, 4004, 4440, 400, 44404, 444444444, 44004, 40, 40404, 44, 440404, 4440, 400, 4004, 4404444444, 4004, 4404404, 4440, 444044, 4000, 444444, 44404, 40040, 444444444, 444, 44004, 40404
Offset: 1

Views

Author

Amarnath Murthy, Nov 23 2002

Keywords

Comments

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

Crossrefs

Programs

  • Haskell
    a078243 n = head [x | x <- tail a169967_list, mod x n == 0]
    -- Reinhard Zumkeller, Jan 10 2012

Extensions

More terms from Ray Chandler, Jul 12 2004

A078244 Smallest multiple of n using only digits 0 and 5.

Original entry on oeis.org

5, 50, 555, 500, 5, 5550, 5005, 5000, 555555555, 50, 55, 55500, 5005, 50050, 555, 50000, 55505, 5555555550, 55005, 500, 50505, 550, 550505, 555000, 50, 50050, 5505555555, 500500, 5505505, 5550, 555055, 500000, 555555, 555050, 5005
Offset: 1

Views

Author

Amarnath Murthy, Nov 23 2002

Keywords

Comments

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

Crossrefs

Programs

  • Haskell
    a078244 n = head [x | x <- tail a169964_list, mod x n == 0]
    -- Reinhard Zumkeller, Jan 10 2012
  • Mathematica
    Module[{mlts=Rest[FromDigits/@Tuples[{0,5},12]]},Table[ SelectFirst[ mlts,Divisible[ #,n]&],{n,40}]] (* Harvey P. Dale, Aug 14 2021 *)

Extensions

More terms from Ray Chandler, Jul 12 2004

A078245 Smallest multiple of n using only digits 0 and 6.

Original entry on oeis.org

6, 6, 6, 60, 60, 6, 6006, 600, 666, 60, 66, 60, 6006, 6006, 60, 6000, 66606, 666, 66006, 60, 6006, 66, 660606, 600, 600, 6006, 666666666, 60060, 6606606, 60, 666066, 60000, 66, 66606, 60060, 6660, 666, 66006, 6006, 600, 66666, 6006, 6606606, 660, 6660, 660606
Offset: 1

Views

Author

Amarnath Murthy, Nov 23 2002

Keywords

Comments

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

Crossrefs

Programs

  • Haskell
    a078245 n = head [x | x <- tail a204093_list, mod x n == 0]
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Mathematica
    With[{c=Rest[FromDigits/@Tuples[{0,6},10]]},Table[SelectFirst[c,Divisible[ #,n]&],{n,50}]] (* The program uses the SelectFirst function from Mathematica version 10 *) (* Harvey P. Dale, Apr 15 2015 *)
  • Python
    def A204093(n): return int(bin(n)[2:].replace('1', '6'))
    def a(n):
        k = 1
        while A204093(k)%n: k += 1
        return A204093(k)
    print([a(n) for n in range(1, 47)]) # Michael S. Branicky, Jun 06 2021

Extensions

More terms from Ray Chandler, Jul 12 2004
Showing 1-10 of 18 results. Next