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 41-50 of 54 results. Next

A263824 Permutation of the nonnegative integers: [6k+3, 6k+4, 6k+5, 6k, 6k+1, 6k+2, ...].

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Oct 27 2015

Keywords

Crossrefs

Programs

  • Magma
    [n+3*(-1)^Floor(n/3) : n in [0..100]];
    
  • Magma
    I:=[3,4,5,0,1]; [n le 5 select I[n] else 2*Self(n-1)- Self(n-2)-Self(n-3)+2*Self(n-4)-Self(n-5): n in [1..70]]; // Vincenzo Librandi, Nov 22 2015
    
  • Maple
    A263824:=n->n+3*(-1)^floor(n/3): seq(A263824(n), n=0..100);
  • Mathematica
    Table[n + 3 (-1)^Floor[n/3], {n, 0, 100}]
    CoefficientList[Series[(3 - 2 x - 3 x^3 + 4 x^4)/((x - 1)^2 (1 + x^3)), {x, 0, 70}], x] (* Vincenzo Librandi, Nov 22 2015 *)
    LinearRecurrence[{2,-1,-1,2,-1},{3,4,5,0,1},70] (* Harvey P. Dale, Jun 23 2017 *)
  • PARI
    Vec((3-2*x-3*x^3+4*x^4) / ((x-1)^2*(1+x^3)) + O(x^100)) \\ Altug Alkan, Oct 28 2015
    
  • PARI
    A263824(n)=n+3*(-1)^(n\3) \\ M. F. Hasler, Nov 25 2015

Formula

G.f.: (3-2*x-3*x^3+4*x^4) / ((x-1)^2*(1+x^3)).
a(n) = 2*a(n-1) - a(n-2) - a(n-3) + 2*a(n-4) - a(n-5), n>4.
a(n) = n + 3*(-1)^floor(n/3).
a(n) = a(n-6) + 6 for n>5. - Tom Edgar, Oct 28 2015
From Wesley Ivan Hurt, Nov 22 2015: (Start)
a(n) = n + 3*A130151(n).
a(3n) = 3*A004442(n). (End)
Sum_{n>=0, n!=3} (-1)^n/a(n) = log(2) (A002162). - Amiram Eldar, Dec 25 2023
E.g.f.: exp(-x) + x*exp(x) + 2*exp(x/2)*(cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)). - Stefano Spezia, Aug 25 2025

A265376 a(1) = 1 and a(n) = Sum_{i=1..n-1} (-1)^i*i*a(i).

Original entry on oeis.org

1, -1, -3, 6, 30, -120, -840, 5040, 45360, -362880, -3991680, 39916800, 518918400, -6227020800, -93405312000, 1307674368000, 22230464256000, -355687428096000, -6758061133824000, 121645100408832000, 2554547108585472000, -51090942171709440000, -1175091669949317120000
Offset: 1

Views

Author

Keywords

Comments

1/abs(a(n)) + 1/abs(a(n+1)) = 1/(n-1)!, n = 3,5,7,... hence Sum_{n>1} 1/abs(a(n)) = cosh(1). - Peter McNair, Mar 04 2022

Crossrefs

Cf. A004442, A001710 (b(n)=Sum_{i=1..n-1} i*b(i)).

Programs

  • Mathematica
    a[1]=1; a[n_] := a[n] = Sum[(-1)^i*i*a[i], {i, 1, n - 1}]; Array[a,33]

Formula

For n>1, a(n) = (-1)^floor(n/2) * A001710(n) / floor(n/2). - Vaclav Kotesovec, Jan 26 2016

A307613 Inverse of the permutation A307485: one odd, two even, four odd, eight even, etc; extended with a(0) = 0.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Apr 18 2019

Keywords

Comments

See A307485 for further information, motivation & references.
Also, a(n) is the smallest k not yet in the sequence such that bitxor(k,a(n-1)) >= a(n-1). - Giorgos Kalogeropoulos, May 31 2019

Examples

			  Index n : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
A307485(n): 0, 1, 2, 4, 3, 5, 7, 9, 6, 8, ...
This sequence, the inverse permutation, is obtained by reading the above "from bottom to top", i.e., find the index in 2nd row, return the number above it: e.g., a(3) = 4, a(4) = 3, a(5) = 5, a(6) = 8, a(7) = 6, etc.
		

Crossrefs

Cf. A307485 (inverse permutation), A307612 (partial sums thereof).
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
    a[1]=1; a[n_] := a[n] = (t=1; While[BitXor[a[n-1],t] < a[n-1] || MemberQ[Array[a, n-1], t], t++]; t)
    Join[{0}, Table[a[k], {k,100}]]  (* Giorgos Kalogeropoulos, May 31 2019 *)
  • PARI
    my(A=apply(A307485,[1..99]), B=vecsort(A,,1)); for(i=1,#B,A[B[i]]==i||return(A307613=B[1..i-1]))

A354438 Square array A(n, k), n, k >= 0, read by antidiagonals; the factorial base expansion of A(n, k) is obtained by adding componentwise and reducing modulo their radix the digits of the factorial base expansions of n and k.

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 3, 3, 3, 3, 4, 2, 4, 2, 4, 5, 5, 5, 5, 5, 5, 6, 4, 0, 4, 0, 4, 6, 7, 7, 1, 1, 1, 1, 7, 7, 8, 6, 8, 0, 2, 0, 8, 6, 8, 9, 9, 9, 9, 3, 3, 9, 9, 9, 9, 10, 8, 10, 8, 10, 2, 10, 8, 10, 8, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
Offset: 0

Views

Author

Rémy Sigrist, May 28 2022

Keywords

Comments

The nonnegative integers together with A form an abelian group; A225901 gives inverse elements.
Each row is a permutation of the nonnegative integers.

Examples

			Square array A(n, k) begins:
  n\k|   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
  ---+----------------------------------------------------------------
    0|   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    1|   1   0   3   2   5   4   7   6   9   8  11  10  13  12  15  14
    2|   2   3   4   5   0   1   8   9  10  11   6   7  14  15  16  17
    3|   3   2   5   4   1   0   9   8  11  10   7   6  15  14  17  16
    4|   4   5   0   1   2   3  10  11   6   7   8   9  16  17  12  13
    5|   5   4   1   0   3   2  11  10   7   6   9   8  17  16  13  12
    6|   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21
    7|   7   6   9   8  11  10  13  12  15  14  17  16  19  18  21  20
    8|   8   9  10  11   6   7  14  15  16  17  12  13  20  21  22  23
    9|   9   8  11  10   7   6  15  14  17  16  13  12  21  20  23  22
   10|  10  11   6   7   8   9  16  17  12  13  14  15  22  23  18  19
   11|  11  10   7   6   9   8  17  16  13  12  15  14  23  22  19  18
   12|  12  13  14  15  16  17  18  19  20  21  22  23   0   1   2   3
   13|  13  12  15  14  17  16  19  18  21  20  23  22   1   0   3   2
   14|  14  15  16  17  12  13  20  21  22  23  18  19   2   3   4   5
   15|  15  14  17  16  13  12  21  20  23  22  19  18   3   2   5   4
		

Crossrefs

Cf. A003987, A004442, A108731, A225901, A354470 (primorial base analog).

Programs

  • PARI
    A(n,k, s=i->i+1) = { my (v=0, f=1, r); for (i=1, oo, if (n==0 && k==0, return (v), r=s(i); v+=f*((n+k)%r); f*=r; n\=r; k\=r)) }

Formula

A(n, k) = A(k, n).
A(m, A(n, k)) = A(A(m, n), k).
A(n, 0) = n.
A(n, k) = 0 iff k = A225901(n).
A(n, 1) = A004442(n).

A354470 Square array A(n, k), n, k >= 0, read by antidiagonals; the primorial base expansion of A(n, k) is obtained by adding componentwise and reducing modulo their radix the digits of the primorial base expansions of n and k.

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 3, 3, 3, 3, 4, 2, 4, 2, 4, 5, 5, 5, 5, 5, 5, 6, 4, 0, 4, 0, 4, 6, 7, 7, 1, 1, 1, 1, 7, 7, 8, 6, 8, 0, 2, 0, 8, 6, 8, 9, 9, 9, 9, 3, 3, 9, 9, 9, 9, 10, 8, 10, 8, 10, 2, 10, 8, 10, 8, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
Offset: 0

Views

Author

Rémy Sigrist, Jun 02 2022

Keywords

Comments

The nonnegative integers together with A form an abelian group; A354469 gives inverse elements.
Each row is a permutation of the nonnegative integers.

Examples

			Square array A(n, k) begins:
  n\k|   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
  ---+----------------------------------------------------------------
    0|   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    1|   1   0   3   2   5   4   7   6   9   8  11  10  13  12  15  14
    2|   2   3   4   5   0   1   8   9  10  11   6   7  14  15  16  17
    3|   3   2   5   4   1   0   9   8  11  10   7   6  15  14  17  16
    4|   4   5   0   1   2   3  10  11   6   7   8   9  16  17  12  13
    5|   5   4   1   0   3   2  11  10   7   6   9   8  17  16  13  12
    6|   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21
    7|   7   6   9   8  11  10  13  12  15  14  17  16  19  18  21  20
    8|   8   9  10  11   6   7  14  15  16  17  12  13  20  21  22  23
    9|   9   8  11  10   7   6  15  14  17  16  13  12  21  20  23  22
   10|  10  11   6   7   8   9  16  17  12  13  14  15  22  23  18  19
   11|  11  10   7   6   9   8  17  16  13  12  15  14  23  22  19  18
   12|  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27
   13|  13  12  15  14  17  16  19  18  21  20  23  22  25  24  27  26
   14|  14  15  16  17  12  13  20  21  22  23  18  19  26  27  28  29
   15|  15  14  17  16  13  12  21  20  23  22  19  18  27  26  29  28
		

Crossrefs

Cf. A004442, A235168, A354438 (factorial base analog), A354469.

Programs

  • PARI
    A(n,k, s=i->prime(i)) = { my (v=0, f=1, r); for (i=1, oo, if (n==0 && k==0, return (v), r=s(i); v+=f*((n+k)%r); f*=r; n\=r; k\=r)) }

Formula

A(n, k) = A(k, n).
A(m, A(n, k)) = A(A(m, n), k).
A(n, 0) = n.
A(n, k) = 0 iff k = A354469(n).
A(n, 1) = A004442(n).

A004458 Nimsum n + 17.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

A self-inverse permutation of the natural numbers. - Philippe Deléham, Nov 22 2016

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 60.
  • J. H. Conway, On Numbers and Games. Academic Press, NY, 1976, pp. 51-53.

Crossrefs

Cf. A004442.

Programs

  • Haskell
    import Data.Bits (xor)
    a004458 n = n `xor` 17 :: Integer  -- Reinhard Zumkeller, Nov 07 2012
    
  • PARI
    Vec((17-x-14*x^2-15*x^16-x^17+18*x^18)/((1-x)^2*(1+x)*(1+x^16)) + O(x^50)) \\ Colin Barker, Apr 12 2016
    
  • PARI
    a(n) = n + (-1)^n + 16*(-1)^(n\16); \\ Michel Marcus, Apr 12 2016

Formula

a(n) = n + (-1)^n + 16(-1)^[n/16]. - Mitchell Harris, Jan 10 2005
G.f.: (17-x-14*x^2-15*x^16-x^17+18*x^18) / ((1-x)^2*(1+x)*(1+x^16)). - Colin Barker, Apr 12 2016
a(n) = n XOR 17. - Michel Marcus, Apr 12 2016

A080418 Generalized Pascal triangle.

Original entry on oeis.org

1, 1, 3, 1, 2, 4, 1, 5, 5, 5, 1, 4, 11, 9, 6, 1, 7, 14, 21, 14, 7, 1, 6, 22, 34, 36, 20, 8, 1, 9, 27, 57, 69, 57, 27, 9, 1, 8, 37, 83, 127, 125, 85, 35, 10, 1, 11, 44, 121, 209, 253, 209, 121, 44, 11, 1, 10, 56, 164, 331, 461, 463, 329, 166, 54, 12
Offset: 1

Views

Author

Paul Barry, Feb 18 2003

Keywords

Examples

			First rows are:
  {1},
  {1,3},
  {1,2,4},
  {1,5,5,5},
  {1,4,11,9,6},
  {1,7,14,21,14,7},
  ...
For example, 2 = 1 + 3 - 2, 5 = 1 + 2 + 2; 11 = 5 + 5 + 1, 14 = 4 + 11 - 1.
		

Crossrefs

Columns include A000012, A004442, A000217+(-1)^n, A000292+(-1)^n and in general, binomial(n+k, k)+(-1)^n.
Diagonals include A000096, A063258.

Programs

  • Mathematica
    t[n_, k_] := t[n, k]=Which[k==1, 1, n2, t[n-1, k-1] + t[n-1, k] + (-1)^(n+k)]; Flatten[Table[t[n, k], {n, 1, 20}, {k, 1, n}]] (* Frank M Jackson, Mar 27 2012 *)

Formula

T(n, 1)=1, T(n, k)=0 for k>n, T(n, 2) = T(n-1, 1) + T(n-1, 2) + 2*(-1)^n, T(n, k) = T(n-1, k-1) + T(n-1, k) + (-1)^(n+k) for k>2. [corrected by Frank M Jackson, Mar 27 2012]

Extensions

Terms corrected and extended by Frank M Jackson, Mar 27 2012

A168195 a(n) = 2*n - a(n-1) + 1 with n>1, a(1)=5.

Original entry on oeis.org

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

Views

Author

Vincenzo Librandi, Nov 20 2009

Keywords

Crossrefs

Programs

Formula

From R. J. Mathar, Nov 22 2009: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) = n + 1 - 3*(-1)^n.
G.f.: x*(5+2*x^2-5*x)/((1+x)*(x-1)^2). (End)
a(n) = n - 4 + 2^(2-(-1)^n). - Wesley Ivan Hurt, Dec 13 2013
a(n) = A004442(n-1) + 2*(1-(-1)^n) = A147677(n) - floor((n+3)/2). - Filip Zaludek, Oct 31 2016
Sum_{n>=3} (-1)^n/a(n) = 23/15 - log(2). - Amiram Eldar, Feb 23 2023

A179783 a(n) = 2*n*(n+1)*(n+2)/3 + (-1)^n.

Original entry on oeis.org

1, 3, 17, 39, 81, 139, 225, 335, 481, 659, 881, 1143, 1457, 1819, 2241, 2719, 3265, 3875, 4561, 5319, 6161, 7083, 8097, 9199, 10401, 11699, 13105, 14615, 16241, 17979, 19841, 21823, 23937, 26179, 28561, 31079
Offset: 0

Views

Author

Bruno Berselli, Jul 29 2010 - Sep 07 2010

Keywords

Comments

First differences in 2*A081352.
Second differences in 4*A004442.

Crossrefs

Programs

  • Magma
    [(2/3)*n*(n+1)*(n+2)+(-1)^n: n in [0..35]];
    
  • Mathematica
    LinearRecurrence[{3,-2,-2,3,-1},{1,3,17,39,81},40] (* Harvey P. Dale, Mar 04 2023 *)
  • PARI
    for(n=0, 35, print1((2/3)*n*(n+1)*(n+2)+(-1)^n", "));

Formula

G.f.: (1+10*x^2-4*x^3+x^4)/((1+x)*(1-x)^4); exp(-x)+(2/3)*exp(x)*x*(6+6*x+x^2).
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5) for n>4.
a(n) = 4*A000292(n)+(-1)^n.

A263426 Permutation of the nonnegative integers: [4k+2, 4k+1, 4k, 4k+3, ...].

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Oct 17 2015

Keywords

Comments

Fixed points are the odd numbers (A005408).

Crossrefs

Programs

  • Magma
    [n+(1+(-1)^n)*(-1)^(n*(n+1) div 2) : n in [0..80]];
    
  • Magma
    /* By definition: */ &cat[[4*k+2,4*k+1,4*k,4*k+3]: k in [0..20]]; // Bruno Berselli, Nov 08 2015
    
  • Maple
    A263426:=n->n + (1 + (-1)^n)*(-1)^(n*(n + 1)/2): seq(A263426(n), n=0..80);
  • Mathematica
    Table[n + (1 + (-1)^n)*(-1)^(n*(n + 1)/2), {n, 0, 80}]
  • PARI
    Vec((2-3*x+2*x^2+x^3)/((x-1)^2*(1+x^2)) + O(x^100)) \\ Altug Alkan, Oct 19 2015

Formula

G.f.: (2 - 3*x + 2*x^2 + x^3)/((x - 1)^2*(1 + x^2)).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>3.
a(n) = n + (1 + (-1)^n)*(-1)^(n*(n+1)/2).
a(n) = 4*floor((n+1)/4) - (n mod 4) + 2.
a(n) = A092486(n) - 1.
a(n) = n + A176742(n) for n>0.
a(2n) = 2*A004442(n), a(2n+1) = A005408(n).
a(-n-1) = -A263449(n).
a(n+1) = a(n) - A132429(n+1)*(-1)^n.
Sum_{n>=0, n!=2} (-1)^(n+1)/a(n) = 1 - log(2) (A244009). - Amiram Eldar, Dec 25 2023
Previous Showing 41-50 of 54 results. Next