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.

A097326 Largest integer m such that m*n has the same decimal digit length as n.

Original entry on oeis.org

9, 4, 3, 2, 1, 1, 1, 1, 1, 9, 9, 8, 7, 7, 6, 6, 5, 5, 5, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9
Offset: 1

Views

Author

Rick L. Shepherd, Aug 04 2004

Keywords

Comments

For any positive base B >= 2 the corresponding sequence contains only terms from 1 to B-1 inclusive so the corresponding sequence for binary is all 1's (A000012).

Examples

			a(12)=8 as 12 and 8*12=96 both have two decimal digits while 9*12=108 has three.
		

Crossrefs

Cf. A061601 (analog for decimal m+n), A035327 (analog for binary m+n), A097327.
Cf. A055642.

Programs

  • Mathematica
    limn[n_]:=Module[{k=9,len=IntegerLength[n]},While[IntegerLength[k*n] > len, k--];k]; Array[limn,110] (* Harvey P. Dale, Apr 28 2018 *)
    Table[Ceiling[10^IntegerLength[n]/n] - 1, {n, 100}] (* Paolo Xausa, Nov 06 2024 *)
  • PARI
    a(n) = my(m=1, sn=#Str(n)); while (#Str(m*n) <= sn, m++); m-1; \\ Michel Marcus, Oct 05 2021
  • Python
    def a(n): return (10**len(str(n))-1)//n
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Oct 05 2021
    

Formula

a(n) = A097327(n) - 1.
a(n) = floor((10^A055642(n) - 1)/n). - Michael S. Branicky, Oct 05 2021

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