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.

A309707 a(n) is the least integer k > 1 such that k^n starts with 1.

Original entry on oeis.org

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

Views

Author

Robert Israel, Aug 13 2019

Keywords

Comments

1 <= a(n) <= 10.

Examples

			a(3)=5 because 5^3=125 starts with 1, and none of 2^3, 3^3, 4^3 do.
		

Crossrefs

Cf. A067442.

Programs

  • Magma
    m:=1; sol:=[]; for n in [1..100] do k:=2; while Reverse(Intseq(k^n))[1] ne 1 do k:=k+1; end while; sol[m]:=k; m:=m+1; end for; sol; // Marius A. Burtea, Aug 15 2019
    
  • Maple
    f:= proc(n) local d,x,y;
      for x from 2 to 10 do
        y:= x^n;
        if floor(y/10^ilog10(y)) = 1 then return x fi
    od
    end proc:
    map(f, [$1..100]);
  • Mathematica
    lik[n_]:=Module[{k=2},While[IntegerDigits[k^n][[1]]!=1,k++];k]; Array[ lik,100] (* Harvey P. Dale, Dec 06 2019 *)
  • PARI
    a(n) = {my(k=2); while(digits(k^n)[1] != 1, k++); k;} \\ Michel Marcus, Aug 15 2019
    
  • Python
    print(1,10)
    n = 1
    while n < 100:
        n, p = n+1, 2
        s = str(p**n)
        while s[0] != "1":
            p = p+1
            s = str(p**n)
        print(n,p) # A.H.M. Smeets, Aug 16 2019

Formula

a(n) = A067442(n)^(1/n) for n >= 2.