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.

User: Mateusz Szymański

Mateusz Szymański's wiki page.

Mateusz Szymański has authored 6 sequences.

A232007 Maximal number of moves needed by a knight to reach every square from a fixed position on an n X n chessboard, or -1 if it is not possible to reach every square.

Original entry on oeis.org

0, -1, -1, 5, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 46
Offset: 1

Author

Mateusz Szymański, Nov 16 2013

Keywords

Comments

In other words, a(n) is the graph diameter of the n X n knight graph (or -1 if the graph is disconnected). - Eric W. Weisstein, Nov 20 2019

Examples

			For a classic 8 X 8 chessboard, a knight needs at most 6 moves to reach every square starting from a fixed position, so a(8) = 6.
For a 3 X 3 chessboard, it's impossible to reach the middle square starting from any other, so a(3) = -1.
		

Crossrefs

Cf. A004523.

Programs

  • Mathematica
    Replace[Table[GraphDiameter[KnightTourGraph[n, n]], {n, 20}], Infinity -> -1] (* Eric W. Weisstein, Nov 20 2019 *)
    Join[{0, -1, -1, 5}, Table[Ceiling[2 n/3], {n, 5, 20}]] (* Eric W. Weisstein, Nov 20 2019 *)
    Join[{0, -1, -1, 5}, LinearRecurrence[{1, 0, 1, -1}, {4, 4, 5, 6}, 20]] (* Eric W. Weisstein, Nov 20 2019 *)
    CoefficientList[Series[-1 - x + 5 x^2 + x^3 (4 + x^2 - 3 x^3)/((-1 + x)^2 (1 + x + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Nov 20 2019 *)
  • PARI
    concat(0, Vec(-x^2*(1-6*x^2+5*x^5-2*x^6)/((1-x)^2*(1+x+x^2)) + O(x^100))) \\ Colin Barker, Apr 26 2016

Formula

a(n) = ceiling(2n/3) for n > 4; see A004523. - R. J. Mathar, Nov 24 2013
From Colin Barker, Apr 26 2016: (Start)
a(n) = a(n-1)+a(n-3)-a(n-4) for n>8.
G.f.: -x^2*(1-6*x^2+5*x^5-2*x^6) / ((1-x)^2*(1+x+x^2)). (End)

Extensions

More terms from Vaclav Kotesovec, Oct 21 2014

A188573 a(n) = coefficient of the sqrt(6) term in (1 + sqrt(2) + sqrt(3))^n.

Original entry on oeis.org

0, 0, 2, 6, 32, 120, 528, 2128, 8960, 36864, 153472, 635008, 2635776, 10922496, 45300736, 187800576, 778731520, 3228696576, 13387309056, 55506722816, 230146834432, 954246856704, 3956565671936, 16404954546176, 68019305840640, 282025965649920
Offset: 0

Author

Mateusz Szymański, Dec 28 2012

Keywords

Comments

From Clark Kimberling, Oct 23 2024: (Start)
Conjecture: every prime divides a(n) for infinitely many n, and if K(p) = (k(1), k(2),...) is the maximal subsequence of indices n such that p divides a(n), then the difference sequence of K(p) is eventually periodic; indeed, K(p) is purely periodic for the first 6 primes, with respective period lengths 6,5,14,4,4,8 and these periods:
p = 2: (1, 2, 2, 1, 3, 3)
p = 3: (1, 4, 3, 8, 8)
p = 5: (1, 5, 4, 1, 1, 6, 6, 6, 6, 6, 6, 2, 4, 6)
p = 7: (1, 16, 1, 18)
p = 11: (1, 30, 1, 32)
p = 13: (1, 10, 3, 17, 10, 1, 28, 14)
See A377109 for a guide to related sequences. (End)

Examples

			a(3) = 6, because (1+sqrt(2)+sqrt(3))^3 = 16 + 14 sqrt(2) + 12 sqrt(3) + 6 sqrt(6).
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Sum[2^(Floor[n/2] - j - 1 - k) 3^j Multinomial[2 k + n - 2 Floor[n/2], 2 j + 1, 2 Floor[n/2] - 2 k - 1 - 2 j], {j, 0, Floor[n/2] - k - 1}], {k, 0, Floor[n/2] - 1}]; Table[a[n], {n, 0, 25}]
    a[n_] := Coefficient[ Expand[(1 + Sqrt[2] + Sqrt[3])^n], Sqrt[6]]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 08 2013 *)

Formula

From G. C. Greubel, Apr 10 2018: (Start)
Empirical: a(n) = 4*a(n-1) + 4*a(n-2) - 16*a(n-3) + 8*a(n-4).
Empirical: G.f.: 2*x^2*(1-x)/(1 - 4*x - 4*x^2 + 16*x^3 - 8*x^4). (End)
The conjectures by Greubel are true. See link. - Sela Fried, Jan 01 2025

Extensions

Keyword tabl removed by Michel Marcus, Apr 11 2018
Edited by Clark Kimberling, Oct 23 2024

A188571 a(n) = coefficient of sqrt(2) in the expansion of (1 + sqrt(2) + sqrt(3))^n.

Original entry on oeis.org

0, 1, 2, 14, 48, 224, 880, 3760, 15360, 64192, 265088, 1101440, 4561920, 18925568, 78447616, 325313536, 1348730880, 5592420352, 23187169280, 96141172736, 398624489472, 1652807303168, 6852965761024, 28414229807104, 117812861337600, 488483370827776
Offset: 0

Author

Mateusz Szymański, Dec 28 2012

Keywords

Comments

From Clark Kimberling, Oct 23 2024: (Start)
Conjecture: every prime divides a(n) for infinitely many n, and if K(p) = (k(1), k(2),...) is the maximal subsequence of indices n such that p divides a(n), then the difference sequence of K(p) is eventually periodic; indeed, K(p) is purely periodic for the first 6 primes, with respective period lengths 4,8,14,3,3,5 and these periods:
p = 2: (4)
p = 3: (6, 1, 1, 3, 1, 4, 2, 6)
p = 5: (6, 6, 6, 2, 4, 6, 1, 5, 4, 1, 1, 6, 6, 6)
p = 7: (9, 18, 9)
p = 11: (43, 10, 11)
p = 13: (21, 7, 28, 7, 21)
See A377109 for a guide to related sequences. (End)

Examples

			a(3) = 14 because (1+sqrt(2)+sqrt(3))^3 = 16 + 14*sqrt(2) + 12*sqrt(3) + 6*sqrt(6).
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Sum[2^(Floor[(n - 1)/2] - k - j) 3^j Multinomial[2 Floor[(n - 1)/2] + 1 - 2 j - 2 k, 2 j, 2 k + 1 - n + 2 Floor[n/2]], {j, 0, Floor[(n - 1)/2] - k + 1}], {k, 0, Floor[(n - 1)/2]}]; Table[a[n], {n, 0, 25}]
    a[n_] := Coefficient[ Expand[(1 + Sqrt[2] + Sqrt[3])^n], Sqrt[2]] /. Sqrt[3] -> 0; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 08 2013 *)

Formula

Conjectures from Colin Barker, Jan 08 2013: (Start)
a(n) = 4*a(n-1) + 4*a(n-2) - 16*a(n-3) + 8*a(n-4).
G.f.: -x*(2*x^2-2*x+1) / (8*x^4-16*x^3+4*x^2+4*x-1). (End)
The conjectures by Barker are true. See link. - Sela Fried, Jan 01 2025

Extensions

Edited by Clark Kimberling, Oct 20 2024

A188570 a(n) = coefficient of the term that is independent of sqrt(2) and sqrt(3) in the expansion of (1 + sqrt(2) + sqrt(3))^n.

Original entry on oeis.org

1, 1, 6, 16, 80, 296, 1296, 5216, 21952, 90304, 375936, 1555456, 6456320, 26754560, 110963712, 460015616, 1907494912, 7908659200, 32792076288, 135963148288, 563742310400, 2337417887744, 9691567030272, 40183767891968, 166612591968256, 690819710058496
Offset: 0

Author

Mateusz Szymański, Dec 28 2012

Keywords

Comments

From Clark Kimberling, Oct 23 2024: (Start)
Conjecture: every prime divides a(n) for infinitely many n, and if K(p) = (k(1), k(2),...) is the maximal subsequence of indices n such that p divides a(n), then the difference sequence of K(p) is eventually periodic; indeed, K(p) is purely periodic for the first 6 primes, with respective period lengths 1,5,5,3,3,5 and these periods:
p = 2: (4)
p = 3: (8, 1, 4, 3, 8)
p = 5: (9, 10, 1, 20, 20)
p = 7: (9, 9, 18)
p = 11: (10, 11, 43)
p = 13: (7, 21, 21, 7, 28)
See A377109 for a guide to related sequences. (End)

Examples

			a(3) = 16 because (1+sqrt(2)+sqrt(3))^3 = 16 + 14*sqrt(2) + 12*sqrt(3) + 6*sqrt(6).
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Sum[2^(Floor[n/2] - k - j) 3^j Multinomial[2 k + n - 2 Floor[n/2], 2 j, 2 Floor[n/2] - 2 k - 2 j], {j, 0, Floor[n/2] - k}], {k, 0, Floor[n/2]}]; Table[a[n], {n, 0, 25}]
    a[n_] := Expand[(1 + Sqrt[2] + Sqrt[3])^n] /. Sqrt[] -> 0; Table[a[n], {n, 0, 25}] (* _Jean-François Alcover, Jan 08 2013 *)
    LinearRecurrence[{4,4,-16,8},{1,1,6,16},30] (* Harvey P. Dale, Jan 25 2019 *)

Formula

Recurrence: a(n) = 4*a(n-1) + 4*a(n-2) - 16*a(n-3) + 8*a(n-4). - Vaclav Kotesovec, Aug 13 2013
a(n) ~ (1+sqrt(3)+sqrt(2))^n/4. - Vaclav Kotesovec, Aug 13 2013

Extensions

Edited by Clark Kimberling, Oct 20 2024

A188572 a(n) = coefficient of sqrt(3) in the expansion of (1 + sqrt(2) + sqrt(3))^n sequence.

Original entry on oeis.org

0, 1, 2, 12, 40, 184, 720, 3072, 12544, 52416, 216448, 899328, 3724800, 15452672, 64052224, 265617408, 1101234176, 4566192128, 18932244480, 78498938880, 325475532800, 1349511512064, 5595423113216, 23200121487360, 96193798471680, 398845002121216
Offset: 0

Author

Mateusz Szymański, Dec 28 2012

Keywords

Comments

From Clark Kimberling, Oct 23 2024: (Start)
Conjecture: every prime divides a(n) for infinitely many n, and if K(p) = (k(1), k(2),...) is the maximal subsequence of indices n such that p divides a(n), then the difference sequence of K(p) is eventually periodic; indeed, K(p) is purely periodic for the first 6 primes, with respective period lengths 6,8,5,4,4,8 and these periods:
p = 2: (3, 3, 1, 2, 2, 1)
p = 3: (4, 2, 6, 6, 1, 1, 3, 1)
p = 5: (20, 20, 9, 10, 1)
p = 7: (18, 1, 16, 1)
p = 11: (32, 1, 30, 1)
p = 13: (28, 14, 1, 10, 3, 17, 10, 1)
See A377109 for a guide to related sequences. (End)
Cf. A377109.

Examples

			a(3) = 12 because (1+sqrt(2)+sqrt(3))^3 = 16 + 14*sqrt(2) + 12*sqrt(3) + 6*sqrt(6).
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Sum[3^(Floor[(n - 1)/2] - k - j) 2^j Multinomial[2 Floor[(n - 1)/2] + 1 - 2 j - 2 k, 2 j, 2 k + 1 - n + 2 Floor[n/2]], {j, 0, Floor[(n - 1)/2] - k + 1}], {k, 0, Floor[(n - 1)/2]}]; Table[a[n], {n, 0, 25}]
    a[n_] := Coefficient[ Expand[(1 + Sqrt[2] + Sqrt[3])^n], Sqrt[3]] /. Sqrt[2] -> 0; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 08 2013 *)

Formula

Conjectures from R. J. Mathar, Jan 09 2013: (Start)
a(n) = +4*a(n-1) +4*a(n-2) -16*a(n-3) +8*a(n-4).
G.f.: x*(-1+2*x)/( -1+4*x+4*x^2-16*x^3+8*x^4 ). (End)
The conjectures by Mathar are true. See link. - Sela Fried, Jan 01 2025

Extensions

Edited by Clark Kimberling, Oct 20 2024

A182262 Least prime p that 6^n - p is prime.

Original entry on oeis.org

3, 5, 5, 5, 17, 7, 17, 7, 7, 7, 59, 19, 17, 13, 7, 19, 137, 13, 19, 7, 23, 97, 19, 89, 17, 223, 29, 109, 5, 19, 5, 59, 197, 5, 17, 307, 59, 83, 109, 157, 19, 23, 43, 109, 103, 7, 23, 19, 7, 269, 43, 13, 5, 67, 89, 83, 479, 53, 53, 383, 7, 83, 113, 37, 5, 23
Offset: 1

Author

Mateusz Szymański, Apr 21 2012

Keywords

Examples

			For n=3 p=5 is the least prime that 6^3-p is prime (211).
		

Crossrefs

Cf. A013607, A059614 (n such that a(n)=5).

Programs

  • Maple
    f:= proc(n) local t,p;
      t:= 6^n;
      p:= 2;
      do
        p:= nextprime(p);
      until isprime(t-p);
      p
    end proc:
    map(f, [$1..100]); # Robert Israel, Nov 05 2020
  • Mathematica
    f[n_] := Block[{p = 2}, While[! PrimeQ[6^n - p], p = NextPrime[p]];
      p]; Array[f, 60]
  • PARI
    a(n) = my(p = 2); while(!isprime(6^n-p), p = nextprime(p+1)); p; \\ Michel Marcus, Mar 23 2016