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

A334423 Fixed points of A257345.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 21, 32, 42, 64, 84, 128, 168, 256, 336, 512, 672, 1024, 1344, 2048, 2231, 2688, 4096, 4462, 5376, 8192, 9324, 10752, 16384, 18648, 21504, 32768, 37296, 43008, 65536, 74592, 86016, 131072, 149184, 172032, 262144, 298368, 344064, 524288, 596736, 688128, 1048576
Offset: 1

Views

Author

Bernard Schott, May 25 2020

Keywords

Comments

The least positive multiple of an integer m that when written in base 10 uses only 0's and 1's is q = A004290(m) = k*m. If we regard q as binary number and converts q to base 10, we get A257345(q) = u. When m = u, then m is a term.
If m is a term, then m*2^k is another term.
The first 3 primitive terms are 1, 21, 2231 and the 3 corresponding subsequences of such fixed points are,
-> m = 0 or m = 2^k, k>=0 (A131577),
-> m = 21 * 2^k, k>=0 (A175805),
-> m = 2231 * 2^k, k>=0 (2231, 4462, 9324, 18648, ...).

Examples

			The least positive multiple of 42 that when written in base 10 uses only 0's and 1's is 101010 = 2405*42. If we regard 101010 as binary number and converts to base 10, we get 42; hence, 42 is a term.
Successive operations for first primitive terms:
1 --> A004290(1) = 1_{10} --> 1_{2} = 1_{10},
21 --> A004290(21) = 10101_{10} --> 10101_{2} = 21_{10},
2231 --> A004290(2231) = 100010110111_{10} --> 100010110111_{2} = 2231_{10}.
		

Crossrefs

Subsequences: A131577, A175805.

Programs

  • PARI
    f(n) = {if( n==0, return (0)); my(m = n); while (vecmax(digits(m)) != 1, m+=n); m; } \\ A004290
    isok(m) = fromdigits(digits(f(m), 10), 2) == m; \\ Michel Marcus, May 29 2020

Formula

A257345(A004290(a(n))) = a(n).

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
Showing 1-3 of 3 results.