A254042
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 1's.
Original entry on oeis.org
2, 0, 22, 47, 38, 436, 736, 2322, 3912, 47262, 123398, 263600, 679530, 725244, 8118161, 5690326
Offset: 0
a(0) = 2 since 2! equals 2, which does not contain any '1'.
a(1) = 0 since 0! equals 1, which contains '1' but not '11'.
a(2) = 22 since 22! equals 1124000727777607680000, which contains '11', and 22 is the smallest integer for which this condition is met.
-
f[n_] := Block[{k = 0, s = ToString[(10^n - 1)/9]}, While[ Length@ StringPosition[ ToString[k!], s] != 1, j = k++]; k]; f[0] = 2; Array[f, 12, 0] (* Robert G. Wilson v, Feb 27 2015 *)
-
a(n)=k=0;while(k<10^4,d=digits(2*10^(#(digits(k!))+1)+10*k!);for(j=1,#d-n+1,c=0;for(i=j,j+n-1,if(d[i]==1,c++);if(d[i]!=1,c=0;break));if(c==n&&d[j+n]!=1&&d[j-1]!=1,return(k)));if(c==n,return(k));if(c!=n,k++))
for(n=1,6,print1(a(n),", ")) \\ Derek Orr, Jan 29 2015
-
max1s(n)=my(v=digits(n),r,t);for(i=1,#v,if(v[i]==1,t++,r=max(r,t);t=0));max(t,r)
a(n)=my(m=0); while(max1s(m!)!=n, m++); m \\ Charles R Greathouse IV, Jan 30 2015
-
# Output doesn't include a(0).
def A254042():
index = 1
k = 0
f = 1
u = '1'
while True:
sf = str(f)
if u in sf and u+'1' not in sf:
print("A254042("+str(index)+") = " +str(k))
index += 1
k = 0
f = 1
u +='1'
k += 1
f *= k
return
A254447
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 2's.
Original entry on oeis.org
0, 2, 13, 31, 45, 200, 854, 3358, 4698, 29324, 55295, 263489, 567993, 2328803
Offset: 0
a(0) = 0 since 0! equals 1, which does not contain any '2'.
For n = 1, a(1) = 2 as 2! = 2 contains '2'.
For n = 2, a(2) = 13 as 13! = 6227020800 contains '22' and 13 is the smallest integer for which the condition is met.
-
A254447[n_] := Module[{m = 0},
If[n == 0, While[MemberQ[IntegerDigits[m!], 2], m++]; m,
t = Table[2, n];
While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m]];
Table[A254447[n], {n, 0, 13}](* Robert Price, Mar 20 2019 *)
A254449
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 4's.
Original entry on oeis.org
0, 4, 21, 63, 117, 375, 1325, 1253, 5741, 30455, 83393, 68094, 565882, 2666148, 1514639
Offset: 0
a(1) = 4 since 4! = 24 contains '4', and 4 is the smallest integer for which this condition is met.
a(2) = 21 since 21! = 51090942171709440000 contains '44'.
-
A254449[n_] := Module[{m = 0},
t = Table[4, n];
While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m];
Join[{0}, Table[A254449[n], {n, 1, 14}]] (* Robert Price, Mar 20 2019 *)
-
def A254449(n):
if n == 0:
return 0
i, m, s = 1, 1, '4'*n
s2 = s+'4'
while True:
m *= i
sn = str(m)
if s in sn and s2 not in sn:
return i
i += 1 # Chai Wah Wu, Dec 29 2015
A254717
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 9's.
Original entry on oeis.org
0, 12, 11, 36, 99, 207, 629, 3982, 13216, 24090, 65698, 131076, 176801, 2074822, 5203944, 3716991
Offset: 0
a(1) = 12 since 12! = 479001600 contains '9' and 12 is the smallest integer for which the condition is met,
a(2) = 11 since 11! = 39916800 contains '99' and 11 is the smallest integer for which the condition is met.
-
A254717[n_] := Module[{m = 0},
If[n == 0, While[MemberQ[IntegerDigits[m!], 9], m++]; m,
t = Table[9, n];
While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m]];
Table[A254717[n], {n, 0, 7}] (* Robert Price, Mar 21 2019 *)
-
a(n)=k=0;while(k<10^4,d=digits(2*10^(#(digits(k!))+1)+10*k!);for(j=1,#d-n+1,c=0;for(i=j,j+n-1,if(d[i]==9,c++);if(d[i]!=9,c=0;break));if(c==n&&d[j+n]!=9&&d[j-1]!=9,return(k)));if(c==n,return(k));if(c!=n,k++))
for(n=1,6,print1(a(n),", ")) \\ Derek Orr, Feb 06 2015
A254500
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 5's.
Original entry on oeis.org
0, 7, 17, 70, 111, 258, 689, 454, 7133, 15977, 82869, 111044, 536687, 384769, 2750561, 7063105
Offset: 0
a(1) = 7 as 7! equals 5040, which contains '5' and 5 is the smallest integer for which the condition is met.
-
A254450[n_] := Module[{m = 0},
If[n == 0, While[MemberQ[IntegerDigits[m!], 5], m++]; m,
t = Table[5, n];
While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m]];
Table[A254450[n], {n, 0, 13}] (* Robert Price, Mar 21 2019 *)
A254501
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 6's.
Original entry on oeis.org
0, 3, 20, 38, 35, 213, 1122, 3415, 10214, 32430, 145197, 351679, 666779, 813843, 3765934
Offset: 0
a(1) = 3 since 3! equals 6 and contains '6'.
a(2) = 20 since 20! contains '66' and 20 is the smallest integer for which the condition is met.
-
A254451[n_] := Module[{m = 0},
If[n == 0, While[MemberQ[IntegerDigits[m!], 6], m++]; m,
t = Table[6, n];
While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m]];
Table[A254451[n], {n, 0, 7}] (* Robert Price, Mar 21 2019 *)
A254502
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 7's.
Original entry on oeis.org
0, 6, 31, 48, 22, 599, 1102, 5280, 4667, 1753, 48861, 150336, 223254, 644487, 7016773, 9588848
Offset: 0
a(1) = 6 since 6! equals 720, which contains '7'.
-
A254452[n_] := Module[{m = 0},
If[n == 0, While[MemberQ[IntegerDigits[m!], 7], m++]; m,
t = Table[7, n];
While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m]];
Table[A254452[n], {n, 0, 14}] (* Robert Price, Mar 21 2019 *)
A254716
a(n) is the smallest nonnegative integer m such that m! contains a string of exactly n consecutive 8's, or -1 if no such m exists.
Original entry on oeis.org
0, 11, 9, 16, 27, 482, 532, 4731, 2061, 22402, 50381, 187611, 757618, 591042, 5157267, 9003765
Offset: 0
a(1) = 11 since 11! = 39916800 contains '8' and 11 is the smallest integer for which the condition is met. (In 9! the '8's occur in a substring of length 2.)
a(2) = 9 since 9! = 362880 contains '88' and 9 is the smallest integer for which this condition is met.
-
f[n_] := Block[{k = 0, str = ToString[ 8(10^n - 1)/9]}, While[ Length@ StringPosition[ ToString[ k!], str] != 1, k++]; k]; f[0] = 0; Array[f, 14, 0] (* Robert G. Wilson v, Mar 10 2015 *)
-
a(n)=k=0; while(k<10^4, d=digits(2*10^(#(digits(k!))+1)+10*k!); for(j=1, #d-n+1, c=0; for(i=j, j+n-1, if(d[i]==8, c++); if(d[i]!=8, c=0; break)); if(c==n&&d[j+n]!=8&&d[j-1]!=8, return(k))); if(c==n, return(k)); if(c!=n, k++))
for(n=1,6,print1(a(n),", ")) \\ Derek Orr, Feb 06 2015
A252652
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 0's, not including trailing 0's.
Original entry on oeis.org
0, 7, 12, 22, 107, 264, 812, 4919, 12154, 24612, 75705, 101805, 236441, 1946174
Offset: 0
a(0) = 0 since 0! = 1, which does not contain a 0.
a(1) = 7 since 7! = 5040, which contains a 0 other than the trailing 0, and no integer smaller than 7 satisfies this requirement. (a(1) is not 5; 5! = 120, which has no 0 digits other than the trailing 0.)
a(2) = 12 since 12! = 479001600; discarding the trailing 0's leaves 4790016, which contains a string of exactly two consecutive 0's, and no integer smaller than 12 satisfies this requirement.
-
A252652[n_] := Module[{m = 0, s, t},
If[n == 0, While[MemberQ[IntegerDigits[m!], 0], m++]; m,
t = Table[0, n];
While[s = Split[IntegerDigits[m!]];
If[MemberQ[Last[s], 0], s = Delete[s, -1]]; ! MemberQ[s, t],
m++]; m]];
Table[A252652[n], {n, 0, 13}] (* Robert Price, Mar 21 2019 *)
-
f(k, sz, sz1) = my(f=k!, s=Str(f/10^valuation(f, 10))); #strsplit(s, sz) - #strsplit(s, sz1);
a(n) = if (n==0, return(0)); my(sz=concat(vector(n, k, "0")), sz1=concat(sz, "0"), k=1); while (f(k, sz, sz1) != 1, k++); k; \\ Michel Marcus, Oct 25 2023
-
import re
def A252652(n):
if n == 0:
return 0
f, i, s = 1, 0, re.compile('[0-9]*[1-9]0{'+str(n)+'}[1-9][0-9]*')
while s.match(str(f)) == None:
i += 1
f *= i
return i # Chai Wah Wu, Dec 29 2015
A255400
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 0's.
Original entry on oeis.org
0, 5, 10, 15, 20, 264, 25, 30, 35, 40, 45, 101805, 50, 55, 60, 65, 70
Offset: 0
a(0) = 0 as 0! = 1 does not contain '0'.
a(1) = 5 as 5! = 120 contains '0'.
a(2) = 10 as 10! = 3628800 contains '00' and 10 is the smallest integer for which the condition is met.
-
\\ uses is() from A000966
f(k, special, sz, sz1) = my(f=k!); if (special, s=Str(f/10^valuation(f, 10)), s=Str(k!)); #strsplit(s, sz) - #strsplit(s, sz1);
a(n) = if (n==0, return(0)); my(sz= concat(vector(n, k, "0")), sz1=concat(sz, "0"), k=1,special=is(n)); while (f(k, special, sz, sz1) != 1, k++); k; \\ Michel Marcus, Oct 25 2023
-
# Python version 2.7
from math import factorial as fct
def trailing_zero(n):
k=0
while n!=0:
n/=5
k+=n
return k
def A255400():
index = 1
f = 1
while True:
if trailing_zero(f) == index:
print("A255400("+str(index)+") = " +str(f))
index += 1
elif trailing_zero(f) > index:
while True:
clnzer = str(fct(f))[:-trailing_zero(f)]
if index*'0' in clnzer and (index+1)*'0' not in clnzer:
print("A255400("+str(index)+") = " +str(f))
index += 1
f = 0
break
f +=1
f +=1
return
-
import re
def A255400(n):
f, i, s = 1, 0, re.compile('[0-9]*[1-9]0{'+str(n)+'}[1-9][0-9]*')
while s.match(str(f)+'1') is None:
i += 1
f *= i
return i # Chai Wah Wu, Apr 02 2015
Showing 1-10 of 10 results.
Comments