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-7 of 7 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

A225901 Write n in factorial base, then replace each nonzero digit d of radix k with k-d.

Original entry on oeis.org

0, 1, 4, 5, 2, 3, 18, 19, 22, 23, 20, 21, 12, 13, 16, 17, 14, 15, 6, 7, 10, 11, 8, 9, 96, 97, 100, 101, 98, 99, 114, 115, 118, 119, 116, 117, 108, 109, 112, 113, 110, 111, 102, 103, 106, 107, 104, 105, 72, 73, 76, 77, 74, 75, 90, 91, 94, 95, 92, 93, 84, 85, 88, 89, 86, 87, 78, 79, 82, 83, 80, 81, 48, 49, 52, 53, 50, 51, 66, 67, 70, 71, 68
Offset: 0

Views

Author

Paul Tek, May 20 2013

Keywords

Comments

Analogous to A004488 or A048647 for the factorial base.
A self-inverse permutation of the natural numbers.
From Antti Karttunen, Aug 16-29 2016: (Start)
Consider the following way to view a factorial base representation of nonnegative integer n. For each nonzero digit d_i present in the factorial base representation of n (where i is the radix = 2.. = one more than 1-based position from the right), we place a pebble to the level (height) d_i at the corresponding column i of the triangular diagram like below, while for any zeros the corresponding columns are left empty:
.
Level
6 o
─ ─
5 . .
─ ─ ─
4 . . .
─ ─ ─ ─
3 . . . .
─ ─ ─ ─ ─
2 . . o . .
─ ─ ─ ─ ─ ─
1 . o . . o o
─ ─ ─ ─ ─ ─ ─
Radix: 7 6 5 4 3 2
Digits: 6 1 2 0 1 1 = A007623(4491)
Instead of levels, we can observe on which "slope" each pebble (nonzero digit) is located at. Formally, the slope of nonzero digit d_i with radix i is (i - d_i). Thus in above example, both the most significant digit (6) and the least significant 1 are on slope 1 (called "maximal slope", because it contains digits that are maximal allowed in those positions), while the second 1 from the right is on slope 2 ("submaximal slope").
This involution (A225901) sends each nonzero digit at level k to the slope k (and vice versa) by flipping such a diagram by the shallow diagonal axis that originates from the bottom right corner. Thus, from above diagram we obtain:
Slope (= digit's radix - digit's value)
1
2 .
3 . .╲
4 . .╲o╲
5 . .╲.╲.╲
6 . .╲.╲o╲.╲
. .╲.╲.╲.╲o╲
o╲.╲.╲.╲.╲o╲
-----------------
1 5 3 0 2 1 = A007623(1397)
and indeed, a(4491) = 1397 and a(1397) = 4491.
Thus this permutation maps between polynomial encodings A275734 & A275735 and all the respective sequences obtained from them, where the former set of sequences are concerned with the "slopes" and the latter set with the "levels" of the factorial base representation. See the Crossrefs section.
Sequences A231716 and A275956 are closed with respect to this sequence, in other words, for all n, a(A231716(n)) is a term of A231716 and a(A275956(n)) is a term of A275956.
(End)

Examples

			a(1000) = a(1*6! + 2*5! + 1*4! + 2*3! + 2*2!) = (7-1)*6! + (6-2)*5! + (5-1)*4! + (4-2)*3! + (3-2)*2! = 4910.
a(1397) = a(1*6! + 5*5! + 3*4! + 0*3! + 2*2! + 1*1!) = (7-1)*6! + (6-5)*5! + (5-3)*4! + (3-2)*2! + (2-1)*1! = 4491.
		

Crossrefs

Cf. A275959 (fixed points), A231716, A275956.
This involution maps between the following sequences related to "levels" and "slopes" (see comments): A275806 <--> A060502, A257511 <--> A260736, A264990 <--> A275811, A275729 <--> A275728, A275948 <--> A275946, A275949 <--> A275947, A275964 <--> A275962, A059590 <--> A276091.

Programs

  • Mathematica
    b = MixedRadix[Reverse@ Range[2, 12]]; Table[FromDigits[Map[Boole[# > 0] &, #] (Reverse@ Range[2, Length@ # + 1] - #), b] &@ IntegerDigits[n, b], {n, 0, 82}] (* Version 10.2, or *)
    f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Range[# + 1] <= n &]; Most@ Rest[a][[All, 1]] /. {} -> {0}]; g[w_List] := Total[Times @@@ Transpose@ {Map[Times @@ # &, Range@ Range[0, Length@ w]], Reverse@ Append[w, 0]}]; Table[g[Map[Boole[# > 0] &, #] (Reverse@ Range[2, Length@ # + 1] - #)] &@ f@ n, {n, 0, 82}] (* Michael De Vlieger, Aug 29 2016 *)
  • PARI
    a(n)=my(s=0,d,k=2);while(n,d=n%k;n=n\k;if(d,s=s+(k-d)*(k-1)!);k=k+1);return(s)
    
  • Python
    from sympy import factorial as f
    def a(n):
        s=0
        k=2
        while(n):
            d=n%k
            n=(n//k)
            if d: s=s+(k - d)*f(k - 1)
            k+=1
        return s
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 19 2017
  • Scheme
    (define (A225901 n) (let loop ((n n) (z 0) (m 2) (f 1)) (cond ((zero? n) z) (else (loop (quotient n m) (if (zero? (modulo n m)) z (+ z (* f (- m (modulo n m))))) (+ 1 m) (* f m))))))
    ;; One implementing the first recurrence, with memoization-macro definec:
    (definec (A225901 n) (if (zero? n) n (+ (A276091 (A275736 n)) (A153880 (A225901 (A257684 n))))))
    ;; Antti Karttunen, Aug 29 2016
    

Formula

From Antti Karttunen, Aug 29 2016: (Start)
a(0) = 0; for n >= 1, a(n) = A276091(A275736(n)) + A153880(a(A257684(n))).
or, for n >= 1, a(n) = A276149(n) + a(A257687(n)).
(End)
Other identities. For n >= 0:
a(n!) = A001563(n).
a(n!-1) = A007489(n-1).
From Antti Karttunen, Aug 16 2016: (Start)
A275734(a(n)) = A275735(n) and vice versa, A275735(a(n)) = A275734(n).
A060130(a(n)) = A060130(n). [The flip preserves the number of nonzero digits.]
A153880(n) = a(A255411(a(n))) and A255411(n) = a(A153880(a(n))). [This involution conjugates between the two fundamental factorial base shifts.]
a(n) = A257684(a(A153880(n))) = A266193(a(A255411(n))). [Follows from above.]
A276011(n) = A273662(a(A273670(n))).
A276012(n) = A273663(a(A256450(n))).
(End)

A227157 Numbers k whose factorial base representation A007623(k) does not contain any nonleading zeros.

Original entry on oeis.org

1, 3, 5, 9, 11, 15, 17, 21, 23, 33, 35, 39, 41, 45, 47, 57, 59, 63, 65, 69, 71, 81, 83, 87, 89, 93, 95, 105, 107, 111, 113, 117, 119, 153, 155, 159, 161, 165, 167, 177, 179, 183, 185, 189, 191, 201, 203, 207, 209, 213, 215, 225, 227, 231, 233, 237, 239, 273
Offset: 1

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Comments

a(A003422(n)) = A007489(n).
a(A007489(n)) = (n+1)!-1 thus A007489(n) gives the number of terms less than (n+1)! in this sequence.
Equivalently, there are n! terms in the sequence with their magnitude in range n!..(n+1)!.
Also numbers k such that A304036(k) = 1 for k > 0. - Seiichi Manyama, May 06 2018

Crossrefs

The sequence gives all n for which A208575(n) is not zero. Complement of A227187. Subsets: A071156 (apart from zero), A231716, A231720.

Programs

  • Mathematica
    q[n_] := Module[{k = n, m = 2, c = 0, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[r == 0, c++]; m++]; c == 0]; Select[Range[300], q] (* Amiram Eldar, Jan 23 2024 *)

A289234 In primorial base: a(n) is obtained by replacing each nonzero digit of n with its inverse (see Comments for precise definition).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jun 28 2017

Keywords

Comments

For a number n >= 0, let d_k, ..., d_0 be the digits of n in primorial base (n = Sum_{i=0..k} d_i * A002110(i), and for i=0..k, 0 <= d_i < prime(i+1)); the digits of a(n) in primorial base, say e_k, ..., e_0, satisfy: for i=0..k:
- if d_i = 0, then e_i = 0,
- if d_i > 0, then e_i is the inverse of d_i mod prime(i+1) (in other words, 1 <= e_i < prime(i+1) and e_i * d_i = 1 mod prime(i+1)).
This sequence is a self-inverse permutation of the nonnegative numbers.
a(n) < A002110(k) iff n < A002110(k) for any n >= 0 and k >= 0.
a(n) = n iff the digits of n in primorial base, say d_k, ..., d_0, satisfy: for i=0..k: d_i = 0, 1 or prime(i+1)-1.
For k > 0: the plotting of the first A002110(k) terms can be obtained by arranging prime(k) copies of the plotting of the first A002110(k-1) terms in a prime(k) X prime(k) grid:
- one copy in the cell at position (0,0),
- one copy in any cell at position (i,j) with i*j = 1 mod prime(k) (with 0 < i < prime(k) and 0 < j < prime(k)).

Examples

			The digits of 7772 in primorial base are 3,4,0,0,1,0.
Also:
- 9 * 3 = 27 = 1 mod prime(6) = 13,
- 3 * 4 = 12 = 1 mod prime(5) = 11,
- 1 * 1 = 1 mod prime(2) = 3.
Hence, the digits of a(7772) in primorial base are 9,3,0,0,1,0,
and a(7772) = 9 * 11# + 3 * 7# + 1 * 2# = 21422.
		

Crossrefs

Programs

  • PARI
    a(n) = my (pr=1, p=2, v=0); while (n>0, my (d=n%p); if (d>0, v += pr * lift(1/Mod(d,p))); pr *= p; n \= p; p = next prime(p+1)); return (v)

Formula

a(n) = A276085(A328617(A276086(n))). - Antti Karttunen, Oct 26 2019

A231721 Partial sums of phitorials: a(n) = A001088(1)+A001088(2)+...+A001088(n).

Original entry on oeis.org

1, 2, 4, 8, 24, 56, 248, 1016, 5624, 24056, 208376, 945656, 9793016, 62877176, 487550456, 3884936696, 58243116536, 384392195576, 6255075618296, 53220543000056, 616806151581176, 6252662237392376, 130241496125238776, 1122152167228009976, 20960365589283433976
Offset: 1

Views

Author

Antti Karttunen, Nov 27 2013

Keywords

Comments

a(n) gives the index to the first term in each subrange of A231716. Specifically, for all n>=1, A231716(a(n)) = A007489(n).

Crossrefs

Cf. A001088 ("phitorials"), A231722, A231716, A007489.

Programs

  • Mathematica
    Accumulate[FoldList[Times,EulerPhi[Range[30]]]] (* Harvey P. Dale, Apr 02 2018 *)

Formula

a(n) = 1 if n=1, otherwise A001088(n)+a(n-1).
a(n) = A231722(n)+1. [Follows from the definitions]

A231722 Partial sums of A001088 starting from its second term; a(1)=0, a(n) = A001088(2)+...+A001088(n).

Original entry on oeis.org

0, 1, 3, 7, 23, 55, 247, 1015, 5623, 24055, 208375, 945655, 9793015, 62877175, 487550455, 3884936695, 58243116535, 384392195575, 6255075618295, 53220543000055, 616806151581175, 6252662237392375, 130241496125238775, 1122152167228009975, 20960365589283433975
Offset: 1

Views

Author

Antti Karttunen, Nov 27 2013

Keywords

Comments

a(n+1) gives the index to the last term in each row of A231716. Specifically, for all n>=1, A231716(a(n+1)) = A033312(n+1).
a(n) = natural number which is written as the n-th repunit in "totient phi number system": 0, 1, 10, 11, 100, 101, 110, 111, 200, 201, 210, 211, 300, 301, 310, 311, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 1200, ..., and so on. Note how the 1st, the 3rd, the 7th and 23rd terms of this list are 1, 11, 111, and 1111.
In this number system the i-th digit from right (the least significant digit = digit_0) may contain integers in range 0..A000010(i+3)-1, and the value of the number is obtained as sum_{i=0..} digit_i * A001088(i+2).

Crossrefs

One less than A231721.
Cf. A000010 (Euler's totient function phi), A001088 (its partial products, "phitorials"), A231716, A033312.

Programs

  • Maple
    with(numtheory): A231722:=n->add(product(phi(k), k=1..i), i=2..n): seq(A231722(n), n=1..20); # Wesley Ivan Hurt, Aug 09 2014
  • Mathematica
    Table[Sum[Product[EulerPhi[k], {k, i}], {i, 2, n}], {n, 20}] (* Wesley Ivan Hurt, Aug 09 2014 *)
  • PARI
    a(n) = sum(i=2, n, prod(k=1, i, eulerphi(k))); \\ Michel Marcus, Aug 09 2014
  • Scheme
    (define (A231722 n) (- (A231721 n) 1))
    

Formula

a(n) = A231721(n)-1. [The terms are one less than the partial sums of "phitorials", A001088, cumulatively summed from their first term]

A231715 For n with a unique factorial base representation n = du*u! + ... + d2*2! + d1*1! (each di in range 0..i, cf. A007623), a(n) = Product_{i=1..u} (gcd(d_i,i+1) mod i+1), where u is given by A084558(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 12 2013

Keywords

Examples

			For n=13, with factorial base representation '201' (= A007623(13), 2*3! + 0*2! + 1*1! = 13) we have, starting from the least significant digit, (gcd(1,2) mod 2)*(gcd(0,3) mod 3)*(gcd(2,4) mod 4) = (1 mod 2)*(3 mod 3)*(2 mod 4) = 1*0*2 = 0, thus a(13)=0.
For n=17, with factorial base representation '221' (= A007623(17), 2*3! + 2*2! + 1*1! = 17) we have, starting from the least significant digit, (gcd(1,2) mod 2)*(gcd(2,3) mod 3)*(gcd(2,4) mod 4) = (1 mod 2)*(1 mod 3)*(2 mod 4) = 1*1*2 = 2, thus a(17)=2.
		

Crossrefs

Cf. A231716 (positions of ones), A227157 (the positions of nonzero terms), A007623.
Each a(n) <= A208575(n).

Programs

  • Scheme
    (define (A231715 n) (let loop ((n n) (i 2) (p 1)) (cond ((zero? n) p) (else (loop (floor->exact (/ n i)) (+ i 1) (* p (modulo (gcd (modulo n i) i) i)))))))
Showing 1-7 of 7 results.