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

A266798 Least positive integer N such that n+N has the same digits as n and N together (without counting repetitions).

Original entry on oeis.org

10, 100, 100, 100, 100, 100, 100, 100, 100, 89, 99, 1000, 1000, 818, 1000, 1000, 1000, 1000, 168, 90, 100, 1000, 1000, 1000, 1000, 727, 336, 247, 1000, 899, 100, 1000, 1000, 1000, 1000, 1000, 326, 636, 1000, 899, 100, 1000, 1000, 1000, 1000, 405, 1000, 227, 1000, 545, 100, 1000, 1000, 1000, 450, 494, 1000, 1000, 1000, 899
Offset: 0

Views

Author

M. F. Hasler, Jan 01 2016

Keywords

Comments

Such an N always exists since 10^(1 + number of digits of n) satisfies the property.
a(n) = 1 for almost all n (in the sense of natural density). - Charles R Greathouse IV, Nov 15 2022
What is the largest number in this sequence? It is somewhere between a(9911111111) = 302345678 and 203456789111111111. - Charles R Greathouse IV, Dec 09 2022

Crossrefs

Programs

  • Maple
    digs:= proc(n) option remember;
      local t;
      t:= n mod 10;
      if n < 10 then {t}
      else {t} union procname((n-t)/10)
      fi;
    end proc:
    f:= proc(n)
      local k,Ln;
      Ln:= digs(n);
      for k from 1 do
         if Ln union digs(k) = digs(n+k) then return k fi
      od
    end proc:
    seq(f(n),n=0..100); # Robert Israel, Jan 03 2016
  • PARI
    a(n,d=digits(n),L=10^(1+#d))=for(k=1,L,Set(digits(k+n))==Set(concat(d,digits(k)))&&return(k))
    
  • Python
    from itertools import count
    def a(n):
        digs = set(str(n))
        return next(N for N in count(1) if digs | set(str(N)) == set(str(n+N)))
    print([a(n) for n in range(60)]) # Michael S. Branicky, Nov 15 2022

Formula

a(n) <= 10^(1 + number of digits of n).
a(n) <= 203456789111111111 < 2.04 * 10^17. (This can probably be improved by a few orders of magnitude.) - Charles R Greathouse IV, Nov 15 2022

A266586 The least nonnegative integer N such that n*N has the same digits as n and N together, not counting repetitions.

Original entry on oeis.org

1, 6163, 51, 416, 251, 21, 967, 86, 255, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1255, 1, 781, 973, 26, 265, 24, 81, 1139, 1135, 51, 1, 291, 186, 151, 41, 936, 3001, 886, 982, 416, 1, 341, 315, 1464, 181, 734, 371, 958, 1921, 251, 1, 2412, 635, 846, 221, 1801, 125, 948, 845, 21, 1, 251, 585, 2213, 281, 1076
Offset: 1

Views

Author

M. F. Hasler, Jan 01 2016

Keywords

Comments

See A266578 for the variant where repeated digits are counted.
a(n) = 1 for 100 <= n <= 199 (and whenever n has a digit 1, cf. A011531), but then the sequence continues nontrivially with a(200,...) = (1255, 1, 751, 621, 251, 99, 511, 97, 101, 101, ...).
Record values are a(2) = 6163, a(2953) = 6521, a(3597) = 7209, a(5904) = 8047, a(23222) = 7681, a(39808) = 8011, a(39993) = 8231, a(44444) = 10151, ...
For small k=1,...,6, the graphs over the range 1 .. 10^(k+1) are roughly ("self"-)similar, because of the ranges 10^k .. 2*10^k-1 and (m+1/10)*10^k .. (m+2/10)*10^k-1 (with m=2,...,9) etc., on which a(n) = 1, while generically a(n) has values ranging quite uniformly between 1 and 10^4. For larger k, the picture changes, since pandigital numbers (and therefore also numbers having a digit '1') have asymptotic density one.

Examples

			a(2) = 6163 since 2*6163 = 12326 has the same digits (1, 2, 3 and 6) as concat(2,6163) = 26163, and 6163 is the least N with this property.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k,Ln,Lk,Lnk;
      Ln:= convert(convert(n,base,10),set);
      if has(Ln,1) then return 1 fi;
      for k from 2 do
        Lk:= convert(convert(k,base,10),set);
        Lnk:= convert(convert(n*k,base,10),set);
        if Lnk = Ln union Lk then return k fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jan 01 2016
  • PARI
    A266586(n,L=9e9,d=digits(n))=for(k=1,L,Set(digits(k*n))==Set(concat(digits(k),d))&&return(k))
    
  • Python
    from itertools import count
    def a(n):
        digs = set(str(n))
        return next(N for N in count(1) if digs | set(str(N)) == set(str(n*N)))
    print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Nov 15 2022

Formula

a(n) = 1 whenever n has a digit '1', i.e., n in A011531.
a(n) <= A266578(n) unless A266578(n) = 0.
Showing 1-2 of 2 results.