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 10 results.

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

A181060 a(n) is the smallest positive multiple of n whose decimal digits are all 0, 1 or 2.

Original entry on oeis.org

1, 2, 12, 12, 10, 12, 21, 112, 12222, 10, 11, 12, 221, 112, 120, 112, 102, 12222, 1102, 20, 21, 22, 1012, 120, 100, 1222, 21222, 112, 1102, 120, 2201, 1120, 1122, 102, 210, 22212, 111, 1102, 10101, 120, 11111, 210, 2021, 220, 122220, 1012, 1222, 1200
Offset: 1

Views

Author

Herman Beeksma, Oct 01 2010

Keywords

Examples

			a(9)=12222 because 12222 is the smallest multiple of 9 whose decimal digits are all 0, 1 or 2.
		

Crossrefs

a(n)/n yields sequence A181061.

Programs

  • Mathematica
    With[{pms=Rest[Flatten[FromDigits/@Tuples[{0,1,2},6]]]},Table[ SelectFirst[ pms, Divisible[ #,n]&],{n,50}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 24 2017 *)
  • PARI
    a(n) = my(k=1); while(vecmax(digits(k*n))>2, k++); k*n; \\ Michel Marcus, May 17 2020

A190301 Smallest number h such that n*h is a repunit (A002275), or 0 if no such h exists.

Original entry on oeis.org

1, 0, 37, 0, 0, 0, 15873, 0, 12345679, 0, 1, 0, 8547, 0, 0, 0, 65359477124183, 0, 5847953216374269, 0, 5291, 0, 48309178743961352657, 0, 0, 0, 4115226337448559670781893, 0, 38314176245210727969348659, 0, 3584229390681, 0, 3367, 0, 0, 0, 3, 0, 2849, 0, 271, 0
Offset: 1

Views

Author

Jaroslav Krizek, May 07 2011

Keywords

Examples

			For n = 7: a(7) = 15873 because 7 * 15873 = 111111. Repunit 111111 is the smallest repunit with prime factor 7.
		

Crossrefs

Cf. A084681 (repunit length), A216479 (the repunit).
Cf. A050782 = the smallest number h such that n*h is palindromic number, A083117 = the smallest number h such that n*h is repdigit number.

Programs

  • Mathematica
    Table[If[GCD[n, 10] > 1, 0, k = MultiplicativeOrder[10, 9*n]; (10^k - 1)/(9*n)], {n, 100}] (* T. D. Noe, May 08 2011 *)
  • PARI
    a(n)=if(gcd(n,10)>1, 0, (10^znorder(Mod(10,9*n))-1)/9/n) \\ Charles R Greathouse IV, Aug 28 2016

A216479 a(n) is the least multiple of n which uses only the digit 1, or a(n) = -1 if no such multiple exists.

Original entry on oeis.org

1, -1, 111, -1, -1, -1, 111111, -1, 111111111, -1, 11, -1, 111111, -1, -1, -1, 1111111111111111, -1, 111111111111111111, -1, 111111, -1, 1111111111111111111111, -1, -1, -1, 111111111111111111111111111, -1, 1111111111111111111111111111, -1, 111111111111111, -1, 111111, -1, -1, -1, 111, -1, 111111, -1, 11111, -1
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Comments

a(n) = -1 if and only if n is a multiple of 2 or 5. See comment in A216485. - Chai Wah Wu, Jun 21 2015

Crossrefs

Cf. A084681 (number of 1's), A190301 (multiplier).

Programs

  • Mathematica
    Array[Which[GCD[#, 10] != 1, -1, Mod[#, 3] == 0, Block[{k = 1}, While[Mod[k, #] != 0, k = 10 k + 1]; k], True, (10^MultiplicativeOrder[10, #] - 1)/9] &, 42] (* Michael De Vlieger, Dec 11 2020 *)
  • Python
    def A216479(n):
        if n % 2 == 0 or n % 5 == 0:
            return -1
        rem = 1
        while rem % n != 0:
            rem = rem*10 + 1
        return rem
    # Azanul Haque, Nov 28 2020

A223475 Least k such that the decimal representation of k*n has digits in nonincreasing order.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 3, 2, 2, 3, 3, 4, 1, 1, 1, 4, 3, 2, 2, 2, 3, 3, 1, 1, 1, 1, 13, 2, 2, 2, 2, 17, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 15, 13, 9, 9, 1, 1, 1, 1, 1, 1, 1, 13, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 84, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 86, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 5, 7, 5, 2, 5, 3, 4, 6, 1, 1, 75, 47, 38, 8, 45, 56, 8, 7, 5, 55, 5, 7
Offset: 1

Views

Author

Paul Tek, Mar 20 2013

Keywords

Examples

			39*17 = 663 has digits in nonincreasing order, and no k < 17 has this property, hence a(39) = 17.
		

Crossrefs

a(n)*n yields sequence A223474.
Cf. A009996.

Programs

  • Mathematica
    a[n_] := a[nn_] := Block[{n = nn, f, w = Range@9, k = 1}, While[Mod[n, 10] == 0, n /= 10]; While[(f = Select[w, Max@ Differences@ IntegerDigits[n*#] <= 0 &, 1]) == {}, k++; w = Union@ Flatten@Table[ Select[d*10^(k-1) + w, Max@ Differences@ IntegerDigits[Mod[n*#, 10^k], 10, k] <= 0 &], {d, 0, 9}]]; f[[1]]]; Array[a, 123] (* faster than basic approach. Giovanni Resta, Mar 26 2013 *)

A216481 a(n) is the least multiple of n which uses only digit 2, or a(n) = -1 if no such multiple exists.

Original entry on oeis.org

2, 2, 222, -1, -1, 222, 222222, -1, 222222222, -1, 22, -1, 222222, 222222, -1, -1, 2222222222222222, 222222222, 222222222222222222, -1, 222222, 22, 2222222222222222222222, -1, -1, 222222, 222222222222222222222222222, -1, 2222222222222222222222222222, -1, 222222222222222, -1, 222222, 2222222222222222, -1, -1, 222, 222222222222222222, 222222, -1, 22222, 222222
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Crossrefs

A216485 a(n) is the least value of k such that k*n uses only the digit 2, or a(n) = -1 if no such multiple exists.

Original entry on oeis.org

2, 1, 74, -1, -1, 37, 31746, -1, 24691358, -1, 2, -1, 17094, 15873, -1, -1, 130718954248366, 12345679, 11695906432748538, -1, 10582, 1, 96618357487922705314, -1, -1, 8547, 8230452674897119341563786, -1, 76628352490421455938697318, -1, 7168458781362, -1, 6734, 65359477124183, -1, -1, 6, 5847953216374269, 5698, -1, 542, 5291, 5167958656330749354
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Comments

a(n) <= 2(10^n -1)/(9n). a(n) = -1 if and only if n is a multiple of 4 or 5. If n is a multiple of 4 then a(n) = -1 since 222....222 is not a multiple of 4. If n is a multiple of 5 then all multiples of n ends with the digit 0 or 5 and a(n) = -1. If n is odd and not a multiple of 4 or 5, then by the pigeonhole principle, two different repunits will have the same remainder modulo n. Their difference will be of the form 11...1110..0 which is a multiple of n. Since n and 10 are coprime, n is a divisor of a repunit and a(n) != -1. If n is even and not a multiple of 4 or 5, we take n/2 and use the same argument to show that n/2 is a divisor of a repunit and a(n) != -1. - Chai Wah Wu, Jun 21 2015

Crossrefs

A216482 a(n) is the least value of k such that k*n uses only digits 1 and 2. a(n) = -1 if no such multiple exists.

Original entry on oeis.org

1, 1, 4, 3, -1, 2, 3, 14, 1358, -1, 1, 1, 17, 8, -1, 7, 13, 679, 59, -1, 1, 1, 527, 88, -1, 47, 786, 4, 418, -1, 362, 66, 34, 33, -1, 617, 3, 319, 2849, -1, 271, 291, 284, 48, -1, 2657, 26, 44, 229, -1, 22, 406, 4, 393, -1, 2, 3723, 209, 19, -1, 2, 181, 194, 33, -1, 17, 33, 1634, 3219, -1, 172, 1696, 2907, 3, -1, 1462, 1443, 1554, 28, -1, 262, 271, 134, 1443
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local d,a,i,S,R;
      if n mod 5 = 0 then return -1 fi;
      for d from ilog10(n)+1 do
         a:= (10^d-1)/9;
         S:= [seq(10^i, i=0..d-1)];
         R:= select(t -> convert(t,`+`) + a mod n = 0, combinat:-powerset(S));
         if R <> [] then return min(map(t -> convert(t,`+`)+a, R))/n fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Dec 26 2022

A216478 a(n) is the least multiple of n which uses only digits 1 and 2. a(n) = -1 if no such multiple exists.

Original entry on oeis.org

1, 2, 12, 12, -1, 12, 21, 112, 12222, -1, 11, 12, 221, 112, -1, 112, 221, 12222, 1121, -1, 21, 22, 12121, 2112, -1, 1222, 21222, 112, 12122, -1, 11222, 2112, 1122, 1122, -1, 22212, 111, 12122, 111111, -1, 11111, 12222, 12212, 2112, -1, 122222, 1222, 2112, 11221, -1, 1122, 21112, 212, 21222, -1, 112, 212211, 12122, 1121
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Crossrefs

A335401 a(n) is the smallest positive number such that the decimal digits of n*a(n) are all 0, 1, 2 or 3.

Original entry on oeis.org

1, 1, 1, 3, 2, 2, 3, 4, 37, 1, 1, 1, 1, 8, 2, 2, 6, 74, 7, 1, 1, 1, 1, 5, 4, 5, 49, 4, 7, 1, 1, 1, 1, 3, 6, 37, 3, 29, 8, 3, 3, 5, 7, 3, 74, 5, 26, 25, 27, 2, 2, 6, 4, 43, 2, 2, 23, 4, 17, 2, 2, 5, 21, 5, 2, 2, 3, 15, 19, 3, 3, 31, 14, 3, 4, 132, 3, 4, 27, 4, 41
Offset: 1

Views

Author

Bernard Schott, Jun 06 2020

Keywords

Comments

If a(n) = k, then a(10n) = k.
a(n) = 1 iff n is in A007090; hence, except for a(1) = a(2) = a(3) = 1, the terms 1 always appear in strings of 4 consecutive 1's.
Records occur for n: 1, 4, 8, 9, 18, 76, ...

Examples

			a(9)= 37 because 9*37=333 is the smallest multiple of 9 whose decimal digits are all 0, 1, 2 or 3.
		

Crossrefs

Cf. A079339 (similar, with digits 0 and 1), A181061 (similar, with digits 0, 1 and 2).

Programs

  • Mathematica
    a[n_] := Block[{k = 1}, While[Max@ IntegerDigits[k n] > 3, k++]; k]; Array[a, 81] (* Giovanni Resta, Jun 06 2020 *)
  • PARI
    a(n) = my(k=1); while(vecmax(digits(k*n))>3, k++); k; \\ Michel Marcus, Jun 08 2020

Formula

a(n) = A334914(n)/n.

Extensions

More terms from Giovanni Resta, Jun 06 2020
Showing 1-10 of 10 results.