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-10 of 13 results. Next

A115627 Irregular triangle read by rows: T(n,k) = multiplicity of prime(k) as a divisor of n!.

Original entry on oeis.org

1, 1, 1, 3, 1, 3, 1, 1, 4, 2, 1, 4, 2, 1, 1, 7, 2, 1, 1, 7, 4, 1, 1, 8, 4, 2, 1, 8, 4, 2, 1, 1, 10, 5, 2, 1, 1, 10, 5, 2, 1, 1, 1, 11, 5, 2, 2, 1, 1, 11, 6, 3, 2, 1, 1, 15, 6, 3, 2, 1, 1, 15, 6, 3, 2, 1, 1, 1, 16, 8, 3, 2, 1, 1, 1, 16, 8, 3, 2, 1, 1, 1, 1
Offset: 2

Views

Author

Keywords

Comments

The factorization of n! is n! = 2^T(n,1)*3^T(n,2)*...*p_(pi(n))^T(n,pi(n)) where p_k = k-th prime, pi(n) = A000720(n).
Nonzero terms of A085604; T(n,k) = A085604(n,k), k = 1..A000720(n). - Reinhard Zumkeller, Nov 01 2013
For n=2, 3, 4 and 5, all terms of the n-th row are odd. Are there other such rows? - Michel Marcus, Nov 11 2018
From Gus Wiseman, May 15 2019: (Start)
Differences between successive rows are A067255, so row n is the sum of the first n row-vectors of A067255 (padded with zeros on the right so that all n row-vectors have length A000720(n)). For example, the first 10 rows of A067255 are
{}
1
0 1
2 0
0 0 1
1 1 0
0 0 0 1
3 0 0 0
0 2 0 0
1 0 1 0
with column sums (8,4,2,1), which is row 10.
(End)
For all prime p > 7, 3*p > 2*nextprime(p), so for any n > 21 there will always be a prime p dividing n! with exponent 2 and there are no further rows with all entries odd. - Charlie Neder, Jun 03 2019

Examples

			From _Gus Wiseman_, May 09 2019: (Start)
Triangle begins:
   1
   1  1
   3  1
   3  1  1
   4  2  1
   4  2  1  1
   7  2  1  1
   7  4  1  1
   8  4  2  1
   8  4  2  1  1
  10  5  2  1  1
  10  5  2  1  1  1
  11  5  2  2  1  1
  11  6  3  2  1  1
  15  6  3  2  1  1
  15  6  3  2  1  1  1
  16  8  3  2  1  1  1
  16  8  3  2  1  1  1  1
  18  8  4  2  1  1  1  1
(End)
m such that 5^m||101!: floor(log(101)/log(5)) = 2 terms. floor(101/5) = 20. floor(20/5) = 4. So m = u_1 + u_2 = 20 + 4 = 24. - _David A. Corneth_, Jun 22 2014
		

Crossrefs

Row lengths are A000720.
Row-sums are A022559.
Row-products are A135291.
Row maxima are A011371.

Programs

  • Haskell
    a115627 n k = a115627_tabf !! (n-2) !! (k-1)
    a115627_row = map a100995 . a141809_row . a000142
    a115627_tabf = map a115627_row [2..]
    -- Reinhard Zumkeller, Nov 01 2013
    
  • Maple
    A115627 := proc(n,k) local d,p; p := ithprime(k) ; n-add(d,d=convert(n,base,p)) ; %/(p-1) ; end proc: # R. J. Mathar, Oct 29 2010
  • Mathematica
    Flatten[Table[Transpose[FactorInteger[n!]][[2]], {n, 2, 20}]] (* T. D. Noe, Apr 10 2012 *)
    T[n_, k_] := Module[{p, jm}, p = Prime[k]; jm = Floor[Log[p, n]]; Sum[Floor[n/p^j], {j, 1, jm}]]; Table[Table[T[n, k], {k, 1, PrimePi[n]}], {n, 2, 20}] // Flatten (* Jean-François Alcover, Feb 23 2015 *)
  • PARI
    a(n)=my(i=2);while(n-primepi(i)>1,n-=primepi(i);i++);p=prime(n-1);sum(j=1,log(i)\log(p),i\=p) \\ David A. Corneth, Jun 21 2014

Formula

T(n,k) = Sum_{i=1..inf} floor(n/(p_k)^i). (Although stated as an infinite sum, only finitely many terms are nonzero.)
T(n,k) = Sum_{i=1..floor(log(n)/log(p_k))} floor(u_i) where u_0 = n and u_(i+1) = floor((u_i)/p_k). - David A. Corneth, Jun 22 2014

A053828 Sum of digits of (n written in base 7).

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

Also the fixed point of the morphism 0->{0,1,2,3,4,5,6}, 1->{1,2,3,4,5,6,7}, 2->{2,3,4,5,6,7,8}, etc. - Robert G. Wilson v, Jul 27 2006

Examples

			a(20) = 2 + 6 = 8 because 20 = 26_7.
From _Omar E. Pol_, Feb 21 2010: (Start)
It appears that this can be written as a triangle (see the conjecture in the entry A000120):
0,
1,2,3,4,5,6,
1,2,3,4,5,6,7,2,3,4,5,6,7,8,3,4,5,6,7,8,9,4,5,6,7,8,9,10,5,6,7,8,9,10,11,6,7,8,9,10,11,12,
1,2,3,4,5,6,7,2,3,4,5,6,7,8,3,4,5,6,7,8,9,4,5,6,7,8,9,10,5,6,7,8,9,10,11,6,7,8,9,10,11,12,7,8,9,10,11,...
where the rows converge to A173527. (End)
		

Crossrefs

Programs

  • Magma
    [&+Intseq(n, 7): n in [0..100]]; // Vincenzo Librandi, Jan 03 2020
  • Mathematica
    Table[Plus @@ IntegerDigits[n, 7], {n, 0, 100}] (* or *)
    Nest[ Flatten[ #1 /. a_Integer -> Table[a + i, {i, 0, 6}]] &, {0}, 4] (* Robert G. Wilson v, Jul 27 2006 *)
  • PARI
    a(n)=if(n<1,0,if(n%7,a(n-1)+1,a(n/7)))
    
  • PARI
    a(n) = my(d=digits(n, 7)); vecsum(d); \\ Michel Marcus, Jan 07 2017
    

Formula

From Benoit Cloitre, Dec 19 2002: (Start)
a(0) = 0, a(7n+i) = a(n) + i for 0 <= i <= 6.
a(n) = n - 6*(Sum_{k>0} floor(n/7^k)) = n - 6*A054896(n). (End)
a(n) = A138530(n,7) for n > 6. - Reinhard Zumkeller, Mar 26 2008
a(n) = Sum_{k>=0} A031007(n,k). - Philippe Deléham, Oct 21 2011
a(0) = 0; a(n) = a(n - 7^floor(log_7(n))) + 1. - Ilya Gutkovskiy, Aug 24 2019
Sum_{n>=1} a(n)/(n*(n+1)) = 7*log(7)/6 (Shallit, 1984). - Amiram Eldar, Jun 03 2021

A090622 Square array read by antidiagonals of highest power of k dividing n! (with n,k>1).

Original entry on oeis.org

1, 0, 1, 0, 1, 3, 0, 0, 1, 3, 0, 0, 1, 1, 4, 0, 1, 0, 1, 2, 4, 0, 0, 1, 1, 2, 2, 7, 0, 0, 0, 1, 1, 2, 2, 7, 0, 0, 1, 0, 2, 1, 3, 4, 8, 0, 0, 0, 1, 0, 2, 1, 3, 4, 8, 0, 0, 0, 0, 1, 1, 2, 1, 4, 4, 10, 0, 0, 0, 1, 1, 1, 1, 4, 2, 4, 5, 10, 0, 0, 1, 0, 1, 1, 2, 1, 4, 2, 5, 5, 11, 0, 0, 0, 1, 0, 1, 1, 2, 1, 4, 2, 5, 5, 11
Offset: 2

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			Square array starts:
1, 0, 0, 0, 0, 0, 0, ...
1, 1, 0, 0, 1, 0, 0, ...
3, 1, 1, 0, 1, 0, 1, ...
3, 1, 1, 1, 1, 0, 1, ...
4, 2, 2, 1, 2, 0, 1, ...
4, 2, 2, 1, 2, 1, 1, ...
7, 2, 3, 1, 2, 1, 2, ...
		

Crossrefs

Programs

  • Maple
    f:= proc(n, p) local c, k; c, k:= 0, p;
           while n>=k do c:= c+iquo(n, k); k:= k*p od; c
        end:
    T:= (n, k)-> min(seq(iquo(f(n, i[1]), i[2]), i=ifactors(k)[2])):
    seq(seq(T(n, 2+d-n), n=2..d), d=2..20);  # Alois P. Heinz, Oct 04 2012
  • Mathematica
    f[n_, p_] := Module[{c = 0, k = p}, While[n >= k , c = c + Quotient[n, k]; k = k*p ]; c ]; t[n_, k_] := Min[ Table[ Quotient[f[n, i[[1]]], i[[2]]], {i, FactorInteger[k]}]]; Table[ Table[t[n, 2 + d - n], {n, 2, d}], {d, 2, 20}] // Flatten (* Jean-François Alcover, Oct 03 2013, translated from Alois P. Heinz's Maple program *)

Formula

For k=p prime: T(n,p) = [n/p] + [n/p^2] + [n/p^3] + .... For k = p^m a prime power: T(n,p^m) = [T(n,p)/m]. For k = b*c with b and c coprime: T(n,a*b) = min(T(n,a), T(n,b)). T(n,k) is close to, but below, n/A090624(k).

A090616 Exponent of highest power of 4 dividing n!.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 7, 7, 8, 8, 9, 9, 9, 9, 11, 11, 11, 11, 12, 12, 13, 13, 15, 15, 16, 16, 17, 17, 17, 17, 19, 19, 19, 19, 20, 20, 21, 21, 23, 23, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 28, 28, 31, 31, 32, 32, 33, 33, 33, 33, 35, 35, 35, 35, 36
Offset: 0

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			a(6)=2 since 6! = 720 = 4^2 * 45.
		

Crossrefs

Programs

  • Mathematica
    IntegerExponent[Range[0, 100]!, 4] (* Vincenzo Librandi, Mar 10 2013 *)
  • PARI
    a(n) = valuation( n!, 4 ); /* Joerg Arndt, Mar 10 2013 */
    (Python 3.10+)
    def A090616(n): return (n-n.bit_count())>>1 # Chai Wah Wu, Jul 09 2022

Formula

a(n) = A090622(n, 4) = floor(A011371(n)/2) = floor((floor(n/2) + floor(n/4) + floor(n/8) + floor(n/16) + ...)/2).
a(n) = A235127(n!). - R. J. Mathar, Jul 08 2021

A090617 Exponent of highest power of 8 dividing n!.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 19, 19, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24
Offset: 0

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			a(8)=2 since 8! = 40320 = 8^2 * 630.
		

Crossrefs

Programs

  • Mathematica
    Table[IntegerExponent[n!,8],{n,0,80}] (* Harvey P. Dale, Mar 21 2013 *)
  • PARI
    a(n) = valuation(n!, 8); \\ Michel Marcus, Jul 10 2022

Formula

a(n) = A090622(n, 8) = floor(A011371(n)/3) = floor((floor(n/2) + floor(n/4) + floor(n/8) + floor(n/16) + ...)/3).
a(n) = A244413(n!) . - R. J. Mathar, Jul 08 2021

A090618 Highest power of 9 dividing n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 20, 20, 20, 20
Offset: 0

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			a(9)=2 since 9!=362880=9^2*4480.
		

Crossrefs

Programs

  • Mathematica
    IntegerExponent[Range[0,90]!,9] (* Harvey P. Dale, Jun 07 2016 *)

Formula

a(n) =A090622(n, 9) =[A054861(n)/2] =[([n/3]+[n/9]+[n/27]+[n/81]+...)/2].

A090619 Highest power of 12 dividing n!.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 2, 2, 2, 3, 4, 4, 5, 5, 5, 5, 6, 6, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 15, 17, 17, 17, 17, 18, 18, 19, 19, 19, 20, 21, 21, 22, 22, 22, 23, 23, 23, 25, 25, 26, 26, 27, 27, 28, 28, 28, 28, 30, 30, 31, 31, 31, 32, 32, 32, 34, 34, 34, 35, 35
Offset: 0

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Comments

Most sequences of the form "highest power of k dividing n!" essentially depend on one of the primes or prime powers dividing k. But in this case, the sequences with k=3 (A054861) and k=4 (A090616) are both close to n/2 and vary in which one is lower for different values of n.
a(2^n) = A090616(2^n) and a(3^n-1) = A090616(3^n-1) while a(2^n-1) = A054861(2^n-1) and a(3^n) = A054861(3^n). - Robert Israel, Mar 25 2018

Examples

			a(6)=2 since 6!=720=12^2*5.
		

Crossrefs

Programs

  • Maple
    f2:= n -> n - convert(convert(n,base,2),`+`):
    f3:= n -> (n - convert(convert(n,base,3),`+`))/2:
    f:= n -> min(f3(n), floor(f2(n)/2)):
    f(0):= 0:
    map(f, [$0..100]); # Robert Israel, Mar 23 2018
  • Mathematica
    Table[IntegerExponent[n!, 12], {n, 0, 100}] (* Jean-François Alcover, Mar 26 2018 *)
  • PARI
    a(n) = valuation(n!, 12); \\ Michel Marcus, Mar 24 2018

Formula

a(n) =A090622(n, 12) =min(A054861(n), A090616(n)). Close to n/2, indeed for n>3: n/2-log3(n+1) <= a(n) < n/2.

A090623 Triangle of T(n,k) = [n/k] + [n/k^2] + [n/k^3] + [n/k^4] + ... for n, k > 1.

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 4, 2, 1, 1, 1, 4, 2, 1, 1, 1, 1, 7, 2, 2, 1, 1, 1, 1, 7, 4, 2, 1, 1, 1, 1, 1, 8, 4, 2, 2, 1, 1, 1, 1, 1, 8, 4, 2, 2, 1, 1, 1, 1, 1, 1, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 11, 5, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 11, 6, 3, 3, 2, 2, 1, 1, 1
Offset: 2

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			Rows start:
  1;
  1,1;
  3,1,1;
  3,1,1,1;
  4,2,1,1,1;
  4,2,1,1,1,1;
  7,2,2,1,1,1,1;
  7,4,2,1,1,1,1,1;
  8,4,2,2,1,1,1,1,1;
  ...
		

Crossrefs

Programs

  • Mathematica
    A090623[n_, k_] := Quotient[n - DigitSum[n, k], k - 1];
    Table[A090623[n, k], {n, 2, 15}, {k, 2, n}] (* Paolo Xausa, Sep 02 2025 *)
  • PARI
    T(n,k) = {my(s = 0, j = 1); while(p=n\k^j, s += p; j++); s;} \\ Michel Marcus, Feb 02 2016
    
  • PARI
    T(n,k) = (n - sumdigits(n,k))/(k-1) \\ Zhuorui He, Aug 25 2025

Formula

For p prime, T(n, p) = A090622(n, p) is the number of times that p is a factor of n!.
T(n,k) = (n - A240236(n, k))/(k - 1). - Zhuorui He, Aug 25 2025

Extensions

a(41) onward corrected by Zhuorui He, Aug 25 2025

A376410 Number of integers whose arithmetic derivative (A003415) is equal to n!, the n-th factorial.

Original entry on oeis.org

0, 1, 4, 13, 40, 186, 952, 5533, 38719, 346207, 3130816, 34444968, 382437431, 4637235152
Offset: 2

Views

Author

Antti Karttunen, Nov 06 2024

Keywords

Comments

For 1! = 1, there are an infinite number of integers k for which A003415(k) = 1 (namely, all the primes), therefore the starting offset is 2.
Like with A351029, also here most of the solutions seem to be squarefree semiprimes, counted by A062311.
Terms a(12)..a(15) were obtained by summing the corresponding terms of A062311 and A377986.

Crossrefs

Programs

  • PARI
    \\ Slow program, for computing just a few terms:
    A002620(n) = ((n^2)>>2);
    A003415(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]/f[i, 1]));
    A376410(n) = { my(g=n!); sum(k=1,A002620(g),A003415(k)==g); };
    
  • PARI
    A376410(n) = AntiDeriv(n!);
    AntiDeriv(n,startvlen=1,solsfilename="") = { my(v = vector(startvlen,i,2), ip = #v, r, c=0); while(1, r = A003415vrl(v,n); if(0==r, ip--, if(r > 1, c++; if(solsfilename!="", write(solsfilename, r*factorback(v)))); ip = #v); if(0==ip, v = vector(1+#v,i,2); ip = #v; if(A003415vec(v) > n, return(c)), v[ip] = nextprime(1+v[ip]); for(i=1+ip, #v, v[i]=v[i-1]))); };
    A003415vec(tv) = { my(n=factorback(tv), s=0, m=1, spf); for(i=1,#tv,spf = tv[i]; n /= spf; s += m*n; m *= spf); (s); }; \\ Compute Arithmetic derivative from the vector of primes.
    A003415vrl(pv,lim) = { my(n=factorback(pv), x=lim-n, s=0, m=1, spf, u=n); for(i=1,#pv,spf = pv[i]; u /= spf; s += m*u; m *= spf); if(((x/s)
    				

Formula

a(n) = A099302(A000142(n)).
a(n) = Sum_{k=1..A002620(n!)} [A003415(k) = n!], where [ ] is the Iverson bracket.
a(n) = A062311(n) + A377986(n).

A090621 Exponent of highest power of 16 dividing n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19
Offset: 0

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			a(10)=2 since 10! = 3628800 = 16^2 * 14175.
		

Crossrefs

Programs

Formula

a(n) = A090622(n, 16) = floor(A011371(n)/4) = floor(A090616(n)/2) = floor((floor(n/2) + floor(n/4) + floor(n/8) + floor(n/16) + ...)/4). Almost n/4.
Showing 1-10 of 13 results. Next