A217166
a(n) is the least value of k such that the decimal expansion of Lucas(k) contains n consecutive identical digits.
Original entry on oeis.org
0, 5, 36, 78, 112, 538, 3139, 6436, 17544, 82864, 328448, 1701593, 1701593, 8030342, 8030342, 77552742
Offset: 1
-
// See Links section.
-
k = 0; Join[{0}, Table[While[d = IntegerDigits[LucasL[k]]; ! MemberQ[Partition[Differences[d], n - 1, 1], Table[0, {n - 1}]], k++]; k, {n, 2, 8}]] (* T. D. Noe, Oct 02 2012 *)
-
def A217166(n):
if n == 1:
return 0
else:
l, y, x = [str(d)*n for d in range(10)], 2, 1
for m in range(1, 10**9):
s = str(x)
for k in l:
if k in s:
return m
y, x = x, y+x
return 'search limit reached'
# Chai Wah Wu, Dec 17 2014
A238448
Smallest number m such that 2^m contains a string of n consecutive increasing digits in its decimal representation.
Original entry on oeis.org
0, 7, 28, 135, 391, 992, 5837, 9485, 15975, 244178
Offset: 1
7 is the smallest exponent such that 2^7 contains two consecutive increasing digits (2^7 = 128).
28 is the smallest exponent such that 2^28 ( = 268435456) contains three consecutive increasing digits (456).
a(6) = 992 from 2^992 =
418558049682135672245478534789063207250548754572474065407714995457168379_345\
678_17284890561672488119458109166910841919797858872862722356017328064756\
15116630782786940537040715228680107267602488727296075852403533779290461\
69580757764357779904060393635270100437362409630553424235540298930640110\
82834640896 - _N. J. A. Sloane_, Aug 12 2018
-
a[1]=0; a[n_] := Block[{k = 4, p = 16}, While[Max[ Length /@ Select[ Split@ Differences@ IntegerDigits@p, First@# == 1 &]] < n-1, k++; p *= 2]; k]; a/@ Range[7] (* Giovanni Resta, Feb 26 2014 *)
-
def Str(x):
for n in range(10**5):
count = 0
i = 0
if len(str(2**n)) == x and x == 1:
return n
while i < len(str(2**n))-1:
if int(str(2**n)[i]) == int(str(2**n)[i+1])-1:
count += 1
i += 1
else:
if count == x-1:
return n
else:
count = 0
i += 1
if count == x-1:
return n
x = 1
while x < 50:
print(Str(x))
x += 1
Definition and examples corrected ("integers" changed to "digits") by
N. J. A. Sloane, Aug 12 2018
A238449
Smallest numbers m such that 2^m contains a string of n consecutive decreasing integers in its decimal representation.
Original entry on oeis.org
0, 5, 25, 78, 161, 341, 1315, 28238, 56047, 283789
Offset: 1
5 is the smallest exponent such that 2^5 contains two consecutive decreasing integers (2^5 = 32).
25 is the smallest exponent such that 2^25 contains three consecutive decreasing integers (2^25 = 33554432).
-
a[1] = 0; a[n_] := Block[{k = 4, p = 16}, While[Max[ Length /@ Select[ Split@ Differences@ IntegerDigits@p, First@# == -1 &]] < n-1, k++; p *= 2]; k]; a/@ Range[7] (* Giovanni Resta, Feb 26 2014 *)
-
def StrDec(x):
for n in range(10**5):
count = 0
i = 0
if len(str(2**n)) == x and x == 1:
return n
while i < len(str(2**n))-1:
if int(str(2**n)[i]) == int(str(2**n)[i+1])-1:
count += 1
i += 1
else:
if count == x-1:
return n
else:
count = 0
i += 1
if count == x-1:
return n
x = 1
while x < 50:
print(StrDec(x))
x += 1
A175924
Smallest power of 2 with n repeated digits.
Original entry on oeis.org
1, 65536, 16777216, 2199023255552, 1684996666696914987166688442938726917102321526408785780068975640576
Offset: 1
a(1) is 1 because it is the first power of 2; all integers have at least one digit.
a(2) is 65536 because it is the first power of 2 with two of the same digit in a row.
a(3) is 16777216 because it is the first power of 2 with three of the same digit in a row.
Subsequence of
A000079 (powers of 2).
-
f[n_] := Block[{k = 0}, While[ !MemberQ[Length /@ Split@ IntegerDigits[2^k], n], k++ ]; 2^k]; Table[f[n], {n, 5}] (* Robert G. Wilson v, Oct 21 2010 *)
-
import math
for N in range(1, 10):
repdigits = 1
n = 0
while repdigits < N:
n += 1
s = str(2 ** n)
prev = ""
repdigits = maxrepdigits = 1
for d in s:
if d == prev: repdigits += 1
else:
maxrepdigits = max(maxrepdigits, repdigits)
repdigits = 1
prev = d
repdigits = max(maxrepdigits, repdigits)
print(N, 2 ** n)
A217185
a(n) is the number of digits in the decimal representation of the smallest power of 2 that contains n consecutive identical digits.
Original entry on oeis.org
1, 5, 8, 13, 67, 293, 293, 2576, 12790, 12790, 81874, 312865, 520061, 2063822
Offset: 1
-
k = 0; Join[{1}, Table[While[d = IntegerDigits[2^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 *)
Comments