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”).

A274047
Diameter of Generalized Petersen Graph G(n, 2).
1
2, 4, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25
OFFSET
5,1
FORMULA
a(n) = floor((floor(n/2)+5)/2) for n>7.
G.f.: x^5*(2 + 2*x - x^2 + x^3 - 2*x^4 - x^5 + x^6 - x^7)/((1 + x)*(1 - x)^2*(1 + x^2)). - Bruno Berselli, Jun 08 2016
a(n) = 2 + floor(n/4 + 1/2) = A002265(n+10) for n>7. - Bruno Berselli, Jun 08 2016
MATHEMATICA
a[n_] := GraphDiameter[PetersenGraph[n, 2]]; Table[a[n], {n, 5, 30}]
LinearRecurrence[{1, 0, 0, 1, -1}, {2, 4, 3, 4, 4, 5, 5, 5}, 100] (* Harvey P. Dale, Jan 12 2020 *)
PROG
(PARI) a(n)=if(n>7, (n\2+5)\2, [4, 3, 2][n%3+1]) \\ Charles R Greathouse IV, Jun 08 2016
(Magma) [n le 7 select [4, 3, 2][n mod 3+1] else 2+Floor(n/4+1/2): n in [5..90]]; // Bruno Berselli, Jun 08 2016 - after Charles R Greathouse IV
CROSSREFS
Cf. A002265.
Sequence in context: A073127 A339099 A098604 * A226644 A083172 A287797
KEYWORD
nonn,easy
AUTHOR
Nick Mayers, Jun 07 2016
STATUS
approved