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.

Previous Showing 31-40 of 54 results. Next

A261218 Row 1 of A261216.

Original entry on oeis.org

1, 0, 5, 4, 3, 2, 7, 6, 11, 10, 9, 8, 19, 18, 23, 22, 21, 20, 13, 12, 17, 16, 15, 14, 25, 24, 29, 28, 27, 26, 31, 30, 35, 34, 33, 32, 43, 42, 47, 46, 45, 44, 37, 36, 41, 40, 39, 38, 49, 48, 53, 52, 51, 50, 55, 54, 59, 58, 57, 56, 67, 66, 71, 70, 69, 68, 61, 60, 65, 64, 63, 62, 97, 96, 101, 100, 99, 98, 103, 102, 107, 106, 105, 104, 115, 114, 119, 118, 117, 116, 109, 108, 113, 112, 111, 110, 73
Offset: 0

Views

Author

Antti Karttunen, Aug 26 2015

Keywords

Comments

Equally, column 1 of A261217.
Take the n-th (n>=0) permutation from the list A060117, change 1 to 2 and 2 to 1 to get another permutation, and note its rank in the same list to obtain a(n).
Equally, we can take the n-th (n>=0) permutation from the list A060118, swap the elements in its two leftmost positions, and note the rank of that permutation in A060118 to obtain a(n).
Self-inverse permutation of nonnegative integers.

Examples

			In A060117 the permutation with rank 2 is [1,3,2], and swapping the elements 1 and 2 we get permutation [2,3,1], which is listed in A060117 as the permutation with rank 5, thus a(2) = 5.
Equally, in A060118 the permutation with rank 2 is [1,3,2], and swapping the elements in the first and the second position gives permutation [3,1,2], which is listed in A060118 as the permutation with rank 5, thus a(2) = 5.
		

Crossrefs

Row 1 of A261216, column 1 of A261217.
Cf. also A004442.
Related permutations: A060119, A060126, A261098.

Formula

a(n) = A261216(1,n).
By conjugating related permutations:
a(n) = A060126(A261098(A060119(n))).

A061800 a(n) = n + (-1)^(n mod 3).

Original entry on oeis.org

1, 0, 3, 4, 3, 6, 7, 6, 9, 10, 9, 12, 13, 12, 15, 16, 15, 18, 19, 18, 21, 22, 21, 24, 25, 24, 27, 28, 27, 30, 31, 30, 33, 34, 33, 36, 37, 36, 39, 40, 39, 42, 43, 42, 45, 46, 45, 48, 49, 48, 51, 52, 51, 54, 55, 54, 57, 58, 57, 60, 61, 60, 63, 64, 63, 66, 67, 66, 69, 70, 69, 72
Offset: 0

Views

Author

Olivier Gérard, Jun 22 2001

Keywords

Comments

The arithmetic function v_3(n,1) as defined in A289187. - Robert Price, Aug 22 2017; corrected by Ridouane Oudra, Dec 28 2024

Examples

			a(4) = 4 + (-1)^1 = 3.
		

Crossrefs

Programs

Formula

O.g.f.: (1-x+3*x^2)/((-1+x)^2*(1+x+x^2)). - R. J. Mathar, Apr 02 2008
a(n) = (3*n + 1 - 4*cos(2*(n+2)*Pi/3))/3. - Wesley Ivan Hurt, Sep 26 2017
a(n) = a(n-1) + a(n-3) - a(n-4) for n > 3. - Wesley Ivan Hurt, Oct 07 2017
a(n) = n + 2 - gcd(n+2,3). - Ridouane Oudra, Dec 28 2024
Sum_{n>=2} (-1)^n/a(n) = Pi/(3*sqrt(3)) + log(2) - 1. - Amiram Eldar, Jan 15 2025

A086970 Fix 1, then exchange the subsequent odd numbers in pairs.

Original entry on oeis.org

1, 5, 3, 9, 7, 13, 11, 17, 15, 21, 19, 25, 23, 29, 27, 33, 31, 37, 35, 41, 39, 45, 43, 49, 47, 53, 51, 57, 55, 61, 59, 65, 63, 69, 67, 73, 71, 77, 75, 81, 79, 85, 83, 89, 87, 93, 91, 97, 95, 101, 99, 105, 103, 109, 107, 113, 111, 117, 115, 121, 119
Offset: 0

Views

Author

Paul Barry, Jul 26 2003

Keywords

Comments

Partial sums are A086955.

Crossrefs

Programs

  • Magma
    [1] cat [2*n+1-2*(-1)^n: n in [1..70]]; // Vincenzo Librandi, Jun 21 2017
    
  • Mathematica
    Join[{1}, LinearRecurrence[{1, 1, -1}, {5, 3, 9}, 60]] (* Vincenzo Librandi, Jun 21 2017 *)
  • PARI
    Vec((1+4*x-3*x^2+2*x^3)/((1+x)*(1-x)^2) + O(x^100)) \\ Michel Marcus, Jun 21 2017

Formula

G.f.: (1+4*x-3*x^2+2*x^3)/((1+x)*(1-x)^2).
a(n) = n + abs(2 - (n + 1)*(-1)^n). - Lechoslaw Ratajczak, Dec 09 2016
a(n) = 2*A065190(n+1)-1 and a(n) = 2*A014681(n)+1. - Michel Marcus, Dec 10 2016
From Guenther Schrack, Jun 09 2017: (Start)
a(n) = 2*n + 1 - 2*(-1)^n for n > 0.
a(n) = 2*n + 1 - 2*cos(n*Pi) for n > 0.
a(n) = 4*n - a(n-1) for n > 1.
Linear recurrence: a(n) = a(n-1) + a(n-2) - a(n-3) for n > 3.
First differences: 2 - 4*(-1)^n for n > 1; -(-1)^n*A010696(n) for n > 1.
a(n) = A065164(n+1) + n for n > 0.
a(A014681(n)) = A005408(n) for n >= 0.
a(A005408(A014681(n)) for n >= 0.
a(n) = A005408(A103889(n)) for n >= 0.
A103889(a(n)) = 2*A065190(n+1) for n >= 0.
a(2*n-1) = A004766(n) for n > 0.
a(2*n+2) = A004767(n) for n >= 0. (End)

A163535 The absolute direction (0=east, 1=south, 2=west, 3=north) of the Peano curve A163336 at point n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Comments

Taking every ninth term gives the same sequence: (and similarly for all higher powers of 9 as well): a(n) = a(9*n).

Crossrefs

Cf. A163534 (transposed), A163537 (turn).

Programs

Formula

a(n) = A010873(A163532(n)+A163533(n)+abs(A163532(n))+3).
a(n) = A004442(A163534(n)).

Extensions

Name corrected by Kevin Ryde, Aug 29 2020

A209763 Triangle of coefficients of polynomials u(n,x) jointly generated with A209764; see the Formula section.

Original entry on oeis.org

1, 1, 2, 2, 5, 4, 3, 9, 13, 8, 4, 15, 31, 35, 16, 5, 23, 61, 97, 85, 32, 6, 33, 107, 219, 279, 203, 64, 7, 45, 173, 433, 717, 761, 469, 128, 8, 59, 263, 779, 1583, 2195, 1991, 1067, 256, 9, 75, 381, 1305, 3141, 5361, 6381, 5049, 2389, 512, 10, 93, 531
Offset: 1

Views

Author

Clark Kimberling, Mar 14 2012

Keywords

Comments

Row n begins with n and ends with 2^(n-1).
Row sums: 1,3,11,33,101,303,911,... A081250
Alternating row sums: 1,-1,1,-1,1,.. A033999
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
1...2
2...5....4
3...9....13...8
4...15...31...35...16
First three polynomials u(n,x): 1, 1 + 2x, 2 + 5x + 4x^2.
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := 2 x*u[n - 1, x] + v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A209763 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209764 *)
    Table[u[n, x] /. x -> 1, {n, 1, z}]  (* A081250 *)
    Table[v[n, x] /. x -> 1, {n, 1, z}]  (* A060925 *)
    Table[u[n, x] /. x -> -1, {n, 1, z}] (* A033999 *)
    Table[v[n, x] /. x -> -1, {n, 1, z}] (* A004442 *)

Formula

u(n,x)=x*u(n-1,x)+(x+1)*v(n-1,x),
v(n,x)=2x*u(n-1,x)+v(n-1,x)+1,
where u(1,x)=1, v(1,x)=1.

A209764 Triangle of coefficients of polynomials v(n,x) jointly generated with A209763; see the Formula section.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 4, 8, 14, 8, 5, 14, 32, 34, 16, 6, 22, 62, 96, 86, 32, 7, 32, 108, 218, 280, 202, 64, 8, 44, 174, 432, 718, 760, 470, 128, 9, 58, 264, 778, 1584, 2194, 1992, 1066, 256, 10, 74, 382, 1304, 3142, 5360, 6382, 5048, 2390, 512, 11, 92, 532
Offset: 1

Views

Author

Clark Kimberling, Mar 14 2012

Keywords

Comments

Row n begins with n and ends with 2^(n-1).
Row sums: 1,4,11,34,101,304,911,2734,... A060925.
Alternating row sums: 1,0,3,2,5,4,7,6,... A060925.
For a discussion and guide to related arrays, see A208510.

Examples

			First five rows:
1
2...2
3...4....4
4...8....14...8
5...14...32...34...16
First three polynomials v(n,x): 1, 2 + 2x , 3 + 4x + 4x^2.
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := 2 x*u[n - 1, x] + v[n - 1, x] + 1;
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A209763 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209764 *)
    Table[u[n, x] /. x -> 1, {n, 1, z}]  (* A081250 *)
    Table[v[n, x] /. x -> 1, {n, 1, z}]  (* A060925 *)
    Table[u[n, x] /. x -> -1, {n, 1, z}] (* A033999 *)
    Table[v[n, x] /. x -> -1, {n, 1, z}] (* A004442*)

Formula

u(n,x)=x*u(n-1,x)+(x+1)*v(n-1,x),
v(n,x)=2x*u(n-1,x)+v(n-1,x)+1,
where u(1,x)=1, v(1,x)=1.

A307485 A permutation of the nonnegative integers: one odd, two even, four odd, eight even, etc.; extended to nonnegative integer with a(0) = 0.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Apr 18 2019

Keywords

Comments

The simple idea of "list the first odd number, first two even numbers, next four odd numbers, next eight even numbers..." leads to a permutation of the positive integers, which can quite naturally be extended to a permutation of the nonnegative integers, with a(0) = 0.

Examples

			The first odd number is a(1) = 1,
the first two even numbers are a(2..3) = (2, 4),
the next four odd numbers are a(4..7) = (3, 5, 7, 9),
the next eight even numbers are a(8..15) = (6, 8, ..., 20), etc.
the next sixteen odd numbers are a(16..31) = (11, 13, ..., 41),
the next thirty-two even numbers are a(32..63) = (22, 24, ..., 84), etc.
the next 64 odd numbers are a(64..127) = (43, 45, ..., 169),
the next 128 even numbers are a(128..255) = (86, 88, ..., 340), etc.
		

Crossrefs

Cf. A196521, A307613 (inverse permutation), A307612 (partial sums).
Cf. A103889 (odd & even swapped), A004442 (pairs reversed: n + (-1)^n).
Odd numbers: A005408. Even numbers: A005843.
Cf. A233275 (different permutation based on entangling odd & even numbers).

Programs

  • Mathematica
    Join[{0},Flatten[Riffle[TakeList[Range[1,169,2],2^Range[0,6,2]],TakeList[Range[ 2,340,2],2^Range[ 1,7,2]]]]] (* Harvey P. Dale, Dec 17 2022 *)
  • PARI
    A307485(n)=2*n-2^logint(n<<2+1,2)\3

Formula

Ignoring a(0) = 0, the k-th block (k >= 1) has 2^(k-1) terms, indexed from 2^(k-1) through 2^k-1, all having the same parity as k.
The difference between the last and the first term of this range is: a(2^k-1) - a(2^(k-1)) = 2^k - 2 = (2^(k-1) - 1)*2 = (starting index - 1) times two = ending index minus one.
The 1st, 3rd, ..., (2n+1)-th block = (n+1)-th odd block starts with A007583(n) = (1, 3, 11, 43, 171, ...), n >= 0.
The 2nd, 4th, ..., (2n+2)-th block = (n+1)-th even block starts with 2*A007583(n) = (2, 6, 22, 86, 342, ...), n >= 0, i.e., twice the starting value of the preceding odd block.
a(n) = 2*n - floor(2^k/3) where k = floor(log_2(4n+1)), n >= 0. (And 2^k == (-1)^k (mod 3) => floor(2^k/3) = (2^k-m)/3 with m = 1 if k even, m = 2 if k odd.)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 - log(2)/2 (A196521). - Amiram Eldar, Nov 28 2023

A327119 Sequence obtained by swapping each (k*(2n))-th element of the nonnegative integers with the (k*(2n+1))-th element, for all k>0 in ascending order, omitting the first term.

Original entry on oeis.org

0, 1, 3, 2, 7, 4, 8, 6, 14, 5, 15, 10, 20, 12, 17, 9, 34, 16, 27, 18, 31, 13, 29, 22, 47, 19, 39, 11, 48, 28, 44, 30, 76, 21, 51, 26, 62, 36, 53, 25, 69, 40, 55, 42, 75, 24, 65, 46, 97, 35, 63, 33, 94, 52, 71, 43, 95, 37, 87, 58, 90, 60, 89, 32, 167, 50, 84
Offset: 1

Views

Author

Jennifer Buckley, Sep 13 2019

Keywords

Comments

The first term must be omitted because it does not converge.
Start with the sequence of nonnegative integers [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...].
Swap all pairs specified by k=1, resulting in [1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, ...], so the first term of the final sequence is 0 (No swaps for k>1 will affect this term).
Swap all pairs specified by k=2, resulting in [3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, ...], so the second term of the final sequence is 1 (No swaps for k>2 will affect this term).
Swap all pairs specified by k=3, resulting in [2, 0, 1, 3, 7, 4, 8, 6, 11, 5, 9, ...], so the third term of the final sequence is 3 (No swaps for k>3 will affect this term).
Continue for all values of k.
a(n) is equivalent to -A327093(-n), if A327093 is extended to all integers.
It appears that n is an odd prime number iff a(n+1)=n-1. If true, is there a formal analogy with the Sieve of Eratosthenes (by swapping instead of marking terms), or is this another type of sieve? - Jon Maiga, May 31 2021

Crossrefs

Inverse: A327120.

Programs

  • Go
    func a(n int) int {
        for k := n; k > 0; k-- {
            if n%k == 0 {
                if (n/k)%2 == 0 {
                    n = n + k
                } else {
                    n = n - k
                }
            }
        }
        return n
    }

Formula

a(n) = A004442(A327420(n)) (conjectured). - Jon Maiga, May 31 2021

A018840 Number of steps for {2,3} fairy knight to reach (n,0) on infinite chessboard.

Original entry on oeis.org

0, 5, 4, 5, 2, 5, 2, 5, 4, 5, 4, 7, 4, 5, 6, 7, 6, 7, 6, 7, 8, 9, 8, 9, 8, 9, 10, 11, 10, 11, 10, 11, 12, 13, 12, 13, 12, 13, 14, 15, 14, 15, 14, 15, 16, 17, 16, 17, 16, 17, 18, 19, 18, 19, 18, 19, 20, 21, 20, 21, 20, 21, 22, 23, 22, 23, 22, 23, 24, 25, 24, 25, 24, 25, 26, 27, 26, 27, 26, 27
Offset: 0

Views

Author

Keywords

Comments

This piece is also known as a (2,3)-leaper or a zebra. - Franklin T. Adams-Watters, Dec 27 2017
Apparently also the minimum number of moves of the (1,5)-leaper to reach (n,n) starting from (0,0). - R. J. Mathar, Jan 05 2018

Programs

  • PARI
    concat(0, Vec(x*(5 - x + x^2 - 3*x^3 + 3*x^4 - 3*x^5 - 2*x^6 + 2*x^9 - 2*x^12 + 2*x^13 - 2*x^16 + 2*x^17) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)) + O(x^100))) \\ Colin Barker, Dec 28 2017

Formula

For n >= 18, a(n) = a(n-6) + 2. - David W. Wilson
From Colin Barker, Dec 28 2017: (Start)
G.f.: x*(5 - x + x^2 - 3*x^3 + 3*x^4 - 3*x^5 - 2*x^6 + 2*x^9 - 2*x^12 + 2*x^13 - 2*x^16 + 2*x^17) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)).
a(n) = a(n-1) + a(n-6) - a(n-7) for n>7.
(End)
3*a(n) = A004442(n+3)-A084100(n), n>11. - R. J. Mathar, Jan 02 2018

A180176 Lexicographically earliest permutation of the natural numbers such that a(n) != n and in decimal representation a(n) and n have at least one common digit.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 15 2010

Keywords

Comments

The permutation is self-inverse;
a(n) = A004442(n) for n >= 20.

Programs

  • Mathematica
    CoefficientList[Series[(-9 x^22 - 2 x^21 + 11 x^20 + 20 x^12 - 20 x^10 - 9 x^2 + x + 10) / ((x - 1)^2 (x + 1)), {x, 0, 100}], x] (* Vincenzo Librandi, Oct 23 2018 *)

Formula

From Chai Wah Wu, Oct 22 2018: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) for n > 22.
G.f.: (-9*x^22 - 2*x^21 + 11*x^20 + 20*x^12 - 20*x^10 - 9*x^2 + x + 10)/((x - 1)^2*(x + 1)). (End)
Previous Showing 31-40 of 54 results. Next