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.

Showing 1-3 of 3 results.

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

Views

Author

Martin Y. Champel, Jan 25 2015

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • PARI
    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
    
  • PARI
    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
  • Python
    # 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
    

Extensions

a(11) from Jon E. Schoenfield, Feb 22 2015
a(12), a(13) from Jon E. Schoenfield, Mar 07 2015, Mar 08 2015
a(14)-a(15) from Bert Dobbelaere, Oct 29 2018

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

Views

Author

Martin Y. Champel, Jan 30 2015

Keywords

Comments

a(6) and a(7) are anagrams.

Examples

			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'.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • Python
    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

Extensions

a(12) from Jon E. Schoenfield, Feb 27 2015
a(0) prepended by Jon E. Schoenfield, Mar 01 2015
a(14) by Lars Blomberg, Mar 19 2015
a(13) by Bert Dobbelaere, Oct 29 2018

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

Views

Author

Martin Y. Champel, Feb 22 2015

Keywords

Comments

Most multiples of 5 belong to the sequence (if not all).
All terms whose indices are included in A000966 are far bigger than their neighboring terms whose indices are multiples of 5.
a(11) is a multiple of 5, we can verify a(11) = a(25448).

Examples

			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.
		

Crossrefs

Programs

  • PARI
    \\ 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
    # 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
    
  • Python
    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.