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 15 results. Next

A275841 Permutation of nonnegative integers: a(n) = A273663(A275837(A273670(n))).

Original entry on oeis.org

0, 2, 12, 3, 16, 1, 72, 14, 11, 13, 90, 8, 70, 6, 7, 17, 84, 9, 58, 76, 77, 15, 78, 5, 480, 53, 36, 94, 95, 10, 47, 54, 74, 75, 576, 19, 474, 45, 52, 88, 89, 4, 33, 71, 92, 93, 552, 483, 358, 449, 26, 28, 21, 82, 29, 83, 62, 73, 501, 60, 431, 86, 43, 87, 528, 579, 206, 417, 493, 496, 485, 57, 203, 497, 492, 55, 38, 91, 494, 597, 48, 50, 294, 80, 288, 24, 25, 81
Offset: 0

Views

Author

Antti Karttunen, Aug 13 2016

Keywords

Crossrefs

Inverse: A275842.

Programs

Formula

a(n) = A273663(A275837(A273670(n))).

A275842 Permutation of nonnegative integers: a(n) = A273663(A275838(A273670(n))).

Original entry on oeis.org

0, 5, 1, 3, 41, 23, 13, 14, 11, 17, 29, 8, 2, 9, 7, 21, 4, 15, 104, 35, 231, 52, 209, 285, 85, 86, 50, 127, 51, 54, 105, 431, 197, 42, 182, 172, 26, 177, 76, 125, 100, 225, 161, 62, 134, 37, 153, 30, 80, 183, 81, 341, 38, 25, 31, 75, 165, 71, 18, 119, 59, 269, 56, 141, 99, 137, 107, 111, 213, 95, 12, 43, 6, 57, 32, 33, 19, 20, 22, 129, 83, 87, 53, 55, 16, 101
Offset: 0

Views

Author

Antti Karttunen, Aug 13 2016

Keywords

Crossrefs

Inverse: A275841.

Programs

Formula

a(n) = A273663(A275838(A273670(n))).

A276012 Permutation of nonnegative integers: a(n) = A273663(A225901(A256450(n))).

Original entry on oeis.org

0, 2, 3, 1, 12, 13, 16, 17, 14, 15, 8, 10, 11, 9, 4, 6, 7, 5, 72, 73, 76, 77, 74, 75, 90, 91, 94, 95, 92, 93, 84, 85, 88, 89, 86, 87, 78, 79, 82, 83, 80, 81, 54, 56, 57, 55, 66, 67, 70, 71, 68, 69, 62, 64, 65, 63, 58, 60, 61, 59, 36, 38, 39, 37, 48, 49, 52, 53, 50, 51, 44, 46, 47, 45, 40, 42, 43, 41, 18, 20, 21, 19, 30, 31, 34, 35, 32, 33, 26, 28, 29, 27, 22, 24, 25, 23
Offset: 0

Views

Author

Antti Karttunen, Aug 16 2016

Keywords

Crossrefs

Inverse: A276011.
Cf. also A275952 & A275954 and permutations A275841 & A275842.

Programs

Formula

a(n) = A273663(A225901(A256450(n))).

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)

A273670 Numbers with at least one maximal digit in their factorial base representation.

Original entry on oeis.org

1, 3, 4, 5, 7, 9, 10, 11, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 27, 28, 29, 31, 33, 34, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 51, 52, 53, 55, 57, 58, 59, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 75, 76, 77, 79, 81, 82, 83, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105
Offset: 0

Views

Author

Antti Karttunen, May 29 2016

Keywords

Comments

Indexing starts from 0 (with a(0) = 1) to tally with the indexing used in A256450.
Numbers n for which is A260736(n) > 0.
Involution A225901 maps each term of this sequence to a unique term of A256450, and vice versa.

Crossrefs

Cf. A153880 (complement).
Cf. A273663 (a left inverse).
Cf. A260736.
Cf. also A225901, A256450.

Programs

  • Mathematica
    r = MixedRadix[Reverse@ Range[2, 12]]; Select[Range@ 105, Total@ Boole@ Map[SameQ @@ # &, Transpose@{#, Range@ Length@ #}] > 0 &@ Reverse@ IntegerDigits[#, r] &] (* Michael De Vlieger, Aug 14 2016, Version 10.2 *)
  • Python
    from sympy import factorial as f
    def a007623(n, p=2): return n if n

    0 else '0' for i in x])[::-1] return 0 if n==1 else sum([int(y[i])*f(i + 1) for i in range(len(y))]) def a260736(n): return 0 if n==0 else n%2 + a260736(a257684(n)) print([n for n in range(106) if a260736(n)>0]) # Indranil Ghosh, Jun 20 2017

Formula

a(0) = 1, and for n > 1, if A260736(1+a(n-1)) > 0, then a(n) = a(n-1) + 1, otherwise a(n-1) + 2. [In particular, if the previous term is 2k, then the next term is 2k+1, because all odd numbers are members.]
Other identities. For all n >= 0:
A273663(a(n)) = n.

A273662 Least monotonic left inverse for A256450: a(1) = 0; for n > 1, a(n) = A257680(n) + a(n-1).

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 54, 55, 55, 56, 57, 58, 58, 59, 59, 60, 61, 62, 62, 63, 64, 65, 66, 67, 68, 69, 69, 70
Offset: 1

Views

Author

Antti Karttunen, May 29 2016

Keywords

Comments

Partial sums of A257680 from term A257680(2) onward.

Crossrefs

One less than A257682.
Cf. also A273663.

Programs

  • Python
    def a007623(n, p=2): return n if n

Formula

a(1) = 0; for n > 1, a(n) = A257680(n) + a(n-1).
Other identities.
For all n >= 1, a(n) = A257682(n)-1.
For all n >= 0, a(A256450(n)) = n. [This sequence works as a left inverse of A256450.]

A273667 Permutation of nonnegative integers: a(0) = 0, a(A153880(n)) = A255411(a(n)), a(A273670(n)) = A256450(a(n)).

Original entry on oeis.org

0, 1, 4, 2, 6, 3, 18, 8, 12, 5, 24, 10, 48, 15, 16, 7, 30, 13, 56, 20, 21, 9, 36, 17, 96, 67, 60, 26, 27, 11, 72, 42, 22, 23, 120, 81, 240, 73, 66, 32, 33, 14, 87, 49, 28, 29, 144, 101, 360, 270, 88, 89, 80, 38, 90, 39, 52, 19, 107, 57, 288, 34, 76, 35, 168, 125, 416, 303, 109, 110, 99, 44, 420, 111, 108, 45, 61, 25, 112, 131, 64, 68, 327, 40
Offset: 0

Views

Author

Antti Karttunen, May 30 2016

Keywords

Crossrefs

Inverse: A273668.
Similar or related permutations: A255566, A273665.

Formula

a(0) = 0; for n >= 1: if A257680(A225901(n)) = 0 [when n is one of the terms of A153880] then a(n) = A255411(a(A266193(n))), otherwise [when n is one of the terms of A273670], a(n) = A256450(a(A273663(n))).
As a composition of other permutations:
a(n) = A255566(A273665(n)).

A275847 Permutation of natural numbers: a(0) = 0, a(A153880(n)) = A255411(a(n)), a(A273670(n)) = A256450(n).

Original entry on oeis.org

0, 1, 4, 2, 3, 5, 18, 6, 12, 7, 8, 9, 16, 10, 22, 11, 13, 14, 15, 17, 19, 20, 21, 23, 96, 24, 48, 25, 26, 27, 72, 28, 52, 29, 30, 31, 60, 32, 64, 33, 34, 35, 36, 37, 38, 39, 40, 41, 90, 42, 66, 43, 44, 45, 114, 46, 70, 47, 49, 50, 76, 51, 84, 53, 54, 55, 56, 57, 58, 59, 61, 62, 88, 63, 94, 65, 67, 68, 100, 69, 108, 71, 73, 74, 112, 75, 118, 77, 78
Offset: 0

Views

Author

Antti Karttunen, Aug 13 2016

Keywords

Crossrefs

Inverse: A275848.
Similar permutations: A273667 (a more recursed variant), A275845, A275846.

Formula

a(0) = 0; for n >= 1: if A257680(A225901(n)) = 0 [when n is one of the terms of A153880] then a(n) = A255411(a(A266193(n))), otherwise [when n is one of the terms of A273670], a(n) = A256450(A273663(n)).

A275837 Permutation of nonnegative integers: a(n) = A225901(A273667(n)).

Original entry on oeis.org

0, 1, 2, 4, 18, 5, 6, 22, 12, 3, 96, 20, 72, 17, 14, 19, 114, 13, 94, 10, 11, 23, 108, 15, 24, 79, 84, 100, 101, 21, 48, 102, 8, 9, 600, 71, 480, 49, 78, 118, 119, 16, 65, 73, 98, 99, 696, 27, 360, 594, 62, 63, 70, 112, 54, 113, 74, 7, 45, 95, 552, 116, 50, 117, 672, 603, 454, 569, 37, 40, 29, 106, 444, 41, 36, 107, 85, 97, 38, 621, 86, 82, 545, 110, 528, 59, 56, 111
Offset: 0

Views

Author

Antti Karttunen, Aug 13 2016

Keywords

Crossrefs

Inverse: A275838.
Cf. A275839 (fixed points).
Cf. also A275835, A275836.

Programs

Formula

a(n) = A225901(A273667(n)).
Other identities. For all n >= 0:
a(n) = A266193(a(A153880(n))). [Restriction to A153880 induces the same permutation.]
A275841(n) = A273663(a(A273670(n))). [While restriction to A273670 induces another permutation.]

A275838 Permutation of nonnegative integers: a(n) = A273668(A225901(n)).

Original entry on oeis.org

0, 1, 2, 9, 3, 5, 6, 57, 32, 33, 19, 20, 8, 17, 14, 23, 41, 13, 4, 15, 11, 29, 7, 21, 24, 133, 272, 47, 293, 70, 150, 263, 152, 357, 109, 110, 74, 68, 78, 163, 69, 73, 135, 545, 249, 58, 230, 220, 30, 37, 62, 225, 100, 161, 54, 127, 86, 285, 209, 85, 182, 172, 50, 51, 197, 42, 104, 231, 105, 431, 52, 35, 12, 43, 56, 99, 213, 95, 38, 25, 134, 153, 81, 341, 26, 76
Offset: 0

Views

Author

Antti Karttunen, Aug 13 2016

Keywords

Crossrefs

Inverse: A275837.
Cf. A275839 (fixed points).
Cf. also A275835, A275836.

Programs

Formula

a(n) = A273668(A225901(n)).
Other identities. For all n >= 0:
a(n) = A266193(a(A153880(n))). [Restriction to A153880 induces the same permutation.]
A275842(n) = A273663(a(A273670(n))). [While restriction to A273670 induces another permutation.]
Showing 1-10 of 15 results. Next