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

A114375 a(n) = (a(n-1) XOR a(n-2)) + 1, a(0) = a(1) = 0.

Original entry on oeis.org

0, 0, 1, 2, 4, 7, 4, 4, 1, 6, 8, 15, 8, 8, 1, 10, 12, 7, 12, 12, 1, 14, 16, 31, 16, 16, 1, 18, 20, 7, 20, 20, 1, 22, 24, 15, 24, 24, 1, 26, 28, 7, 28, 28, 1, 30, 32, 63, 32, 32, 1, 34, 36, 7, 36, 36, 1, 38, 40, 15, 40, 40, 1, 42, 44, 7, 44, 44, 1, 46, 48, 31, 48, 48, 1, 50, 52, 7, 52, 52, 1
Offset: 0

Views

Author

Keywords

Comments

The function moving to the next overlapping pair in the sequence is f:(i,j) = (j, (i XOR j) + 1) is one-to one. This means that the only possible trajectories for the sequence are loops, "lines", and "rays". The inverse is f^{-1}: (i,j) = (i XOR (j-1), i) is defined except when j = 0. Thus the only infinite non-repeating trajectories are those starting with (i,0) for some i. If we define the size of a pair (i,j) to be the largest power of two <= max(i,j). It is trivial to see that the size of f(i,j) is always >= the size of (i,j). Coupled with the fact there are only finitely many pairs with a given size, this means that "line" trajectories are not possible. Any trajectory that goes to a larger size must be part of a ray, so that tracing back will eventually reach zero. - Franklin T. Adams-Watters, Mar 03 2014

Examples

			G.f. = x^2 + 2*x^3 + 4*x^4 + 7*x^5 + 4*x^6 + 4*x^7 + x^8 + 6*x^9 + 8*x^10 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := If[ n < 0, BitXor[ a[n + 1], a[n + 2] - 1], If[n < 2, 0, 1 + BitXor[ a[n - 1], a[n - 2]]]]; (* Michael Somos, Mar 03 2014 *)
    a[ n_] := If[ Mod[n, 3] == 0, 2 n/3, If[ Mod[n, 3] == 1, 4 Quotient[n + 3, 6], If[ n == -1, -1, 2^IntegerExponent[ Fibonacci[n + 1], 2] - 1]]]; (* Michael Somos, Mar 03 2014 *)
    nxt[{a_,b_}]:={b,BitXor[a,b]+1}; NestList[nxt,{0,0},80][[All,1]] (* Harvey P. Dale, Feb 26 2020 *)

Formula

a(3n)=2n. a(3n+1)=4*floor((n+1)/2). a(6n+2)=1. a(6n+5)=2^(A001511(n+1)+2)-1.
a(3*n + 1) = A168273(n+1). a(3*n - 1) = A074723(n) - 1.- Michael Somos, Mar 03 2014
a(-n) = -a(n) if n == 0 (mod 3), a(-1-n) = -a(n) if n == 1 (mod 3), a(-2-n) = a(n) if n == 2 (mod 3). - Michael Somos, Mar 03 2014

A333119 Triangle T read by rows: T(n, k) = (n - k)*(1 - (-1)^k + 2*k)/4, with 0 <= k < n.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 0, 3, 2, 2, 0, 4, 3, 4, 2, 0, 5, 4, 6, 4, 3, 0, 6, 5, 8, 6, 6, 3, 0, 7, 6, 10, 8, 9, 6, 4, 0, 8, 7, 12, 10, 12, 9, 8, 4, 0, 9, 8, 14, 12, 15, 12, 12, 8, 5, 0, 10, 9, 16, 14, 18, 15, 16, 12, 10, 5, 0, 11, 10, 18, 16, 21, 18, 20, 16, 15, 10, 6
Offset: 1

Views

Author

Stefano Spezia, Mar 08 2020

Keywords

Comments

T(n, k) is the k-th super- and subdiagonal sum of the matrix M(n) whose permanent is A332566(n).
The h-th subdiagonal of the triangle T gives 0 followed by the multiples of h+1 repeated.
For k > 0, the (2*k-1)-th and (2*k)-th columns of the triangle T give the multiples of k.

Examples

			n\k| 0 1 2 3 4 5
---+------------
1  | 0
2  | 0 1
3  | 0 2 1
4  | 0 3 2 2
5  | 0 4 3 4 2
6  | 0 5 4 6 4 3
...
For n = 4 the matrix M(4) is
      0 1 1 2
      1 0 1 1
      1 1 0 1
      2 1 1 0
and therefore T(4, 0) = 0, T(4, 1) = 3, T(4, 2) = 2 and T(4, 3) = 2.
		

Crossrefs

Cf. A332566.
Cf. A000004: 1st column; A000027: 2nd and 3rd column; A004526: diagonal; A005843: 4th and 5th column; A052928: 1st subdiagonal; A168237: 2nd subdiagonal; A168273: 3rd subdiagonal; A173196: row sums.

Programs

  • Mathematica
    T[n_,k_]:=(n-k)(1-(-1)^k+2k)/4; Flatten[Table[T[n,k],{n,1,12},{k,0,n-1}]] (* or *)
    r[n_] := Table[SeriesCoefficient[y*(x*(2 + y + y^2) - (1 + y + 2*y^2))/((1 - x)^2 *(1 - y)^3 (1 + y)^2), {x, 0, i}, {y, 0, j}], {i, n, n}, {j, 0, n-1}]; Flatten[Array[r, 12]]

Formula

O.g.f.: y*(x*(2 + y + y^2) - (1 + y + 2*y^2))/((1 - x)^2*(1 - y)^3*(1 + y)^2).
T(n, k) = k*(n - k)/2 for k even.
T(n, k) = (1 + k)*(n - k)/2 for k odd.

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

Original entry on oeis.org

2, 2, 6, 10, 18, 26, 38, 50, 66, 82, 102, 122, 146, 170, 198, 226, 258, 290, 326, 362, 402, 442, 486, 530, 578, 626, 678, 730, 786, 842, 902, 962, 1026, 1090, 1158, 1226, 1298, 1370, 1446, 1522, 1602, 1682, 1766, 1850, 1938, 2026, 2118
Offset: 0

Views

Author

Paul Curtz, Oct 14 2014

Keywords

Comments

Numbers belonging to A016825: a(n) = A016825( A002620(n) ). - Bruno Berselli, Oct 15 2014
For n>1, a(n) is the number of row vectors of length 2n with entries in [1,n], first entry 1, with maximum inner distance. That is, vectors where the modular distance between adjacent entries is at least (n-2)/2. Modular distance is the minimum of remainders of (x - y) and (y - x) when dividing by n. Geometrically, this metric counts how far the integers mod n are from each other if 1 and n are adjacent as on a circle. - Omar Aceval Garcia, Jan 30 2021

Crossrefs

Programs

  • Magma
    [n^2+3/2+(-1)^n/2: n in [0..50]]; // Vincenzo Librandi, Oct 15 2014
    
  • Mathematica
    Table[n^2 + 3/2 + (-1)^n/2, {n, 0, 50}] (* Bruno Berselli, Oct 15 2014 *)
    CoefficientList[Series[2(x^3+x^2-x+1)/((1-x)^3 (x+1)), {x, 0, 50}], x] (* Vincenzo Librandi, Oct 15 2014 *)
    LinearRecurrence[{2,0,-2,1},{2,2,6,10},60] (* Harvey P. Dale, Apr 08 2019 *)
  • PARI
    Vec(-2*(x^3+x^2-x+1)/((x-1)^3*(x+1)) + O(x^100)) \\ Colin Barker, Oct 15 2014
    
  • Sage
    [(2*n^2 +3 +(-1)^n)/2 for n in (0..50)] # G. C. Greubel, Dec 14 2021

Formula

a(n) = A000290(n) + A000034(n+1) = 4*A002620(n) + 2.
a(n+1) = 2*A080827(n+1) = (n+2)^2 - A042964(n+1) = a(n) + 2*n + 1 -(-1)^n.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Colin Barker, Oct 15 2014
G.f.: 2*(1-x+x^2+x^3) / ((1-x)^3*(x+1)). - Colin Barker, Oct 15 2014
E.g.f.: cosh(x) + (1 + x + x^2)*exp(x). - G. C. Greubel, Dec 14 2021
a(2n) = A005899(n) for n > 0, a(2n+1) = A069894(n). - Omar Aceval Garcia, Dec 30 2021

Extensions

Typo in data fixed by Colin Barker, Oct 15 2014

A159469 Maximum remainder when (k + 1)^n + (k - 1)^n is divided by k^2 for variable n and k > 2.

Original entry on oeis.org

6, 8, 20, 24, 42, 48, 72, 80, 110, 120, 156, 168, 210, 224, 272, 288, 342, 360, 420, 440, 506, 528, 600, 624, 702, 728, 812, 840, 930, 960, 1056, 1088, 1190, 1224, 1332, 1368, 1482, 1520, 1640, 1680, 1806, 1848, 1980, 2024, 2162, 2208, 2352, 2400, 2550, 2600
Offset: 3

Views

Author

Gaurav Kumar, Apr 13 2009

Keywords

Examples

			For n = 3, maxr => 3*3 - 3 = 6 since 3 is odd.
For n = 4, maxr => 4*4 - 2*4 = 8 since 4 is even.
		

Crossrefs

Cf. A050187.

Programs

  • Mathematica
    LinearRecurrence[{1,2,-2,-1,1},{6,8,20,24,42},50] (* Harvey P. Dale, Apr 18 2018 *)
  • PARI
    a(n) = if (n % 2, n^2 - n, n^2 - 2*n); \\ Michel Marcus, Aug 26 2013
    
  • PARI
    first(n) = Vec(x^3*(-6-2*x)/((x+1)^2*(x-1)^3) + O(x^(n+3))) \\ Iain Fox, Nov 26 2017

Formula

maxr(n) = n*n - 2*n if n is even, and n*n - n if n is odd.
G.f.: x^3*(-6-2*x)/((x+1)^2*(x-1)^3). - Maksym Voznyy (voznyy(AT)mail.ru), Jul 26 2009 (proved by Iain Fox, Nov 26 2017)
a(n) = 2*A050187(n). - R. J. Mathar, Aug 08 2009 (proved by Iain Fox, Nov 27 2017)
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 7. - Colin Barker, Oct 29 2017 (proved by Iain Fox, Nov 26 2017)
a(n) = n^2 - n*(3 + (-1)^n)/2. - Iain Fox, Nov 26 2017
From Iain Fox, Nov 27 2017: (Start)
a(n) = A000290(n) - A022998(n).
a(n) = 2*A093005(n-2) + A168273(n-1).
a(n) = (4*(A152749(n-2)) + A091574(n-1) - A010719(n-1))/3.
E.g.f.: x*(exp(x)*x - sinh(x)).
(End)

A242371 Modified eccentric connectivity index of the cycle graph with n vertices, C[n].

Original entry on oeis.org

12, 32, 40, 72, 84, 128, 144, 200, 220, 288, 312, 392, 420, 512, 544, 648, 684, 800, 840, 968, 1012, 1152, 1200, 1352, 1404, 1568, 1624, 1800, 1860, 2048, 2112, 2312, 2380, 2592, 2664, 2888, 2964, 3200, 3280, 3528, 3612, 3872, 3960, 4232, 4324, 4608, 4704
Offset: 3

Views

Author

Nilanjan De, Jun 08 2014

Keywords

Comments

The modified eccentric connectivity index of a graph is defined as the sum of the products of eccentricity with the total degree of neighboring vertices, over all vertices of the graph. This is a generalization of eccentric connectivity index.
a(n) = 4*A093353(n-1) = n*A168273(n) for n>2. - Alois P. Heinz, Jun 26 2014

Examples

			a(3) = 3*4 = 12 because there are 3 vertices and each vertex has eccentricity 1 and the total degree of neighboring vertices is 4.
		

Crossrefs

Programs

  • Maple
    a:= n-> n*(2*n-1+(-1)^n):
    seq(a(n), n=3..60);  # Alois P. Heinz, Jun 26 2014
  • Mathematica
    a[n_] := 2n(n-Boole[OddQ[n]]);
    Table[a[n], {n, 3, 50}] (* Jean-François Alcover, Nov 28 2018 *)
  • PARI
    a(n) = if (n % 2, 2*n*(n-1), 2*n^2); \\ Michel Marcus, Jun 20 2014

Formula

a(n) = 2*n*(n-1) if n is odd; and a(n) = 2*n^2 if n is even (n>2).
G.f.: -4*x^3*(3+5*x-4*x^2-2*x^3+2*x^4)/((x+1)^2*(x-1)^3). - Alois P. Heinz, Jun 26 2014

A248812 Repeated terms of (2n)! (A010050).

Original entry on oeis.org

1, 1, 2, 2, 24, 24, 720, 720, 40320, 40320, 3628800, 3628800, 479001600, 479001600, 87178291200, 87178291200, 20922789888000, 20922789888000, 6402373705728000, 6402373705728000, 2432902008176640000, 2432902008176640000, 1124000727777607680000
Offset: 0

Views

Author

Wesley Ivan Hurt, Oct 16 2014

Keywords

Comments

For n>1, a(n) is the product of the smallest parts in the partitions of 4*floor(n/2) = A168273(n) into two parts.

Crossrefs

Programs

  • Magma
    [Factorial(2*Floor(n/2)) : n in [0..20]];
  • Maple
    A248812:=n->(2*floor(n/2))!: seq(A248812(n), n=0..20);
  • Mathematica
    Table[(2*Floor[n/2])!, {n, 0, 20}]

Formula

a(n) = ( 2*floor(n/2) )! = A000142(A052928(n)).
a(2n) = a(2n+1) = A010050(n) = A211374(2n-1).
E.g.f.: log((1+x)/(1-x))/2+1/(1-x^2). - Robert Israel, Oct 19 2014

A267654 Irregular triangle of palindromic subsequences. Every row has 2*n+1 terms. From the second row, there are only two alternated numbers: 2*n+4 and 2*n+2.

Original entry on oeis.org

2, 4, 2, 4, 6, 4, 6, 4, 6, 8, 6, 8, 6, 8, 6, 8, 10, 8, 10, 8, 10, 8, 10, 8, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 16
Offset: 0

Views

Author

Paul Curtz, Jan 19 2016

Keywords

Comments

Row sums = 2, 10, 26, 50, ... = A069894(n).
Starting from A053186(n) =
0, for b(n)
0, 1, 2, for c(n)
0, 1, 2, 3, 4, for d(n)
0, 1, 2, 3, 4, 5, 6,
etc,
a(n) is used for
1) b(n+1) = b(n) + (a(0)=2) i.e. 0, 2, 4, 6, ... = A005843(n).
2) c(n+3) = c(n) + (period 3:repeat 4, 2, 4) i.e. 0, 1, 2, 4, 3, 6, 8, ... = A265667(n).
3) d(n+5) = d(n) + (period 5:repeat 6, 4, 6, 4, 6) i.e. 0, 1, 2, 3, 4, 6, 5, 8, 7, 10, ... = A265734(n).
Etc.
a(n) has a companion with the same terms,differently distributed,yielding permutations of the nonnegative numbers. See A265672.
a(n) other writing (by pairs):
2, 4, 2, 4,
6, 4, 6, 4,
6, 8, 6, 8, 6, 8, 6, 8,
10 8, 10, 8, 10, 8, 10, 8,
10, 12, 10, 12, 10, 12, 10, 12, 10, 12, 10, 12,
14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12,
etc.
First column: A168276(n+2). Second column: A168273(n+2).
Row sums: 12, 20, 56, 72, ... = 4*A074378(n+1).
The last term of the successive rows is the number of their terms.
Main diagonal: A005843(n+1).

Examples

			The triangle is
2,
4, 2, 4,
6, 4, 6, 4, 6,
8, 6, 8, 6, 8, 6, 8,
etc.
		

Crossrefs

Programs

  • Mathematica
    Table[2 (n - 1) + 2 (Boole@ OddQ@ k + 1), {n, 0, 7}, {k, 2 n + 1}] // Flatten (* Michael De Vlieger, Jan 19 2016 *)

Formula

a(n) = 2 * A086520(n+2).
a(2n) = 4*n + 2 times 4*n + 2 = 2, 2, 6, 6, 6, 6, 6, 6, 10,....
a(2n+1) = 4*(n+1) times 4*(n+1) = 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 12, ....
Showing 1-7 of 7 results.