login
a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 0's.
1

%I #49 Jan 15 2025 20:09:47

%S 0,5,10,15,20,264,25,30,35,40,45,101805,50,55,60,65,70

%N a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 0's.

%C Most multiples of 5 belong to the sequence (if not all).

%C All terms whose indices are included in A000966 are far bigger than their neighboring terms whose indices are multiples of 5.

%C a(11) is a multiple of 5, we can verify a(11) = a(25448).

%e a(0) = 0 as 0! = 1 does not contain '0'.

%e a(1) = 5 as 5! = 120 contains '0'.

%e a(2) = 10 as 10! = 3628800 contains '00' and 10 is the smallest integer for which the condition is met.

%o (Python) # Python version 2.7

%o from math import factorial as fct

%o def trailing_zero(n):

%o k=0

%o while n!=0:

%o n/=5

%o k+=n

%o return k

%o def A255400():

%o index = 1

%o f = 1

%o while True:

%o if trailing_zero(f) == index:

%o print("A255400("+str(index)+") = " +str(f))

%o index += 1

%o elif trailing_zero(f) > index:

%o while True:

%o clnzer = str(fct(f))[:-trailing_zero(f)]

%o if index*'0' in clnzer and (index+1)*'0' not in clnzer:

%o print("A255400("+str(index)+") = " +str(f))

%o index += 1

%o f = 0

%o break

%o f +=1

%o f +=1

%o return

%o (Python)

%o import re

%o def A255400(n):

%o f, i, s = 1, 0, re.compile('[0-9]*[1-9]0{'+str(n)+'}[1-9][0-9]*')

%o while s.match(str(f)+'1') is None:

%o i += 1

%o f *= i

%o return i # _Chai Wah Wu_, Apr 02 2015

%o (PARI) \\ uses is() from A000966

%o 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);

%o 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

%Y Cf. A027868, A000966.

%Y Cf. A254042, A254447, A254448, A254449, A254500, A254501, A254502, A254716, A254717.

%Y Cf. A252652.

%K nonn,base,more

%O 0,2

%A _Martin Y. Champel_, Feb 22 2015