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.

A377565 a(n) is the least multiple of n with more decimal digits than n.

Original entry on oeis.org

10, 10, 12, 12, 10, 12, 14, 16, 18, 100, 110, 108, 104, 112, 105, 112, 102, 108, 114, 100, 105, 110, 115, 120, 100, 104, 108, 112, 116, 120, 124, 128, 132, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 100, 102, 104, 106, 108
Offset: 1

Views

Author

Rémy Sigrist, Nov 01 2024

Keywords

Examples

			For n = 42: 42 and 2*42 have the same number of digits, while 3*42 has more digits, so a(42) = 3*42 = 126.
		

Crossrefs

Programs

  • Mathematica
    Table[n*Ceiling[10^IntegerLength[n]/n], {n, 120}] (* Michael De Vlieger, Nov 02 2024 *)
  • PARI
    a(n) = n * ceil(10^#digits(n) / n)
    
  • Python
    def A377565(n): return n-1+10**(l:=len(str(n)))-(pow(10,l,n)-1)%n # Chai Wah Wu, Nov 02 2024

Formula

a(n) = n * A097327(n).

A377712 a(n) is the least divisor of n with as many decimal digits as n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 10, 31, 16, 11, 17, 35, 12, 37, 19, 13, 10, 41, 14, 43, 11, 15, 23, 47, 12, 49, 10, 17, 13, 53, 18, 11, 14, 19, 29, 59, 10, 61, 31, 21, 16, 13, 11, 67
Offset: 1

Views

Author

Rémy Sigrist, Nov 04 2024

Keywords

Examples

			For n = 42: the divisors of 42 are 1, 2, 3, 6, 7, 14, 21, 42; the least divisor with 2 digits is 14, so a(42) = 14.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local d,t;
      t:= ilog10(n);
      min(select(d -> ilog10(d)=t, numtheory:-divisors(n)))
    end proc:
    map(f, [$1..100]); # Robert Israel, Nov 06 2024
  • Mathematica
    s={};Do[m=0;d=Divisors[n];Until[Length[IntegerDigits[d[[m]]]]==Length[IntegerDigits[n]],m++];AppendTo[s,d[[m]]],{n,67}];s (* James C. McMahon, Nov 06 2024 *)
  • PARI
    a(n, base = 10) = { my (w = #digits(n, base)); forstep (x = base-1, 1, -1, if (n%x==0 && #digits(n/x)==w, return (n/x););); }
    
  • Python
    def A377712(n): return n//next(d for d in range(n//10**(len(str(n))-1),0,-1) if not n%d) # Chai Wah Wu, Nov 06 2024

Formula

1 <= n/a(n) <= 9.
Showing 1-2 of 2 results.