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-6 of 6 results.

A007843 Least positive integer k for which 2^n divides k!.

Original entry on oeis.org

1, 2, 4, 4, 6, 8, 8, 8, 10, 12, 12, 14, 16, 16, 16, 16, 18, 20, 20, 22, 24, 24, 24, 26, 28, 28, 30, 32, 32, 32, 32, 32, 34, 36, 36, 38, 40, 40, 40, 42, 44, 44, 46, 48, 48, 48, 48, 50, 52, 52, 54, 56, 56, 56, 58, 60, 60, 62, 64, 64, 64, 64, 64, 64, 66, 68, 68, 70, 72, 72, 72, 74, 76, 76, 78
Offset: 0

Views

Author

Bruce Dearden and Jerry Metzger; R. Muller

Keywords

Comments

Obtained by writing every natural number n k times where 2^k divides n but 2^(k+1) does not divide n. - Amarnath Murthy, Aug 22 2002
An interval of the form (A007814(k!)-A007814(k), A007814(k!)] contains n >= 1 iff k = a(n). - Vladimir Shevelev, Mar 19 2012
It appears than for n > 0, a(n) is divisible by 2, and that the resulting sequence a(n)/2 is A046699 (ignoring first term, this is the Meta-Fibonacci sequence for s=0). - Michel Marcus, Aug 19 2013
The last part is proved in the Kullmann & Zhao preprint, Thm. 3.16. The first statement is obvious: to get a larger power of two in k!, k > 1 must be increased by 2, else the factor is odd and doesn't increase the 2-valuation of k!. The other part also follows from the comment in A046699: "n occurs A001511(n) times", where A001511 = A007814 + 1, A007814 = the number of powers of 2 in k. - M. F. Hasler, Dec 27 2019

References

  • H. Ibstedt, Smarandache Primitive Numbers, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 216-229.

Crossrefs

Programs

  • Maple
    with(numtheory): ans := [ ]: p := ithprime(1): t0 := 1/p: for n from 0 to 50 do t0 := t0*p: t1 := 1: i := 1: while t1 mod t0 <> 0 do i := i+1: t1 := t1*i: od: ans := [ op(ans),i ]: od: ans;
    # Alternative:
    N:= 1000: # to get a(0) to a(N)
    A:= Array(0..N):
    A[0]:= 1:
    A[1]:= 2:
    B[2]:= 1:
    for k from 4 by 2 do
      B[k]:= B[k-2] + padic:-ordp(k,2);
      A[B[k-2]+1..min(N,B[k])]:= k;
      if B[k] >= N then break fi;
    od:
    seq(A[i],i=0..N); # Robert Israel, Dec 07 2015
  • Mathematica
    a[n_] := (k=0; While[Mod[++k!, 2^n] > 0]; k); Table[a[n], {n, 0, 74}] (* Jean-François Alcover, Dec 08 2011 *)
    Join[{1},Module[{nn=100,f},f=Table[{x!,x},{x,0,nn}];Table[ SelectFirst[ f,Divisible[#[[1]],2^n]&],{n,80}]][[All,2]]] (* Harvey P. Dale, Nov 20 2021 *)
  • PARI
    a(n)=if(n<0,0,s=1; while(s!%(2^n)>0,s++); s)
    
  • PARI
    a(n) = {k = 1; while (valuation(k!, 2) < n, k++); k;} \\ Michel Marcus, Aug 19 2013
    
  • PARI
    apply( A007843(n)={for(k=1,oo,(n-=valuation(k,2))>0||return(k))}, [0..99]) \\ This idea can also be used to compute most efficiently a vector a(0..N). - M. F. Hasler, Dec 27 2019
    
  • Python
    from itertools import count
    def A007843(n):
        c = 0
        for k in count(1):
            c += (~k&k-1).bit_length()
            if c >= n:
                return k # Chai Wah Wu, Jul 08 2022

Formula

a(n) = A002034(2^n). For n>1, it appears that a(n+1) = a(n)+2 if n is in A005187. - Benoit Cloitre, Sep 01 2002
G.f.: 1 + 2*(x/(1-x))*Product_{k >= 1} (1+x^(2^k-1)). - Wadim Zudilin, Dec 07 2015
a(n) = 2*A046699(n) for n > 0. - Michel Marcus and M. F. Hasler, Dec 27 2019
a(2^i + r) = 2^i + a(r+1) for 0 <= r <= 2^i-2, and a(2^i + r) = 2^(i+1) for r = 2^i-1. - Kevin Ryde, Aug 06 2022

A007844 Least positive integer k for which 3^n divides k!.

Original entry on oeis.org

1, 3, 6, 9, 9, 12, 15, 18, 18, 21, 24, 27, 27, 27, 30, 33, 36, 36, 39, 42, 45, 45, 48, 51, 54, 54, 54, 57, 60, 63, 63, 66, 69, 72, 72, 75, 78, 81, 81, 81, 81, 84, 87, 90, 90, 93, 96, 99, 99, 102, 105, 108, 108, 108, 111, 114, 117, 117, 120, 123, 126, 126, 129, 132, 135, 135, 135
Offset: 0

Views

Author

Bruce Dearden and Jerry Metzger, R. Muller

Keywords

Comments

It appears than for n>0, a(n) is divisible by 3, and that the resulting sequence a(n)/3 is A120503 (checked up to n=1000). - Michel Marcus, Aug 19 2013. [This is true: see A007843 for the idea of the proof. - M. F. Hasler, Dec 27 2019]
Also least positive integer k for which 6^n divides k!. - Michel Marcus, Aug 20 2013

References

  • H. Ibstedt, Smarandache Primitive Numbers, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 216-229.

Crossrefs

Cf. A007843 (analog for 2), A007845 (analog for 5).
Cf. A120503 (Meta-Fibonacci, k = 3).

Programs

  • Mathematica
    Array[Block[{k = 1}, While[Mod[k!, 3^#] != 0, k++]; k] &, 67, 0] (* Michael De Vlieger, Dec 29 2019 *)
  • PARI
    a(n) = {k = 1; while (valuation(k!, 3) < n, k++); k;} \\ Michel Marcus, Aug 19 2013
    
  • PARI
    apply( A007844(n)={my(s=sumdigits(n*=2,3)\2); n-=n%3; while(s>0, s-=valuation(n+=3,3)); n+!n}, [0..99]) \\ M. F. Hasler, Dec 27 2019

Formula

a(n) = 3*A120503(n) for n > 0, cf. A007843. - M. F. Hasler, Dec 27 2019

A341682 Successive approximations up to 5^n for the 5-adic integer Sum_{k>=0} k!.

Original entry on oeis.org

0, 4, 14, 64, 314, 2814, 2814, 2814, 237189, 1018439, 1018439, 10784064, 10784064, 743205939, 1963909064, 20274455939, 142344768439, 142344768439, 142344768439, 7771739299689, 64992198284064, 446461924846564, 1876973399455939, 4261159190471564, 16182088145549689, 16182088145549689
Offset: 0

Views

Author

Jianing Song, Feb 17 2021

Keywords

Comments

a(n) == Sum_{k>=0} k! (mod 5^n). Since k! mod 5^n is eventually zero, a(n) is well-defined.
In general, for every prime p, the p-adic integer x = Sum_{k>=0} k! is well-defined. To find the approximation up to p^n (n > 0) for x, it is enough to add k! for 0 <= k <= m and then find the remainder of the sum modulo p^n, where m = (p - 1)*(n + floor(log_p((p-1)*n))). This is because p^n divides (m+1)!

Examples

			For n = 7, since 5^7 divides 30!, we have a(7) = (Sum_{k=0..29} k!) mod 5^7 = 2814.
For n = 29, since 5^29 divides 125!, we have a(29) = (Sum_{k=0..124} k!) mod 5^29 = 173465698384532268439.
		

Crossrefs

Cf. A341686 (digits of Sum_{k>=0} k!).
Successive approximations for the p-adic integer Sum_{k>=0} k!: A341680 (p=2), A341681 (p=3), this sequence (p=5), A341683 (p=7).
Cf. A007845 (least positive integer k for which 2^n divides k!).

Programs

  • PARI
    a(n) = my(p=5); if(n==0, 0, lift(sum(k=0, (p-1)*(n+logint((p-1)*n, p)), Mod(k!, p^n))))

Formula

For n > 0, a(n) = (Sum_{k=0..m} k!) mod 5^n, where m = 4*(n + floor(log_5(4*n))).

A020646 Least positive integer k for which 7^n divides k!.

Original entry on oeis.org

1, 7, 14, 21, 28, 35, 42, 49, 49, 56, 63, 70, 77, 84, 91, 98, 98, 105, 112, 119, 126, 133, 140, 147, 147, 154, 161, 168, 175, 182, 189, 196, 196, 203, 210, 217, 224, 231, 238, 245, 245, 252, 259, 266, 273, 280, 287, 294, 294, 301, 308, 315, 322, 329, 336, 343, 343, 343, 350
Offset: 0

Views

Author

Keywords

References

  • H. Ibstedt, Smarandache Primitive Numbers, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 216-229.

Crossrefs

Programs

  • Mathematica
    lpi[n_]:=Module[{k = 1, n7 = 7^n}, While[! Divisible[k!, n7], k++]; k]; Array[lpi,60,0] (* Harvey P. Dale, Jun 29 2017 *)
  • PARI
    a(n) = {k = 1; while (valuation(k!, 7) < n, k++); k;} \\ Michel Marcus, Aug 19 2013

A228297 Generalized meta-Fibonacci sequence a(n) with parameters s=0 and k=5.

Original entry on oeis.org

1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 25, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 50, 50, 51, 52, 53
Offset: 1

Views

Author

Michel Marcus, Aug 20 2013

Keywords

Comments

Each integer n appears x+1 times where x is the greatest power of 5 in the factorization of n!. - Gerald Hillier, Feb 08 2020

Crossrefs

Programs

  • Mathematica
    Array[ConstantArray[#, IntegerExponent[#, 5] + 1] &, 53] // Flatten (* Michael De Vlieger, Feb 08 2020 *)
  • PARI
    a(n)= {local(A); if(n<=5, max(0, n), A=vector(n, i, i); for(k=6, n, A[k]= A[k-A[k-1]] + A[k-1-A[k-2]] + A[k-2-A[k-3]] + A[k-3-A[k-4]] + A[k-4-A[k-5]];); A[n];);}
    (HP 49G calculator)
    « DUPDUP 5 IQUOT -
      WHILE DUP 0 OVER
        DO 5 IQUOT DUP
    ROT + SWAP DUP NOT
        UNTIL
        END DROP +
    PICK3 <
      REPEAT 1 +
      END NIP
    » Gerald Hillier, Sep 19 2017

Formula

a(n) = A007845(n)/5. - M. F. Hasler, Dec 27 2019

A082648 Consider f(m) = Sum_{k=1..m} k! (A007489) when m is very large; a(n) = n-th digit from end.

Original entry on oeis.org

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

Views

Author

Alexander Adamchuk, May 15 2003

Keywords

Comments

Apart from the first term, the same as A025016. - R. J. Mathar, Sep 17 2008
Since A007845 gives the smallest factorial having at least n trailing zeros, the first n digits read from the right are determined for m >= A007845(n) - 1. - Martin Renner, Feb 14 2021

Examples

			Sum_{k=1..30} k! = 274410818470142134209703780940313.
The last 7 digits in reverse order give us the first 7 terms of this sequence: 3,1,3,0,4,9,0.
From _Jon E. Schoenfield_, Feb 16 2021: (Start)
The table below shows the 12 least-significant digits of Sum_{k=1..m} k! converging to the first 12 terms of this sequence (in reverse order) as m increases:
.
    m  Sum_{k=1..m} k!  # corresponding digits
   --  ---------------  ----------------------
    0                0                       0
    4               33                       1
    9           409113                       2
   14      93928268313                       3
   19  ...485935180313                       4
   24  ...567844940313                       6
   29  ...395300940313                       7
   34  ...323620940313                       8
   39  ...232420940313                       9
   44  ...080420940313                      10
   49  ...920420940313                      12
  ...
   oo  ...920420940313
(End)
		

Crossrefs

Programs

  • Mathematica
    Take[Reverse[IntegerDigits[Sum[n!, {n, 1, 500}]]], 100] (* generates first 100 terms *)
Showing 1-6 of 6 results.