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.

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.

This page as a plain text file.
%I A252652 #22 Oct 25 2023 20:33:38
%S A252652 0,7,12,22,107,264,812,4919,12154,24612,75705,101805,236441,1946174
%N 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.
%e A252652 a(0) = 0 since 0! = 1, which does not contain a 0.
%e A252652 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.)
%e A252652 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.
%t A252652 A252652[n_] := Module[{m = 0, s, t},
%t A252652    If[n == 0, While[MemberQ[IntegerDigits[m!], 0], m++]; m,
%t A252652     t = Table[0, n];
%t A252652     While[s = Split[IntegerDigits[m!]];
%t A252652      If[MemberQ[Last[s], 0], s = Delete[s, -1]]; ! MemberQ[s, t],
%t A252652      m++]; m]];
%t A252652 Table[A252652[n], {n, 0, 13}] (* _Robert Price_, Mar 21 2019 *)
%o A252652 (Python)
%o A252652 import re
%o A252652 def A252652(n):
%o A252652     if n == 0:
%o A252652         return 0
%o A252652     f, i, s = 1, 0, re.compile('[0-9]*[1-9]0{'+str(n)+'}[1-9][0-9]*')
%o A252652     while s.match(str(f)) == None:
%o A252652         i += 1
%o A252652         f *= i
%o A252652     return i # _Chai Wah Wu_, Dec 29 2015
%o A252652 (PARI) f(k, sz, sz1) = my(f=k!, s=Str(f/10^valuation(f, 10))); #strsplit(s, sz) - #strsplit(s, sz1);
%o A252652 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
%Y A252652 Cf. A254042, A254447, A254448, A254449, A254500, A254501, A254502, A254716, A254717.
%K A252652 nonn,base,more
%O A252652 0,2
%A A252652 _Jon E. Schoenfield_, Mar 22 2015, at the suggestion of _Martin Y. Champel_
%E A252652 a(13) from _Lars Blomberg_, Apr 05 2015