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

A084558 a(0) = 0; for n >= 1: a(n) = largest m such that n >= m!.

Original entry on oeis.org

0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5
Offset: 0

Views

Author

Antti Karttunen, Jun 23 2003

Keywords

Comments

For n >= 1, a(n) = the number of significant digits in n's factorial base representation (A007623).
After zero, which occurs once, each n occurs A001563(n) times.
Number of iterations (...(f_4(f_3(f_2(n))))...) such that the result is < 1, where f_j(x):=x/j. - Hieronymus Fischer, Apr 30 2012
For n > 0: a(n) = length of row n in table A108731. - Reinhard Zumkeller, Jan 05 2014

Examples

			a(4) = 2 because 2! <= 4 < 3!.
		

References

  • F. Smarandache, "f-Inferior and f-Superior Functions - Generalization of Floor Functions", Arizona State University, Special Collections.

Crossrefs

Programs

  • Haskell
    a084558 n = a090529 (n + 1) - 1  -- Reinhard Zumkeller, Jan 05 2014
    
  • Maple
    0, seq(m$(m*m!),m=1..5); # Robert Israel, Apr 27 2015
  • Mathematica
    Table[m = 1; While[m! <= n, m++]; m - 1, {n, 0, 104}] (* Jayanta Basu, May 24 2013 *)
    Table[Floor[Last[Reduce[x! == n && x > 0, x]]], {n, 120}] (* Eric W. Weisstein, Sep 13 2024 *)
  • PARI
    a(n)={my(m=0);while(n\=m++,);m-1} \\ R. J. Cano, Apr 09 2018
    
  • Python
    def A084558(n):
      i=1
      while n: i+=1; n//=i
      return(i-1)
    print(list(map(A084558,range(101)))) # Natalia L. Skirrow, May 28 2023

Formula

From Hieronymus Fischer, Apr 30 2012: (Start)
a(n!) = a((n-1)!)+1, for n>1.
G.f.: 1/(1-x)*Sum_{k>=1} x^(k!).
The explicit first terms of the g.f. are: (x+x^2+x^6+x^24+x^120+x^720...)/(1-x).
(End)
Other identities:
For all n >= 0, a(n) = A090529(n+1) - 1. - Reinhard Zumkeller, Jan 05 2014
For all n >= 1, a(n) = A060130(n) + A257510(n). - Antti Karttunen, Apr 27 2015
a(n) ~ log(n^2/(2*Pi)) / (2*LambertW(log(n^2/(2*Pi))/(2*exp(1)))) - 1/2. - Vaclav Kotesovec, Aug 22 2025

Extensions

Name clarified by Antti Karttunen, Apr 27 2015

A084556 n occurs n! times.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2003

Keywords

Comments

Also minimum i such that A007489(i) >= n.
For n>=1, a(n) gives the length of the n-th permutation in the sequences like A030298 & A030496.

Crossrefs

First differences of A084555. Used to compute A084557. Differs from A084506 first time at the 130th term, where A084506(130) = 6, while A084556(130) = 5. Cf. also A002024, A072643, A072649, A090529.

Programs

  • Mathematica
    Flatten[ Table[#, {#!}] & /@ Range[0, 5]]

A083677 Define f(n, k) to be the concatenation of the first n primes, with n-1 k's inserted between the primes. Then a(n) is the smallest k >= 0 such that f(n, k) is prime, or -1 if no such prime exists.

Original entry on oeis.org

0, 2, -1, 1, 4, 10, 38, 20, 0, -1, 163, 46, 8, 53, 0, -1, 74, 5, 8, 5, 180, 4, 280, 191, 0, 337, 191, -1, 105, 88, 19, 28, 111, -1, 525, 13, 24, 102, 159, -1, 288, 142, 31, 743, 81, -1, 183, 202, 100, 96, 380, -1, 1227, 5, 113, 123, 20, 23, 0, 48, 148, 438, 52, 144, 128, 297, 206
Offset: 1

Views

Author

Farideh Firoozbakht, Jun 15 2003

Keywords

Comments

a(3) = -1 because f(3, k) is always a multiple of 5. For any n such that n = 1 (mod 3) and A007504(n) = 0 (mod 3), a(n) = -1 because f(n, k) is always a multiple of 3. It is my conjecture that for all other n, -1 < a(n) < n*p(n). I've checked for all n < 270.

Examples

			a(4) = 1 because 2030507 is composite and 2131517 is prime.
		

Crossrefs

A082549 gives the n such that a(n) = 0. A083684 gives the n such that a(n)=-1.

Programs

  • Mathematica
    fpkQ[k_, n_] := PrimeQ[ FromDigits[ Flatten[ IntegerDigits /@ Insert[ Table[ Prime[i], {i, k}], n, Table[{i}, {i, 2, k}]]]]]; a[1] = 0; a[3] = a[10] = a[16] = a[28] = a[34] = a[40] = a[46] = a[52] = a[70] = a[76] = a[82] = a[88] = a[97] = -1; a[n_] := Block[{k = 0}, While[ fpkQ[n, k] != True, k++ ]; k]; Table[ a[n], {n, 70}] (* Robert G. Wilson v, Dec 11 2004 *)

Extensions

Edited and extended by Robert G. Wilson v, Dec 11 2004

A209280 First difference of A050289 = numbers whose digits are a permutation of (1,...,9).

Original entry on oeis.org

9, 81, 18, 81, 9, 702, 9, 171, 27, 72, 18, 693, 18, 72, 27, 171, 9, 702, 9, 81, 18, 81, 9, 5913, 9, 81, 18, 81, 9, 1602, 9, 261, 36, 63, 27, 594, 18, 162, 36, 162, 18, 603, 9, 171, 27, 72, 18, 5814, 9, 171, 27, 72, 18, 603, 9, 261, 36, 63, 27, 1584, 27, 63, 36, 261, 9
Offset: 1

Views

Author

M. F. Hasler, Jan 12 2013

Keywords

Comments

This sequence is the natural extension of A107346 (and others, see below) from 5!-1 to 9!-1 terms, which is the natural (since maximal) length, given that OEIS sequence data are stored as decimal numbers. On the other hand, it is quite different from A219664 in many aspects, not only for the reason that the other sequence is infinite and therefore differs from this one in all terms beyond n = 9!-1.
The sequence is finite, with 9!-1 terms, and symmetric: a(n)=a(9!-n).
All terms are multiples of 9, cf. formula.
The subsequence of the first n!-1 terms (n=2,...,9) yields the first differences of the sequence of numbers whose digits are a permutation of (1,...,n):
The first 8!-1 terms yield the first differences of A178478: numbers whose digits are a permutation of 12345678.
The first 7!-1 terms yield the first differences of A178477: numbers whose digits are a permutation of 1234567.
The first 6!-1 terms yield the first differences of A178476: numbers whose digits are a permutation of 123456.
The first 5!-1 terms yield A107346, the first differences of A178475: numbers whose digits are a permutation of 12345.

Examples

			The same initial terms are obtained for the permutations of any set of the form {1,...,m}, e.g., {1,2,3} or {1,...,9}: In the first case we have P = (123,132,213,231,312,321) and P(4)-P(3) = 231 - 213 = 18 = a(3), and in the latter case P(4)-P(3) = 123456897 - 123456879 = 18, again. - _M. F. Hasler_, Jan 12 2013
		

Crossrefs

Programs

  • Mathematica
    Take[Differences[Sort[FromDigits/@Permutations[Range[9]]]],70] (* Harvey P. Dale, Mar 31 2018 *)
  • PARI
    A209280_list(N=5)={my(v=vector(N,i,10^(N-i))~); v=vecsort(vector(N!,k,numtoperm(N,k)*v)); vecextract(v,"^1")-vecextract(v,"^-1")} \\ return the N!-1 first terms as a vector
    
  • PARI
    A209280(n)={if(a209280=='a209280 || #a209280A209280_list(A090529(n+1)));a209280[n]}

Formula

a(n) = A219664(n) = 9*A217626(n) (for n < 9!). - M. F. Hasler, Jan 12 2013
a(n) = a(m!-n) for any m < 10 such that n < m!.

A136432 a(n)! is the smallest factorial bigger than n^n.

Original entry on oeis.org

2, 2, 3, 5, 6, 7, 9, 10, 11, 12, 14, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 84, 85, 86, 87
Offset: 0

Views

Author

Ben Paul Thurston, Apr 01 2008

Keywords

Examples

			a(13) = 17 because 17! is the smallest factorial bigger than 13^13.
		

Programs

  • Mathematica
    s = {2}; For[n = 1, n <= 1000, n++, For[k = Max[s], True, k++, If[k! > n^n, s = Union[s, {k}]; Break[]]]]; s (* Alexis Olson (AlexisOlson(AT)gmail.com), Nov 14 2008 *)
    With[{ff=Table[{n,n!},{n,100}]},Transpose[Flatten[Table[Select[ff,#[[2]]>k^k&, 1],{k,90}],1]][[1]]] (* Harvey P. Dale, Mar 16 2013 *)

Formula

a(n) = A090529(n^n+1). - R. J. Mathar, Apr 06 2022

Extensions

More terms from Alexis Olson (AlexisOlson(AT)gmail.com), Nov 14 2008
a(0) prepended by Alois P. Heinz, Mar 30 2022

A300402 Smallest integer i such that TREE(i) >= n.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 0

Views

Author

Felix Fröhlich, Mar 05 2018

Keywords

Comments

The sequence grows very slowly.
A rooted tree is a tree containing one special node labeled the "root".
TREE(n) gives the largest integer k such that a sequence T(1), T(2), ..., T(k) of vertex-colored (using up to n colors) rooted trees, each one T(i) having at most i vertices, exists such that T(i) <= T(j) does not hold for any i < j <= k. - Edited by Gus Wiseman, Jul 06 2020

Examples

			TREE(1) = 1, so a(n) = 1 for n <= 1.
TREE(2) = 3, so a(n) = 2 for 2 <= n <= 3.
TREE(3) > A(A(...A(1)...)), where A(x) = 2[x+1]x is a variant of Ackermann's function, a[n]b denotes a hyperoperation and the number of nested A() functions is 187196, so a(n) = 3 for at least 4 <= n <= A^A(187196)(1).
		

Crossrefs

Labeled rooted trees are counted by A000169 and A206429.

A300403 Smallest integer i such that SSCG(i) >= n.

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Felix Fröhlich, Mar 05 2018

Keywords

Comments

The sequence grows very slowly.
A subcubic graph is a graph where each vertex has degree <= 3 (cf. Baaz et al., 2011, p. 419).
SSCG(n) gives the length of the longest sequence of simple subcubic graphs G_1, G_2, ..., G_i such that each G_i has at most i+n vertices and G_i is not a graph minor of G_j for any j > i.

Examples

			SSCG(0) = 2, so a(n) = 0 for n <= 2.
SSCG(1) = 5, so a(n) = 1 for 3 <= n <= 5.
SSCG(2) = 3*2^(3*2^95)-8 ~ 10^(3.5775*10^28), so a(n) = 2 for 6 <= n <= 3*2^(3*2^95)-8.
		

Crossrefs

A277517 Irregular triangle read by rows: T(n,k) is the maximum number of common subsequences of k distinct permutations of n items, with n>=1 and 1<=k<=n!.

Original entry on oeis.org

2, 4, 3, 8, 6, 5, 4, 4, 4, 16, 12, 10, 8, 8, 8, 7, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 32, 24, 20, 16, 16, 16, 14, 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 8, 7, 6, 6, 6, 6, 6, 6
Offset: 1

Views

Author

Cees H. Elzinga, Oct 19 2016

Keywords

Comments

The sequence can be used to normalize the number of common distinct subsequences of k full preference orderings of n items relative to its maximum attainable value. This normalized number can be used as measure of concordance.
According to the formula, the run lengths in the n-th row are the same as in the (n-1)-th row followed by n-2 ones followed by A001563(n)-(n-2). - Andrey Zabolotskiy, Nov 02 2016

Examples

			T(3,3) = 5 since the 3 distinct permutations {abc, bac, bca} have 5 subsequences in common: {a, b, c, bc, empty}.
The n-th row of the array has a length of n!.
Triangle begins:
2;
4,3;
8,6,5,4,4,4;
16,12,10,8,8,8,7,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5;
32,24,20,16,16,16,14,12,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,...
		

Crossrefs

Cf. A277855 (the maximum length of the longest common subsequence of k distinct permutations of n items).
Cf. A152072 (the maximum number of length-k common subsequences of a pair of length-n strings).
Cf. A090529 (a(n)=the smallest m such that n<=m!)

Programs

  • Mathematica
    g[k_] := Reduce[i >= 0 && i! >= k, i, Integers][[2, 2]]; T[1, 1] = 2; T[2, 1] = 4; T[2, 2] = 3; T[n_, k_] := T[n, k] = Which[1 <= k <= (n-1)!, 2 T[n-1, k], (n-1)! + 1 <= k <= (n-1)! + n - 2, 2*T[n-1, (n-1)!] - (k - (n-1)!), (n - 1)! + n - 1 <= k <= n!, n+1, True, 2^(n-g[k])*Max[0, -(-g[k-1]! + k - 1) + g[k] - 2] + g[k]*2^(n-g[k]) + 2^(n-g[k])]; Table[T[n, k], {n, 1, 5}, {k, 1, n!}] // Flatten (* Jean-François Alcover, Nov 28 2016 *)
  • PARI
    g(k) = my(i=1); while(i!Michel Marcus, Nov 27 2016

Formula

T(n,k) = 2^(n-g(k))+g(k)2^(n-g(k))+max{0,g(k)-2-(k-(g(k)-1)!-1)}2^(n-g(k)) with g(k) = min{i: i>0 and i!>=k}.
Consecutive rows of the array can be generated from T(2,1)=4 and T(2,2)=3 for n>3 by the recursion:
T(n,k) = 2*T(n-1,k) for 1<=k<=(n-1)!,
T(n,k) = 2*T(n-1,(n-1)!)-(k-(n-1)!) for (n-1)!+1<=k<=(n-1)!+n-2,
T(n,k) = n+1 for (n-1)!+n-1<=k<=n!.
Showing 1-8 of 8 results.