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
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
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-3 of 3 results.
Comments