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.

A061547 Number of 132 and 213-avoiding derangements of {1,2,...,n}.

Original entry on oeis.org

1, 0, 1, 2, 6, 10, 26, 42, 106, 170, 426, 682, 1706, 2730, 6826, 10922, 27306, 43690, 109226, 174762, 436906, 699050, 1747626, 2796202, 6990506, 11184810, 27962026, 44739242, 111848106, 178956970, 447392426, 715827882, 1789569706, 2863311530, 7158278826
Offset: 0

Views

Author

Emeric Deutsch, May 16 2001

Keywords

Comments

Or, number of permutations with no fixed points avoiding 213 and 132.
Number of derangements of {1,2,...,n} having ascending runs consisting of consecutive integers. Example: a(4)=6 because we have 234/1, 34/12, 34/2/1, 4/123, 4/3/12, 4/3/2/1, the ascending runs being as indicated. - Emeric Deutsch, Dec 08 2004
Let c be twice the sequence A002450 interlaced with itself (from the second term), i.e., c = 2*(0, 1, 1, 5, 5, 21, 21, 85, 85, 341, 341, ...). Let d be powers of 4 interlaced with the zero sequence: d = (1, 0, 4, 0, 16, 0, 64, 0, 256, 0, ...). Then a(n+1) = c(n) + d(n). - Creighton Dement, May 09 2005
Inverse binomial transform of A094705 (0, 1, 4, 15). - Paul Curtz, Jun 15 2008
Equals row sums of triangle A177993. - Gary W. Adamson, May 16 2010
a(n-1) is also the number of order preserving partial isometries (of an n-chain) of fix 1 (fix of alpha equals the number of fixed points of alpha). - Abdullahi Umar, Dec 28 2010
a(n+1) <= A218553(n) is also the Moore lower bound on the order of a (5,n)-cage. - Jason Kimberley, Oct 31 2011
For n > 0, a(n) is the location of the n-th new number to make a first appearance in A087230. E.g., the 17th number to make its first appearance in A087230 is 18 and this occurs at A087230(43690) and a(17)=43690. - K D Pegrume, Jan 26 2022
Position in A002487 of 2 adjacent terms of A000045. E.g., 3/5 at 10, 5/8 at 26, 8/13 at 42, ... - Ed Pegg Jr, Dec 27 2022

Examples

			a(4)=6 because the only 132 and 213-avoiding permutations of {1,2,3,4} without fixed points are: 2341, 3412, 3421, 4123, 4312 and 4321.
		

Crossrefs

Cf. A177993. - Gary W. Adamson, May 16 2010
Cf. A183158, A183159. - Abdullahi Umar, Dec 28 2010
Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), A027383 (k=3), A062318 (k=4), this sequence (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 31 2011

Programs

Formula

a(n) = (3/8)*2^n + (1/24)*(-2)^n - 2/3 for n>=1.
a(n) = 4*a(n-2) + 2, a(0)=1, a(1)=0, a(2)=1.
G.f: (5*z^3-3*z^2-z+1)/((z-1)*(4*z^2-1)).
a(n) = A020989((n-2)/2) for n=2, 4, 6, ... and A020988((n-3)/2) for n=3, 5, 7, ... .
a(n+1)-2*a(n) = A078008 signed. Differences: doubled A000302. - Paul Curtz, Jun 15 2008
a(2i+1) = 2*Sum_{j=0..i-1} 4^j = string "2"^i read in base 4.
a(2i+2) = 4^i + 2*Sum_{j=0..i-1} 4^j = string "1"*"2"^i read in base 4.
a(n+2) = Sum_{k=0..n} A144464(n,k)^2 = Sum_{k=0..n} A152716(n,k). - Philippe Deléham and Michel Marcus, Feb 26 2014
a(2*n-1) = A176965(2*n), a(2*n) = A176965(2*n-1) for n>0. - Yosu Yurramendi, Dec 23 2016
a(2*n-1) = A020988(k-1), a(2*n)= A020989(n-1) for n>0. - Yosu Yurramendi, Jan 03 2017
a(n+2) = 2*A086893(n), n > 0. - Yosu Yurramendi, Mar 07 2017
E.g.f.: (15 - 8*cosh(x) + 5*cosh(2*x) - 8*sinh(x) + 4*sinh(2*x))/12. - Stefano Spezia, Apr 07 2022

Extensions

a(0)=1 prepended by Alois P. Heinz, Jan 27 2022

A096773 a(n) = 4*a(n-2) + 1 with a(1) = 0, a(2) = 3.

Original entry on oeis.org

0, 3, 1, 13, 5, 53, 21, 213, 85, 853, 341, 3413, 1365, 13653, 5461, 54613, 21845, 218453, 87381, 873813, 349525, 3495253, 1398101, 13981013, 5592405, 55924053, 22369621, 223696213, 89478485, 894784853, 357913941, 3579139413, 1431655765
Offset: 1

Views

Author

Gottfried Helms, Aug 15 2004

Keywords

Comments

Remainders for classes m of integers n (mod 2^(m+1)). After applying one Collatz (3x+1)-transformation to the so-classified integers the result can be written in two classes (mod 6) only.
This classifying scheme covers all positive integers.
With one 3x+1-transformation T(x;p) := x' = (3x+1)/2^p, all numbers x, described in the form, with the free parameter i >= 0, x = i*2^N + a(N) result in x', describable by the two classes with the same parameter i:
x' = i*6 + 1 (for odd N>2), or x' = i*6 + 5 (for even N). Thus
x = 4*i + 3 -> x' = 6*i + 5, x = 8*i + 1 -> x' = 6*i + 1,
x = 16*i + 13 -> x' = 6*i + 5, x = 32*i + 5 -> x' = 6*i + 1,
x = 64*i + 53 -> x' = 6*i + 5, x = 128*i + 21 -> x' = 6*i + 1,
....
all with "i" as a free parameter >= 0 covering all positive integers.

Examples

			a(1) = (2^0-1)/3 =  0, a(2) = (5*2^1 - 1) / 3 =  3,
a(3) = (2^2-1)/3 =  1, a(4) = (5*2^3 - 1) / 3 = 13,
a(5) = (2^4-1)/3 =  5, a(6) = (5*2^5 - 1) / 3 = 53,
a(7) = (2^6-1)/3 = 21.
....
		

Crossrefs

Bisections are A002450 & A072197.
After the initial 0, column 1 of A257852.
Cf. A176965.

Programs

  • Magma
    [(2^(n-1)*(3 + 2*(-1)^n) - 1)/3: n in [1..40]]; // Vincenzo Librandi, Jul 12 2015
    
  • Mathematica
    a[1] = 0; a[2] = 3; a[n_] := a[n] = 4a[n - 2] + 1; Table[ a[n], {n, 35}] (* Robert G. Wilson v, Aug 20 2004 *)
    Table[(2^(n - 1)*(3 + 2*(-1)^(n)) - 1)/3, {n, 10}] (* L. Edson Jeffery, Jul 12 2015 *)
    nxt[{a_,b_}]:={b,4a+1}; NestList[nxt,{0,3},40][[;;,1]] (* or *) LinearRecurrence[{1,4,-4},{0,3,1},40] (* Harvey P. Dale, Mar 19 2025 *)
  • PARI
    apply( {A096773(n) = if(n%2, 1, 5)<<(n-1)\3}, [1..55]) \\ M. F. Hasler, May 28 2024
    
  • Perl
    # To map any (odd) v to its (r,c):
    use bigint; $v=149; $r=$c=0; while(1){ $b=($v&1); $v>>=1; if ($b==($v&1)){ $c=($v>>1); last} $r++} $r&=1; # this splits the binary representation into two parts, at the first repeated digit from the right: the number of bits on the right is the row value, and the binary value on the left is the column value. Example: 149 => 1.00.10101 => (r,c)=(5,1). Ruud H.G. van Tol, Sep 23 2021
    
  • Python
    A096773=lambda n:((1 if n&1 else 5)<M. F. Hasler, May 28 2024

Formula

a(2m) = (5*2^(2m-1) - 1)/3, a(2m-1) = (2^(2m-2)-1)/3.
From Paul Curtz, Jul 01 2008; corrected by Bob Selcoe, Jul 28 2018: (Start)
a(2n) = 10*a(2n-1) + 3.
a(n+1) - 2*a(n) = A001045(n+2), signed. (End)
a(n) = (2^(n-1)*(3 + 2*(-1)^n) - 1)/3. - L. Edson Jeffery, Jul 12 2015
a(2n) = A086893(2n), a(2n+1) = A086893(2n-1), n > 0. - Yosu Yurramendi, Jan 17 2017
G.f.: -x^2*(-3+2*x) / ( (x-1)*(2*x+1)*(2*x-1) ). - R. J. Mathar, Mar 07 2017
a(2n) = A072197(n-1), n > 0; a(2n+1) = A002450(n), n >= 0. - Yosu Yurramendi, Mar 07 2017
a(2n) = (A266753(n) + A004171(n-1))/2, a(2n+1) = (A266753(n) - A004171(n-1))/2, n > 0. - Yosu Yurramendi, Mar 07 2017
a(n) = least residue 2*3^(2^(n-4)-1) - 1 (mod 2^n), n >= 5. - Bob Selcoe, Jul 26 2018
a(n) = 2*A176965(n-1) + 1 for n > 1. - Loren M. Pearson, Dec 06 2024

A162911 Numerators of drib tree fractions, where drib is the bit-reversal permutation tree of the Bird tree.

Original entry on oeis.org

1, 1, 2, 2, 3, 1, 3, 3, 5, 1, 4, 3, 4, 2, 5, 5, 8, 2, 7, 4, 5, 3, 7, 4, 7, 1, 5, 5, 7, 3, 8, 8, 13, 3, 11, 7, 9, 5, 12, 5, 9, 1, 6, 7, 10, 4, 11, 7, 11, 3, 10, 5, 6, 4, 9, 7, 12, 2, 9, 8, 11, 5, 13, 13, 21, 5, 18, 11, 14, 8, 19, 9, 16, 2, 11, 12, 17, 7, 19, 9, 14, 4, 13, 6, 7, 5, 11, 10, 17, 3, 13
Offset: 1

Views

Author

Ralf Hinze (ralf.hinze(AT)comlab.ox.ac.uk), Aug 05 2009

Keywords

Comments

The drib tree is an infinite binary tree labeled with rational numbers. It is generated by the following iterative process: start with the rational 1; for the left subtree increment and then reciprocalize the current rational; for the right subtree interchange the order of the two steps: the rational is first reciprocalized and then incremented. Like the Stern-Brocot and the Bird tree, the drib tree enumerates all the positive rationals (A162911(n)/A162912(n)).
From Yosu Yurramendi, Jul 11 2014: (Start)
If the terms (n>0) are written as an array (left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,...
1,
1, 2,
2, 3,1, 3,
3, 5,1, 4, 3, 4,2, 5,
5, 8,2, 7, 4, 5,3, 7,4, 7,1, 5, 5, 7,3, 8,
...
then the sum of the m-th row is 3^m (m = 0,1,2,), each column k is a Fibonacci-type sequence.
If the rows are written in a right-aligned fashion:
1
1, 2
2, 3,1, 3
3, 5,1, 4, 3, 4,2, 5
5, 8,2, 7,4, 5,3, 7, 4, 7,1, 5, 5, 7,3, 8
...
then each column k also is a Fibonacci-type sequence.
If the sequence is considered by blocks of length 2^m, m = 0,1,2,..., the blocks of this sequence are the reverses of blocks of A162912 (a(2^m+k) = A162912(2^(m+1)-1-k), m = 0,1,2,..., k = 0..2^m-1).
(End)
From Yosu Yurramendi, Jan 12 2017: (Start)
a(2^(m+2m' ) + A020988(m')) = A000045(m+1), m>=0, m'>=0
a(2^(m+2m'+1) + A020989(m')) = A000045(m+3), m>=0, m'>=0
a(2^(m+2m' ) - 1 - A002450(m')) = A000045(m+1), m>=0, m'>=0
a(2^(m+2m'+1) - 1 - A072197(m'-1)) = A000045(m+3), m>=0, m'>0
a(2^(m+1) -1) = A000045(m+2), m>=0. (End)

Examples

			The first four levels of the drib tree:
  [1/1],
  [1/2, 2/1],
  [2/3, 3/1, 1/3, 3/2],
  [3/5, 5/2, 1/4, 4/3, 3/4, 4/1, 2/5, 5/3].
		

Crossrefs

This sequence is the composition of A162909 and A059893: a(n) = A162909(A059893(n)). This sequence is a permutation of A002487(n+1).

Programs

  • Haskell
    import Ratio; drib :: [Rational]; drib = 1 : map (recip . succ) drib \/ map (succ . recip) drib; (a : as) \/ bs = a : (bs \/ as); a162911 = map numerator drib; a162912 = map denominator drib
    
  • PARI
    a(n) = my(x = 0, y = 1); forstep(i = logint(n, 2), 0, -1, [x, y] = if(bittest(n, i), [y, x + y], [x + y, x])); y \\ Mikhail Kurkov, Oct 12 2023
  • R
    blocklevel <- 6 # arbitrary
    a <- 1
    for(m in 0:blocklevel) for(k in 0:(2^m-1)){
      a[2^(m+1)+2*k  ] <- a[2^(m+1)-1-k]
      a[2^(m+1)+2*k+1] <- a[2^(m+1)-1-k] + a[2^m+k]
    }
    a
    # Yosu Yurramendi, Jul 11 2014
    

Formula

a(n) where a(1) = 1; a(2n) = b(n); a(2n+1) = a(n) + b(n); and b(1) = 1; b(2n) = a(n) + b(n); b(2n+1) = a(n).
a(2^(m+1)+2*k) = a(2^(m+1)-k-1), a(2^(m+1)+2*k+1) = a(2^(m+1)-k-1) + a(2^m+k), a(1) = 1, m>=0, k=0..2^m-1. - Yosu Yurramendi, Jul 11 2014
a(2^(m+1) + 2*k) = A162912(2^m + k), m >= 0, 0 <= k < 2^m.
a(2^(m+1) + 2*k + 1) = a(2^m + k) + A162912(2^m + k), m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Mar 30 2016
a(n*2^m + A176965(m)) = A268087(n), n > 0, m > 0. - Yosu Yurramendi, Feb 20 2017
a(n) = A002487(A258996(n)), n > 0. - Yosu Yurramendi, Jun 23 2021
Showing 1-3 of 3 results.