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 10 results.

A276011 Permutation of nonnegative integers: a(n) = A273662(A225901(A273670(n))).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 16 2016

Keywords

Crossrefs

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

Programs

Formula

a(n) = A273662(A225901(A273670(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)

A256450 Numbers that have at least one 1-digit in their factorial base representation (A007623).

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 65, 67, 68, 69, 71, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 89, 91, 92, 93, 95, 97, 98, 99, 101
Offset: 0

Views

Author

Antti Karttunen, Apr 27 2015

Keywords

Comments

Numbers n for which A257679(n) = 1, i.e., numbers n such that the least nonzero digit in their factorial base representation (A007623) is 1.
Involution A225901 maps each term of this sequence to a unique term of A273670, and vice versa.
Starting offset is zero (with a(0) = 1) because it is the most natural offset for the given fast recurrence.

Crossrefs

Complement of A255411.
Cf. A257680 (characteristic function), A273662 (left inverse).
First row of A257503, first column of A257505.
Subsequences: A059590 (apart from its zero-term), A255341, A255342, A255343, A257262, A257263, A258198, A258199.
Cf. also A227187 (numbers with at least one nonleading zero) and A273670, A225901.

Programs

  • Mathematica
    Select[Range@ 101, MemberQ[IntegerDigits[#, MixedRadix[Reverse@ Range@ 12]], 1] &] (* Michael De Vlieger, May 30 2016, Version 10.2 *)
    r = MixedRadix[Reverse@ Range[2, 12]]; Select[Range@ 101, Min[IntegerDigits[#, r] /. 0 -> Nothing] == 1 &]  (* Michael De Vlieger, Aug 14 2016, Version 10.2 *)
  • Python
    def A(n, p=2): return n if n

    =1]) # Indranil Ghosh, Jun 19 2017

Formula

a(0) = 1, and for n >= 1, if A257511(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, A273662(a(n)) = n. [A273662 works as the left inverse for this sequence.]
From Antti Karttunen, May 26 2015: (Start)
Alternative recurrence for the same sequence:
Set k = A258198(n), d = n - A258199(n) and f = A000142(k+1) = (k+1)! If d < f then b(n) = f+d, otherwise b(n) = ((2+floor((d-f)/A258199(n))) * f) + b((d-f) mod A258199(n)). For offset=1 sequence, define a(n) = b(n-1).
(End)

Extensions

Starting offset changed from 1 to 0 by Antti Karttunen, May 30 2016

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 30 2016

Keywords

Crossrefs

Left inverse of A273670.
Cf. also A273662.

Programs

  • Python
    from sympy import factorial as f
    def a007623(n, p=2): return n if n

Formula

a(1) = 0; for n > 1, a(n) = A257680(A225901(n)) + a(n-1).
Other identities.
For all n >= 0, a(A273670(n)) = n.

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

Original entry on oeis.org

0, 1, 3, 5, 2, 9, 4, 15, 7, 21, 11, 29, 8, 17, 41, 13, 14, 23, 6, 57, 19, 20, 32, 33, 10, 77, 27, 28, 44, 45, 16, 101, 39, 40, 61, 63, 22, 129, 53, 55, 83, 87, 31, 165, 71, 75, 107, 111, 12, 43, 213, 95, 56, 99, 137, 141, 18, 59, 269, 119, 26, 76, 125, 177, 80, 183, 38, 25, 81, 341, 134, 153, 30, 37, 100, 161, 62, 225, 104, 231, 52, 35
Offset: 0

Views

Author

Antti Karttunen, May 30 2016

Keywords

Crossrefs

Inverse: A273667.
Similar or related permutations: A255565, A273666.

Formula

a(0) = 0; for n >= 1: if A257680(n) = 0 [when n is one of the terms of A255411] then a(n) = A153880(a(A257684(n))), otherwise [when n is one of the terms of A256450], a(n) = A273670(a(A273662(n))).
As a composition of other permutations:
a(n) = A273666(A255565(n)).

A257682 Partial sums of A257680: a(0) = 0; for n >= 1, a(n) = A257680(n) + a(n-1).

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 14, 15, 16, 17, 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, 42, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 55, 56, 56, 57, 58, 59, 59, 60, 60, 61
Offset: 0

Views

Author

Antti Karttunen, May 04 2015

Keywords

Crossrefs

One more than A273662.

Formula

a(0) = 0; for n >= 1, a(n) = A257680(n) + a(n-1).
Other identities:
a(n) = A273662(n)+1.

Extensions

Description edited because of the changed starting offset of A256450 - Antti Karttunen, May 30 2016

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

Original entry on oeis.org

0, 1, 3, 4, 2, 5, 7, 9, 10, 11, 13, 15, 8, 16, 17, 18, 12, 19, 6, 20, 21, 22, 14, 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, 26, 58, 59, 61, 32, 63, 64, 65, 66, 67, 68, 69, 36, 70, 71, 73, 38, 75, 50, 76, 77, 79, 56, 81, 30, 82, 83, 85, 60, 87, 88, 89, 90, 91, 92, 93, 62, 94, 95, 96, 72, 97, 48
Offset: 0

Views

Author

Antti Karttunen, Aug 13 2016

Keywords

Crossrefs

Inverse: A275847.
Similar permutations: A273668 (a more recursed variant), A275845, A275846.

Formula

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

A255565 a(0) = 0; for n >= 1: if n = A255411(k) for some k, then a(n) = 2*a(k), otherwise, n = A256450(h) for some h, and a(n) = 1 + 2*a(h).

Original entry on oeis.org

0, 1, 3, 7, 2, 15, 5, 31, 11, 63, 23, 127, 6, 47, 255, 13, 14, 95, 4, 511, 27, 29, 30, 191, 9, 1023, 55, 59, 61, 383, 19, 2047, 111, 119, 123, 767, 39, 4095, 223, 239, 247, 1535, 79, 8191, 447, 479, 495, 3071, 10, 159, 16383, 895, 62, 959, 991, 6143, 21, 319, 32767, 1791, 22, 125, 1919, 1983, 126, 12287, 46, 43, 639, 65535, 254, 3583, 12
Offset: 0

Views

Author

Antti Karttunen, May 05 2015

Keywords

Comments

Because all terms of A255411 are even it means that even terms can only occur in even positions (together with some odd terms, for each one of which there is a separate infinite cycle), while terms in odd positions are all odd.

Crossrefs

Inverse: A255566.
Cf. also arrays A257503, A257505.
Related or similar permutations: A273665, A273668.

Formula

a(0) = 0; for n >= 1: if A257680(n) = 0 [i.e., n is one of the terms of A255411], then a(n) = 2*a(A257685(n)), otherwise [when n is one of the terms of A256450], a(n) = 1 + 2*a(A273662(n)).
Other identities:
For all n >= 1, A001511(a(n)) = A257679(n).
For all n >= 1, a(A001563(n)) = A000079(n-1) = 2^(n-1).
For all n >= 1, a(A000142(n)) = A083318(n-1).

Extensions

Formula changed because of the changed starting offset of A256450 - Antti Karttunen, May 30 2016

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

Original entry on oeis.org

0, 1, 3, 5, 2, 9, 4, 15, 7, 21, 11, 29, 6, 17, 41, 10, 8, 23, 12, 57, 16, 13, 14, 33, 18, 77, 22, 19, 20, 45, 25, 101, 31, 27, 28, 63, 35, 129, 43, 39, 40, 87, 47, 165, 59, 53, 55, 111, 24, 65, 213, 81, 26, 71, 75, 141, 34, 89, 269, 105, 30, 37, 95, 99, 32, 183, 36, 46, 113, 341, 38, 135, 48, 42, 51, 119, 50, 125, 44, 231, 49, 64, 143, 431, 54, 52
Offset: 0

Views

Author

Antti Karttunen, Aug 13 2016

Keywords

Crossrefs

Inverse: A275845.
Similar permutations: A273668 (a more recursed variant), A275847, A275848.

Formula

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

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

Original entry on oeis.org

1, 3, 4, 2, 5, 7, 9, 10, 11, 13, 15, 6, 16, 17, 18, 8, 19, 12, 20, 21, 22, 14, 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, 24, 58, 59, 61, 26, 63, 64, 65, 66, 67, 68, 69, 30, 70, 71, 73, 32, 75, 36, 76, 77, 79, 38, 81, 48, 82, 83, 85, 50, 87, 88, 89, 90, 91, 92, 93, 54
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2016

Keywords

Crossrefs

Inverse: A276957.
For more recursed variants see: A275846, A275848 & A273668.

Programs

Formula

If A257680(n) = 0, then a(n) = A153880(A257684(n)), otherwise a(n) = A273670(A273662(n)).
Showing 1-10 of 10 results.