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.

A217186 a(n) is the number of digits in the decimal representation of the smallest power of 3 that contains n consecutive identical digits.

This page as a plain text file.
%I A217186 #13 Mar 12 2025 18:42:32
%S A217186 1,6,16,16,131,257,1014,3684,10875,51142,51142,304989
%N A217186 a(n) is the number of digits in the decimal representation of the smallest power of 3 that contains n consecutive identical digits.
%C A217186 Number of digits in 3^k is equal to floor(1 + k*log_10(3)).
%t A217186 k = 0; Join[{1}, Table[While[d = IntegerDigits[3^k]; prt = Partition[Differences[d], n - 1, 1]; ! MemberQ[prt, Table[0, {n - 1}]], k++]; Length[d], {n, 2, 8}]] (* _T. D. Noe_, Oct 03 2012 *)
%o A217186 (Python)
%o A217186 def A217186(n):
%o A217186     l, x = [str(d)*n for d in range(10)], 1
%o A217186     for m in range(10**9):
%o A217186         s = str(x)
%o A217186         for k in l:
%o A217186             if k in s:
%o A217186                 return len(s)
%o A217186         x *= 3
%o A217186     return 'search limit reached'
%o A217186 # _Chai Wah Wu_, Dec 17 2014
%Y A217186 Cf. A215727, A215733.
%K A217186 nonn,base,more
%O A217186 1,2
%A A217186 _V. Raman_, Sep 27 2012
%E A217186 a(12) from _Chai Wah Wu_, Dec 17 2014