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.

This page as a plain text file.
%I A309707 #22 Sep 08 2022 08:46:21
%S A309707 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,
%T A309707 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,
%U A309707 10,5,2,6,6,5,2,4,3,2,3,5,2,6,3,5,2,4,3,2,10,5,2,8
%N A309707 a(n) is the least integer k > 1 such that k^n starts with 1.
%C A309707 1 <= a(n) <= 10.
%H A309707 Robert Israel, <a href="/A309707/b309707.txt">Table of n, a(n) for n = 1..10000</a>
%F A309707 a(n) = A067442(n)^(1/n) for n >= 2.
%e A309707 a(3)=5 because 5^3=125 starts with 1, and none of 2^3, 3^3, 4^3 do.
%p A309707 f:= proc(n) local d,x,y;
%p A309707   for x from 2 to 10 do
%p A309707     y:= x^n;
%p A309707     if floor(y/10^ilog10(y)) = 1 then return x fi
%p A309707 od
%p A309707 end proc:
%p A309707 map(f, [$1..100]);
%t A309707 lik[n_]:=Module[{k=2},While[IntegerDigits[k^n][[1]]!=1,k++];k]; Array[ lik,100] (* _Harvey P. Dale_, Dec 06 2019 *)
%o A309707 (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
%o A309707 (PARI) a(n) = {my(k=2); while(digits(k^n)[1] != 1, k++); k;} \\ _Michel Marcus_, Aug 15 2019
%o A309707 (Python)
%o A309707 print(1,10)
%o A309707 n = 1
%o A309707 while n < 100:
%o A309707     n, p = n+1, 2
%o A309707     s = str(p**n)
%o A309707     while s[0] != "1":
%o A309707         p = p+1
%o A309707         s = str(p**n)
%o A309707     print(n,p) # _A.H.M. Smeets_, Aug 16 2019
%Y A309707 Cf. A067442.
%K A309707 nonn,base
%O A309707 1,1
%A A309707 _Robert Israel_, Aug 13 2019