[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Search: a168273 -id:a168273
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n) = (a(n-1) XOR a(n-2)) + 1, a(0) = a(1) = 0.
+10
6
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,4
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
LINKS
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
EXAMPLE
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 + ...
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved
Triangle T read by rows: T(n, k) = (n - k)*(1 - (-1)^k + 2*k)/4, with 0 <= k < n.
+10
5
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,5
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.
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.
EXAMPLE
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.
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]]
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.
KEYWORD
easy,nonn,tabl
AUTHOR
Stefano Spezia, Mar 08 2020
STATUS
approved
a(n) = (2*n^2 + 3 + (-1)^n)/2.
+10
4
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,1
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
LINKS
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
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 *)
PROG
(PARI) Vec(-2*(x^3+x^2-x+1)/((x-1)^3*(x+1)) + O(x^100)) \\ Colin Barker, Oct 15 2014
(Magma) [n^2+3/2+(-1)^n/2: n in [0..50]]; // Vincenzo Librandi, Oct 15 2014
(Sage) [(2*n^2 +3 +(-1)^n)/2 for n in (0..50)] # G. C. Greubel, Dec 14 2021
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Oct 14 2014
EXTENSIONS
Typo in data fixed by Colin Barker, Oct 15 2014
STATUS
approved
Maximum remainder when (k + 1)^n + (k - 1)^n is divided by k^2 for variable n and k > 2.
+10
2
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,1
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)
EXAMPLE
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.
MATHEMATICA
LinearRecurrence[{1, 2, -2, -1, 1}, {6, 8, 20, 24, 42}, 50] (* Harvey P. Dale, Apr 18 2018 *)
PROG
(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
CROSSREFS
Cf. A050187.
KEYWORD
nonn,easy
AUTHOR
Gaurav Kumar, Apr 13 2009
STATUS
approved
Modified eccentric connectivity index of the cycle graph with n vertices, C[n].
+10
1
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,1
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
LINKS
N. De, S. M. A. Nayeem and A. Pal, Bounds for modified eccentric connectivity index, Advanced Modeling and Optimization, 16(1) (2014) 133-142.
N. De, S. M. A. Nayeem and A. Pal, Bounds for modified eccentric connectivity index, arXiv:1402.1870 [math.CO], 2014.
Eric Weisstein's World of Mathematics, Graph Eccentricity
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
EXAMPLE
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.
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 *)
PROG
(PARI) a(n) = if (n % 2, 2*n*(n-1), 2*n^2); \\ Michel Marcus, Jun 20 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Nilanjan De, Jun 08 2014
STATUS
approved
Repeated terms of (2n)! (A010050).
+10
1
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,3
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.
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
MAPLE
A248812:=n->(2*floor(n/2))!: seq(A248812(n), n=0..20);
MATHEMATICA
Table[(2*Floor[n/2])!, {n, 0, 20}]
PROG
(Magma) [Factorial(2*Floor(n/2)) : n in [0..20]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 16 2014
STATUS
approved
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.
+10
1
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,1
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).
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, ....
EXAMPLE
The triangle is
2,
4, 2, 4,
6, 4, 6, 4, 6,
8, 6, 8, 6, 8, 6, 8,
etc.
MATHEMATICA
Table[2 (n - 1) + 2 (Boole@ OddQ@ k + 1), {n, 0, 7}, {k, 2 n + 1}] // Flatten (* Michael De Vlieger, Jan 19 2016 *)
KEYWORD
nonn,tabf
AUTHOR
Paul Curtz, Jan 19 2016
STATUS
approved

Search completed in 0.008 seconds