OFFSET
5,1
LINKS
Seiichi Manyama, Table of n, a(n) for n = 5..10000
Wikipedia, Generalized Petersen Graph.
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-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
KEYWORD
nonn,easy
AUTHOR
Nick Mayers, Jun 07 2016
STATUS
approved