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.

A102730 Number of factorials contained in the binary representation of n!

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 5, 6, 7, 6, 7, 6, 7, 6, 6, 6, 7, 6, 6, 6, 7, 6, 7, 8, 6, 7, 6, 7, 6, 7, 7, 7, 8, 7, 7, 7, 6, 8, 7, 7, 7, 7, 7, 8, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 8, 7, 7, 8, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 8, 7, 7, 7, 7, 8, 7, 7, 8, 8, 7, 7, 7, 8, 8, 7, 8, 7, 7
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 07 2005

Keywords

Comments

Conjecture: the sequence is bounded.
I conjecture the contrary: for every k, there exists n with a(n) > k. See A103670. - Charles R Greathouse IV, Aug 21 2011
For n > 0: A103670(n) = smallest m such that a(m) = n.
A103671(n) = smallest m such that the binary representation of n! does not contain m!.
A103672(n) = greatest m less than n such that the binary representation of n! contains m!.

Examples

			n = 6: 6! = 720 -> '1011010000' contains a(6) = 5 factorials: 0! = 1 -> '1', 1! = 1 -> '1', 2! = 2 -> '10', 3! = 6 -> '110' and 6! itself, but not 4! = 24-> '11000' and 5! = 120 -> '1111000'.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Boole[StringContainsQ[IntegerString[n!, 2], IntegerString[k!, 2]]], {k, 0, n}]; Array[a, 100, 0] (* Amiram Eldar, Apr 03 2025 *)
  • PARI
    contains(v,u)=for(i=0,#v-#u,for(j=1,#u,if(v[i+j]!=u[j],next(2)));return(1));0
    a(n)=my(v=binary(n--!));sum(i=0,n-1,contains(v,binary(i!)))+1 \\ Charles R Greathouse IV, Aug 21 2011

A093685 In binary representation: numbers not occurring in their factorial.

Original entry on oeis.org

0, 5, 11, 13, 15, 17, 31, 37, 55, 81, 164, 395, 513, 517, 619, 1041, 1287, 1538, 2108, 2116, 2137, 2138, 2282, 2352, 2363, 2432, 2466, 2524, 4278, 4511, 4758, 4766, 4852, 4854, 5136, 5586, 8396, 8463, 8883, 9707, 10351, 16528, 17279, 19469, 21244, 24472
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 10 2004

Keywords

Comments

A093684(a(n)) = 0, complement of A093686.

Examples

			5! = 1*2*3*4*5 = 120 -> '1111000', in which '101'=5 is not contained, so 5 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := ToString[ FromDigits[ IntegerDigits[n, 2]]]; Select[ Range[ 29000], StringPosition[ f[ #! ], f[ # ]] == {} &] (* Robert G. Wilson v, Apr 15 2004 *)
  • Python
    def aupto(limit):
      kfact, alst = 1, [0]
      for k in range(1, limit+1):
        kb, kfact = bin(k)[2:], kfact * k
        kfactb = bin(kfact)[2:]
        if kb not in kfactb: alst.append(k)
      return alst
    print(aupto(25000)) # Michael S. Branicky, May 01 2021

Extensions

More terms from Robert G. Wilson v, Apr 15 2004

A093686 In binary representation: numbers occurring at least once in their factorial.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 10 2004

Keywords

Comments

A093684(a(n)) > 0, complement of A093685.
Almost all numbers are included -- of the first 1000 numbers, only 14 -- i.e., 5, 11, 13, 15, 17, 31, 37, 55, 81, 164, 395, 513, 517, and 619 -- do not appear. In all likelihood, the density of such exceptions gets even smaller as the numbers get larger. - Harvey P. Dale, May 16 2025

Examples

			6!=1*2*3*4*5*6=720 -> '1011010000' where '110'=6 is contained:
'..110.....', therefore 6 is a term.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[80],SequenceCount[IntegerDigits[#!,2],IntegerDigits[#,2]]>0&] (* Harvey P. Dale, May 16 2025 *)
Showing 1-3 of 3 results.