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

A211363 Permutation corresponding to the inversion sets interpreted as binary numbers (A211362) ordered by value.

Original entry on oeis.org

0, 1, 3, 2, 4, 5, 9, 11, 8, 10, 16, 17, 6, 7, 13, 15, 12, 14, 18, 19, 21, 20, 22, 23, 33, 35, 41, 39, 45, 47, 32, 34, 40, 38, 44, 46, 64, 65, 70, 71, 30, 31, 37, 36, 42, 43, 61, 63, 67, 69, 60, 62, 66, 68, 90, 91, 93, 92, 94, 95, 24, 25, 27
Offset: 0

Views

Author

Tilman Piesk, Jun 03 2012

Keywords

Comments

A211362 lists the binary interpretations of inversion sets ordered by the reverse colexicographic order of permutations (A055089). This permutation orders them by value. Its inverse begins: 0, 1, 3, 2, 4, 5, 12, 13, 8, 6, 9, 7, 16, 14, 17, 15, 10, 11, 18, 19, 21, 20, 22, 23, ...

Examples

			These are the first 24 finite permutations. The inversion sets interpreted as binary numbers on the right form the sequence A211362, which is not monotonic:
No.  permutation   inversion set  A211362
00     1 2 3 4     0  0 0  0 0 0     0
01     2 1 3 4     1  0 0  0 0 0     1
02     1 3 2 4     0  0 1  0 0 0     4
03     3 1 2 4     1  1 0  0 0 0     3
04     2 3 1 4     0  1 1  0 0 0     6
05     3 2 1 4     1  1 1  0 0 0     7
06     1 2 4 3     0  0 0  0 0 1    32
07     2 1 4 3     1  0 0  0 0 1    33
08     1 4 2 3     0  0 1  0 1 0    20
09     4 1 2 3     1  1 0  1 0 0    11
10     2 4 1 3     0  1 1  0 1 0    22
11     4 2 1 3     1  1 1  1 0 0    15
12     1 3 4 2     0  0 0  0 1 1    48
13     3 1 4 2     1  0 0  1 0 1    41
14     1 4 3 2     0  0 1  0 1 1    52
15     4 1 3 2     1  1 0  1 0 1    43
16     3 4 1 2     0  1 1  1 1 0    30
17     4 3 1 2     1  1 1  1 1 0    31
18     2 3 4 1     0  0 0  1 1 1    56
19     3 2 4 1     1  0 0  1 1 1    57
20     2 4 3 1     0  0 1  1 1 1    60
21     4 2 3 1     1  1 0  1 1 1    59
22     3 4 2 1     0  1 1  1 1 1    62
23     4 3 2 1     1  1 1  1 1 1    63
This is the same list ordered by the inversion sets, so the right column is monotonic now. The left column is the beginning of the permutation p, i.e., this sequence:
No.  permutation   inversion set  A211362*p
00     1 2 3 4     0  0 0  0 0 0     0
01     2 1 3 4     1  0 0  0 0 0     1
03     3 1 2 4     1  1 0  0 0 0     3
02     1 3 2 4     0  0 1  0 0 0     4
04     2 3 1 4     0  1 1  0 0 0     6
05     3 2 1 4     1  1 1  0 0 0     7
09     4 1 2 3     1  1 0  1 0 0    11
11     4 2 1 3     1  1 1  1 0 0    15
08     1 4 2 3     0  0 1  0 1 0    20
10     2 4 1 3     0  1 1  0 1 0    22
16     3 4 1 2     0  1 1  1 1 0    30
17     4 3 1 2     1  1 1  1 1 0    31
06     1 2 4 3     0  0 0  0 0 1    32
07     2 1 4 3     1  0 0  0 0 1    33
13     3 1 4 2     1  0 0  1 0 1    41
15     4 1 3 2     1  1 0  1 0 1    43
12     1 3 4 2     0  0 0  0 1 1    48
14     1 4 3 2     0  0 1  0 1 1    52
18     2 3 4 1     0  0 0  1 1 1    56
19     3 2 4 1     1  0 0  1 1 1    57
21     4 2 3 1     1  1 0  1 1 1    59
20     2 4 3 1     0  0 1  1 1 1    60
22     3 4 2 1     0  1 1  1 1 1    62
23     4 3 2 1     1  1 1  1 1 1    63
		

Crossrefs

Cf. A211362.

A059590 Numbers obtained by reinterpreting base-2 representation of n in the factorial base: a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1).

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 8, 9, 24, 25, 26, 27, 30, 31, 32, 33, 120, 121, 122, 123, 126, 127, 128, 129, 144, 145, 146, 147, 150, 151, 152, 153, 720, 721, 722, 723, 726, 727, 728, 729, 744, 745, 746, 747, 750, 751, 752, 753, 840, 841, 842, 843, 846, 847, 848, 849, 864, 865
Offset: 0

Views

Author

Henry Bottomley, Jan 24 2001

Keywords

Comments

Numbers that are sums of distinct factorials (0! and 1! not treated as distinct).
Complement of A115945; A115944(a(n)) > 0; A115647 is a subsequence. - Reinhard Zumkeller, Feb 02 2006
A115944(a(n)) = 1. - Reinhard Zumkeller, Dec 04 2011
From Tilman Piesk, Jun 04 2012: (Start)
The inversion vector (compare A007623) of finite permutation a(n) (compare A055089, A195663) has only zeros and ones. Interpreted as a binary number it is 2*n (or n when the inversion vector is defined without the leading 0).
The inversion set of finite permutation a(n) interpreted as a binary number (compare A211362) is A211364(n).
(End)

Examples

			128 is in the sequence since 5! + 3! + 2! = 128.
a(22) = 128. a(22) = a(6) + (1 + floor(log(16) / log(2)))! = 8 + 5! = 128. Also, 22 = 10110_2. Therefore, a(22) = 1 * 5! + 0 * 4! + 1 * 3! + 1 + 2! + 0 * 0! = 128. - _David A. Corneth_, Aug 21 2016
		

Crossrefs

Indices of zeros in A257684.
Cf. A275736 (left inverse).
Cf. A025494, A060112 (subsequences).
Subsequence of A060132, A256450 and A275804.
Other sequences that are built by replacing 2^k in the binary representation with other numbers: A029931 (naturals), A089625 (primes), A022290 (Fibonacci), A197433 (Catalans), A276091 (n*n!), A275959 ((2n)!/2). Cf. also A276082 & A276083.

Programs

  • Haskell
    import Data.List (elemIndices)
    a059590 n = a059590_list !! n
    a059590_list = elemIndices 1 $ map a115944 [0..]
    -- Reinhard Zumkeller, Dec 04 2011
    
  • Maple
    [seq(bin2facbase(j),j=0..64)]; bin2facbase := proc(n) local i; add((floor(n/(2^i)) mod 2)*((i+1)!),i=0..floor_log_2(n)); end;
    floor_log_2 := proc(n) local nn,i; nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi; nn := floor(nn/2); od; end;
    # next Maple program:
    a:= n-> (l-> add(l[j]*j!, j=1..nops(l)))(Bits[Split](n)):
    seq(a(n), n=0..57);  # Alois P. Heinz, Aug 12 2025
  • Mathematica
    a[n_] :=  Reverse[id = IntegerDigits[n, 2]].Range[Length[id]]!; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jun 19 2012, after Philippe Deléham *)
  • PARI
    a(n) = if(n>0, a(n-msb(n)) + (1+logint(n,2))!, 0)
    msb(n) = 2^#binary(n)>>1
    {my(b = binary(n)); sum(i=1,#b,b[i]*(#b+1-i)!)} \\ David A. Corneth, Aug 21 2016
    
  • Python
    def facbase(k, f):
        return sum(f[i] for i, bi in enumerate(bin(k)[2:][::-1]) if bi == "1")
    def auptoN(N): # terms up to N factorial-base digits; 13 generates b-file
        f = [factorial(i) for i in range(1, N+1)]
        return list(facbase(k, f) for k in range(2**N))
    print(auptoN(5)) # Michael S. Branicky, Oct 15 2022

Formula

G.f. 1/(1-x) * Sum_{k>=0} (k+1)!*x^2^k/(1+x^2^k). - Ralf Stephan, Jun 24 2003
a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1). - Philippe Deléham, Oct 15 2011
From Antti Karttunen, Aug 19 2016: (Start)
a(0) = 0, a(2n) = A153880(a(n)), a(2n+1) = 1+A153880(a(n)).
a(n) = A225901(A276091(n)).
a(n) = A276075(A019565(n)).
a(A275727(n)) = A276008(n).
A275736(a(n)) = n.
A276076(a(n)) = A019565(n).
A007623(a(n)) = A007088(n).
(End)
a(n) = a(n - mbs(n)) + (1 + floor(log(n) / log(2)))!. - David A. Corneth, Aug 21 2016

Extensions

Name changed (to emphasize the functional nature of the sequence) with the old definition moved to the comments by Antti Karttunen, Aug 21 2016

A211364 Inversion sets of finite permutations that have only 0's and 1's in their inversion vectors.

Original entry on oeis.org

0, 1, 4, 3, 32, 33, 20, 11, 512, 513, 516, 515, 288, 289, 148, 75, 16384, 16385, 16388, 16387, 16416, 16417, 16404, 16395, 8704, 8705, 8708, 8707, 4384, 4385, 2196, 1099, 1048576, 1048577, 1048580, 1048579, 1048608, 1048609, 1048596
Offset: 0

Views

Author

Tilman Piesk, Jun 03 2012

Keywords

Comments

The finite permutations whose position in reverse colexicographic order is A059590(n) (compare A055089, A195663) have the special feature that their inversion vectors (compare A007623) have only zeros and ones, and give 2*n when interpreted as binary numbers. As the inversion vectors are special, one may also take a look at the inversion sets. This sequence shows them, interpreted as binary numbers (compare A211362).

Examples

			These are the 8 permutations of 4 elements that have only 0's and 1's in their inversion vectors. The left column shows their numbers (compare A055089, A195663), i.e., the beginning of A059590. The right column shows the inversion sets interpreted as binary numbers, i.e., the beginning of this sequence.
No.  permutation  inv. vector  inversion set     a
00     1 2 3 4     0 0 0 0     0  0 0  0 0 0     0
01     2 1 3 4     0 1 0 0     1  0 0  0 0 0     1
02     1 3 2 4     0 0 1 0     0  0 1  0 0 0     4
03     3 1 2 4     0 1 1 0     1  1 0  0 0 0     3
06     1 2 4 3     0 0 0 1     0  0 0  0 0 1    32
07     2 1 4 3     0 1 0 1     1  0 0  0 0 1    33
08     1 4 2 3     0 0 1 1     0  0 1  0 1 0    20
09     4 1 2 3     0 1 1 1     1  1 0  1 0 0    11
		

Crossrefs

Formula

a(n) = A211362(A059590(n)).
Showing 1-3 of 3 results.