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.

A368397 a(n) is the least number k not ending in 0 such that k^n has at least n 0's in its decimal expansion.

Original entry on oeis.org

101, 101, 101, 101, 101, 351, 518, 194, 1001, 951, 3231, 3757, 2169, 999, 1397, 2273, 9723, 8683, 13219, 6152, 15204, 18898, 39484, 10001, 10001, 35586, 46564, 35085, 71061, 100001, 43055, 43642, 83055, 44411, 36802, 94501, 135852, 52299, 174062, 121201, 173388, 119032, 215365, 94996, 201312
Offset: 1

Views

Author

Robert Israel, Dec 22 2023

Keywords

Examples

			a(6) = 351 because 351^6 = 1870004703089601 has 6 0's, and this is the smallest number not ending in 0 that works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
      for k from 2 do
        if k mod 10 <> 0 and numboccur(0, convert(k^n,base,10)) >= n then return k fi
      od
    end proc:
    map(f, [$1..50]);
  • Mathematica
    a={}; For[n=1, n<=45, n++, k=1; While[Mod[k,10]==0 || Count[IntegerDigits[k^n,10],0] < n, k++]; AppendTo[a,k]]; a (* Stefano Spezia, Dec 22 2023 *)
  • PARI
    a(n) = {
    	forstep(i = 11, oo, [1,1,1,1,1,1,1,1,2],
    		d = digits(i^n);	
    		t = 0;
    		for(j = 1, #d,
    			t+=(!d[j])
    		);
    		if(t >= n,
    			return(i)
    		)
    	)
    } \\ David A. Corneth, Dec 22 2023
    
  • Python
    from gmpy2 import digits
    from itertools import count
    def a(n): return next(k for k in count(1) if k%10 and digits(k**n).count('0')>=n)
    print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jan 05 2024