Detour Index

Author

Eric W. Weisstein
December 21, 2017

This notebook downloaded from http://mathworld.wolfram.com/notebooks/GraphTheory/DetourIndex.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/DetourIndex.html.

©2017 Wolfram Research, Inc. except for portions noted otherwise

Same detour index

(l=Select[SplitBy[Sort[DeleteCases[GraphData[#,{"DetourIndex","V","#"}]&/@GraphData[;;6],{_Missing,_,_}]],First],Length[#]>1&])//Timing

GraphicsGrid[Map[Show[GraphData[#[[-1]]],PlotLabel->Column[{GraphData[#[[-1]],"Name"],Row[{n==#[[2]],","," ",ω==#[[1]]}]},Alignment->Center]]&,Take[l,4],{2}],ImageSize->400]

Classes

Andrasfai

seq=Table[GraphData[{"Andrasfai",n},"DetourIndex"],{n,10}]

FindSequenceFunction[Drop[seq,2],n-2]//Factor

gf=x FindGeneratingFunction[seq,x]//Factor

Series[x(1+((x (35+x (56+x (-24+(19-5 x) x))))/(((-1+x))^4))),{x,0,10}]

SeriesCoefficient[x(1+((x (35+x (56+x (-24+(19-5 x) x))))/(((-1+x))^4))),{x,0,n}]//TraditionalForm

(1/2) (((2-3 n))^2) (-1+3 n)/.n->2

Table[Piecewise[{{35,n==2}},(3n-2)^2(3n-1)/2],{n,10}]

Antiprism

Entity["Graph",{"Antiprism",n}]["DetourIndex"]

A139757

Table[GraphData[{"Antiprism",n},"DetourIndex"],{n,3,25}]

FindSequenceFunction[%,n-2]//Factor

seq=Table[n (((-1+2 n))^2),{n,3,20}]

Table[Total[(2n-1)(ConstantArray[1,{2n,2n}]-IdentityMatrix[{2n,2n}]),2]/2,{n,10}]

Table[Total[SparseArray[{i_,i_}->0,2 n,2 n-1],2]/2,{n,10}]

FindLinearRecurrence[seq]

seq=LinearRecurrence[{4,-6,4,-1},{18,75,196,405},{0,20}]

FindGeneratingFunction[seq,x]

CoefficientList[Series[((1+14 x+9 (x^2))/(((-1+x))^4)),{x,0,20}],x]

Apollonian

A297027

seq=Table[GraphData[{"Apollonian",n},"DetourIndex"],{n,6}]

Table[Tally[Flatten[GraphData[{"Apollonian",n},"DetourMatrix"]]],{n,3}]//Column

Barbell

A226450

seq=Table[GraphData[{"Barbell",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]//Factor

FindLinearRecurrence[seq]

LinearRecurrence[{4,-6,4,-1},{1,10,45,124},{0,20}]

Bishop n×n

Table[GraphData[{"Bishop",{n,n}},"DetourIndex"],{n,10}]

BlackBishop n×n

seq=Table[GraphData[{"BlackBishop",{n,n}},"DetourIndex"],{n,10}]

FindSequenceFunction[Drop[seq,4],n-4]

FindLinearRecurrence[Drop[seq,4]]

FindGeneratingFunction[seq,n]

Table[Sort@Tally[Flatten[GraphData[{"BlackBishop",{n,n}},"DetourMatrix"]]],{n,8}]//Column

Table[Ceiling[(n-1)^2/2]+2 k-1,{n,12},{k,n,n}]

Table[Ceiling[(1/2) ((((n-1))^2)+1)]+n-2,{n,8}]

Table[GraphData[{"BlackBishop",{n,n}},"HamiltonConnected"],{n,10}]

Table[GraphData[{"BlackBishop",{n,n}},"V"],{n,10}]

FullSimplify[FindSequenceFunction[%,n],n∈Integers]

Table[With[{𝓃=(1/4) (1+(((-1))^(1+n))+2 (n^2))},𝓃(((𝓃-1))^2)/2],{n,10}]

FullSimplify[With[{𝓃=(1/4) (1+(((-1))^(1+n))+2 (n^2))},𝓃(((𝓃-1))^2)/2],n∈Integers]

FullSimplify[(1/128) (((3+(((-1))^n)-2 (n^2)))^2) (1+(((-1))^(1+n))+2 (n^2))//Expand,n∈Integers]

Table[Piecewise[{{28,n==3},{194,n==4}},(1/128) (((2 (n^2)-3-(((-1))^n)))^2) (2 (n^2)+1-(((-1))^n))],{n,10}]

Book

seq=Table[GraphData[{"Book",n},"DetourIndex"],{n,20}]

FindSequenceFunction[Drop[seq,2],n-2]//Factor

Table[Piecewise[{{16,n==1},{67,n==2}},3+10 n+13 (n^2)],{n,20}]

FindLinearRecurrence[Drop[seq,2]]

Bruhat

A296782

seq=Table[GraphData[{"Bruhat",n},"DetourIndex"],{n,6}]

CocktailParty

A139757

seq=Table[GraphData[{"CocktailParty",n},"DetourIndex"],{n,20}]

FindSequenceFunction[Drop[seq,2],n-2]//Factor

FindGeneratingFunction[i,x]//Factor

Series[-((-16-11 x+8 (x^2)-7 (x^3)+2 (x^4))/(((-1+x))^4))x^2,{x,0,10}]

SeriesCoefficient[-((-16-11 x+8 (x^2)-7 (x^3)+2 (x^4))/(((-1+x))^4))x^2,{x,0,n}]

Table[Piecewise[{{16,n==2}},n(2n-1)^2],{n,2,20}]

Select[GraphData["CocktailParty"],GraphData[#,"DetourIndex"]=!=With[{n="CocktailParty"/.GraphData[#,"NotationRules"]},Piecewise[{{16,n==2}},n (2 n-1)^2]]&]

Complete

Entity["Graph",{"Complete",n}]["DetourIndex"]

A002411

Table[GraphData[{"Complete",n},"DetourIndex"],{n,20}]

FindSequenceFunction[%,n]//Factor

Select[GraphData["Complete"],GraphData[#,"DetourIndex"]=!=With[{n="Complete"/.GraphData[#,"NotationRules"]},(n-1)^2 n/2]&]

CompleteBipartite m×n

Entity["Graph",{"CompleteBipartite",{m,n}}]["DetourIndex"]

(seq=Table[GraphData[{"CompleteBipartite",{m,n}},"DetourIndex"],{m,20},{n,m,20}])//Column

FindSequenceFunction[seq[[All,1]],n]//Factor

FindSequenceFunction[seq[[1]],n]

FindSequenceFunction[Rest@seq[[2]],n-1]//Factor

FindSequenceFunction[Rest@seq[[3]],n-2]//Factor

Table[Piecewise[{{n (2-5 n+4 (n^2)),m==n}},m (m+n-1)^2],{m,20},{n,m,20}]//Column

DeleteCases[Flatten[Table[{{m,n},GraphData[{"CompleteBipartite",{m,n}},"DetourIndex"],Piecewise[{{n (2-5 n+4 (n^2)),m==n}},m (m+n-1)^2]},{m,20},{n,m,20}],1],{_,x_,x_}]

CompleteBipartite n×n

Entity["Graph",{"CompleteBipartite",{n,n}}]["DetourIndex"]

Table[GraphData[{"CompleteBipartite",{n,n}},"DetourIndex"],{n,20}]

FindSequenceFunction[%,n]//Factor

Select[GraphData["CompleteBipartite"],Equal@@(n="CompleteBipartite"/.GraphData[#,"NotationRules"])&&GraphData[#,"DetourIndex"]=!=n[[1]] (2-5 n[[1]]+4 n[[1]]^2)&]

CompleteTripartite n×n×n

Entity["Graph",{"CompleteTripartite",{n,n,n}}]["DetourIndex"]

seq=Table[GraphData[{"CompleteTripartite",{n,n,n}},"DetourIndex"],{n,10}]

FindSequenceFunction[DeleteMissing@seq,n]//Factor

Table[3n(3n-1)^2/2,{n,10}]

CrossedPrism

seq=Table[GraphData[{"CrossedPrism",2n},"DetourIndex"],{n,2,10}]

FindSequenceFunction[%,n-1]//Factor

Table[4 n (1-5 n+8 (n^2)),{n,2,10}]

Crown

seq=Table[GraphData[{"Crown",n},"DetourIndex"],{n,20}]

FindSequenceFunction[Drop[seq,2],n-2]//Factor

FindGeneratingFunction[i,x]//Factor

Series[%x^3,{x,0,10}]

SeriesCoefficient[-((-63+68 x-27 (x^2)-8 (x^3)+6 (x^4))/(((-1+x))^4)) x^3,{x,0,n}]

Factor[n (2-5 n+4 (n^2))]

Select[GraphData["Crown"],GraphData[#,"DetourIndex"]=!=With[{n="Crown"/.GraphData[#,"NotationRules"]},Piecewise[{{63,n==3}},n (2-5 n+4 n^2)]]&]

CubeConnectedCycle

A296777

Entity["Graph",{"CubeConnectedCycle",n}]["DetourIndex"]

seq=Table[GraphData[{"CubeConnectedCycle",n},"DetourIndex"],{n,3,8}]

MatrixForm/@Table[GraphData[{"CubeConnectedCycle",n},"DetourMatrix"],{n,3,8}]

Hamilton-connected for odd n:

Table[GraphData[{"CubeConnectedCycle",n},"HamiltonConnected"],{n,3,8}]

Entity["Graph",{"CubeConnectedCycle",n}]["VertexCount"]

With[{𝓃=2^n n},𝓃(((𝓃-1))^2)/2]//FullSimplify

Table[(2^(-1+n)) n (((-1+(2^n) n))^2),{n,3,10,2}]

Cycle

Entity["Graph",{"Cycle",n}]["DetourIndex"]

seq=Table[GraphData[{"Cycle",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]//FullSimplify

Table[(1/16)  n ((((-1))^(n+1))+ (1-8 n+6 (n^2))),{n,3,20}]

Table[Piecewise[{{n^2(3n-4)/8,Mod[n,2]==0},{(n-1)n(3n-1)/8,Mod[n,2]==1}}],{n,3,20}]

%==seq

DiagonalIntersection

seq=Table[GraphData[{"DiagonalIntersection",n},"DetourIndex"],{n,3,14}]

FindSequenceFunction[seq,n-2]//Head//Timing

FindGeneratingFunction[seq,x]//Head//Timing

Dipyramid

seq=Table[GraphData[{"Dipyramid",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]//FullSimplify

Empty

Entity["Graph",{"Empty",n}]["DetourIndex"]

Table[GraphData[{"Empty",n},"DetourIndex"],{n,30}]

FibonacciCube

A291918

seq=Table[GraphData[{"FibonacciCube",n},"DetourIndex"],{n,15}]

FindSequenceFunction[DeleteMissing@seq,n]

FindSequenceFunction[Drop[DeleteMissing@seq,2],n-2]//Factor

FindLinearRecurrence[Drop[DeleteMissing@seq,2]]

FoldedCube

A296778

seq=Table[GraphData[{"FoldedCube",n},"DetourIndex"],{n,2,10}]

FindSequenceFunction[DeleteMissing@seq,n-1]

Hamilton-connected for odd n:

Table[GraphData[{"FoldedCube",n},"HamiltonConnected"],{n,2,10}]

Table[GraphData[{"FoldedCube",n},"V"],{n,2,10}]

FindSequenceFunction[%,n-1]//Factor

With[{𝓃=(2^(n-1))},𝓃(((𝓃-1))^2)/2]//FullSimplify

Table[(2^(-4+n)) (((-2+(2^n)))^2),{n,3,10,2}]

Table[(2^(-4+n)) (((-2+(2^n)))^2),{n,2,10}]

Gear

A033430

seq=Table[GraphData[{"Gear",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]//Factor

Table[4n^3,{n,0,20}]

FindGeneratingFunction[%,x]

CoefficientList[Series[((4 x (1+4 x+(x^2)))/(((-1+x))^4)),{x,0,20}],x]

Grid m×n

Entity["Graph",{"Grid",{m,n}}]["DetourIndex"]

Grid n×n

A296779

Entity["Graph",{"Grid",{n,n}}]["DetourIndex"]

seq=Table[GraphData[{"Grid",{n,n}},"DetourIndex"],{n,10}]

FindSequenceFunction[DeleteMissing@seq[[;;;;2]],n]

FindSequenceFunction[DeleteMissing@seq[[2;;;;2]],n]

gf=x FindGeneratingFunction[DeleteMissing@seq,x]

Table[Sort@Tally[Flatten[GraphData[{"Grid",{n,n}},"DetourMatrix"]]],{n,6}]//Column

Table[GraphData[{"Grid",{n,n}},"HamiltonConnected"],{n,10}]

seq=Table[If[OddQ[n],(1/2)*(n-1)^3*(n+1)^3,(1/4)*n^2*(2*n^4-5*n^2+4)],{n,30}]

FindSequenceFunction[seq,n]//Head//Timing

FindSequenceFunction[seq[[;;;;2]],(n+1)/2]//Factor

FindSequenceFunction[seq[[2;;;;2]],n/2]//Factor

Table[Piecewise[{{n^2(2n^4-5n^2+4)/4,Mod[n,2]==0},{(n-1)^3(n+1)^3/2,Mod[n,2]==1}}],{n,30}]

coef=FindLinearRecurrence[seq]

Length[coef]

Take[seq,12]

LinearRecurrence[{2,4,-10,-5,20,0,-20,5,10,-4,-2,1},{0,16,256,1744,6912,21744,55296,126016,256000,487600,864000,1467216},30]

FindGeneratingFunction[seq,x]//Head//Timing

FindGeneratingFunction[Take[seq,20],x]//Head//Timing

16*x^2*(1+14*x+73*x^2+160*x^3+224*x^4+160*x^5+73*x^6+14*x^7+x^8)/((1-x)^7*(1+x)^5)

CoefficientList[Series[((16 x(1+14 x+73 (x^2)+160 (x^3)+224 (x^4)+160 (x^5)+73 (x^6)+14 (x^7)+(x^8)))/((((1-x))^7) (((1+x))^5))),{x,0,20}],x]

Grid k×m×n

Entity["Graph",{"Grid",{k,m,n}}]["DetourIndex"]

Grid n×n×n

A296780

Entity["Graph",{"Grid",{n,n,n}}]["DetourIndex"]

seq=Table[GraphData[{"Grid",{n,n,n}},"DetourIndex"],{n,10}]

Table[Sort@Tally[Flatten[GraphData[{"Grid",{n,n,n}},"DetourMatrix"]]],{n,3}]//Column

({{\[Piecewise], ({{(1/2) (n^3) ((n^6)-((5 (n^3))/2)+2), (Mod[n, 2])==0}, {(1/2) (((n-1))^3) ((((n^2)+n+1))^3), (Mod[n, 2])==1}})}})

seq=Table[Piecewise[{{n^3(n^6-5n^3/2+2)/2,Mod[n,2]==0},{(n-1)^3(n^2+n+1)^3/2,Mod[n,2]==1}}],{n,50}]

coef=FindLinearRecurrence[seq]

Length@coef

Take[seq,Length@coef]

LinearRecurrence[{3,4,-20,0,56,-28,-84,70,70,-84,-28,56,0,-20,4,3,-1},{0,184,8788,126016,953312,4980744,20000844,66781696,192914176,498751000,1176318500,2576159424,5295012768,10321114216,19204598812,34338770944,59257739264},20]

FindGeneratingFunction[seq,x]//Head//Timing

CoefficientList[Series[4 x (46+2059 x+24729 (x^2)+135948 (x^3)+448126 (x^4)+938845 (x^5)+1358863 (x^6)+1346304 (x^7)+941714 (x^8)+442773 (x^9)+138599 (x^10)+25508 (x^11)+2482 (x^12)+83 (x^13)+(x^14))/((((1-x))^10) (((1+x))^7)),{x,0,20}],x]

HalvedCube

seq=Table[GraphData[{"HalvedCube",n},"DetourIndex"],{n,10}]

FindSequenceFunction[seq,n]//FullSimplify

Hanoi

Table[GraphData[{"Hanoi",n},"DetourIndex"],{n,5}]

Helm

A181617

seq=Table[GraphData[{"Helm",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]//Factor

Table[2 (n^2) (n+1),{n,0,20}]

Hypercube

A288720

Entity["Graph",{"Hypercube",n}]["DetourIndex"]

seq=Table[GraphData[{"Hypercube",n},"DetourIndex"],{n,10}]

Table[GraphData[{"Hypercube",n},"HamiltonConnected"],{n,10}]

FindSequenceFunction[seq,n]//FullSimplify

Table[(2^(n-2))((2^(2n+1))-5 (2^n)+4),{n,10}]

FindLinearRecurrence[seq]

gf=x FindGeneratingFunction[seq,x]

Keller

Entity["Graph",{"Keller",n}]["DetourIndex"]

seq=Table[GraphData[{"Keller",n},"DetourIndex"],{n,5}]

FindSequenceFunction[{1800,127008,8323200},n-1]

Hamilton-connected for n > 1

Table[GraphData[{"Keller",n},"HamiltonConnected"],{n,5}]

With[{𝓃=Entity["Graph",{"Keller",n}]["VertexCount"]},𝓃(((𝓃-1))^2)/2]//FullSimplify

Table[(2^(2 n-1)) ((((4^n)-1))^2),{n,5}]

King n×n

A288959

seq=Table[GraphData[{"King",{n,n}},"DetourIndex"],{n,10}]

FindSequenceFunction[seq,n]//Factor

18((Binomial[n+1,3])^2)

18((Binomial[Range[0,20]+2,3])^2)

Knight m×n

Entity["Graph",{"Knight",{k,n}}]["DetourIndex"]

Knight n×n

A296781

Entity["Graph",{"Knight",{n,n}}]["DetourIndex"]

seq=Table[GraphData[{"Knight",{n,n}},"DetourIndex"],{n,20}]

Table[Sort@Tally[Flatten[GraphData[{"Knight",{n,n}},"DetourMatrix"]]],{n,4,6}]//Column

Table[GraphData[{"Knight",{n,n}},"HamiltonConnected"],{n,20}]

Ladder

Entity["Graph",{"Ladder",n}]["DetourIndex"]

seq=Table[GraphData[{"Ladder",n},"DetourIndex"],{n,20}]

FullSimplify[FindSequenceFunction[seq,n],n∈Integers&&n>0]

FindGeneratingFunction[i,x]

(* off by factor of x; bug(311331) *)

SeriesCoefficient[x((1+13 x+21 (x^2)+9 (x^3)+4 (x^4))/((((-1+x))^4) (1+x))),{x,0,n}]

Table[(1/4) (-15-(((-1))^n)+28 n-26 (n^2)+16 (n^3)),{n,20}]

(1/4) (-15-(((-1))^n)+28 n-26 (n^2)+16 (n^3))//TraditionalForm

Select[GraphData["Ladder"],GraphData[#,"DetourIndex"]=!=With[{n="Ladder"/.GraphData[#,"NotationRules"]},1/4 (-15-(-1)^n+28 n-26 n^2+16 n^3)]&]

LadderRung

Table[GraphData[{"LadderRung",n},"DetourIndex"],{n,5}]

MengerSponge

Table[GraphData[{"MengerSponge",n},"DetourIndex"],{n,3}]

MoebiusLadder

Entity["Graph",{"MoebiusLadder",n}]["DetourIndex"]

seq=Table[GraphData[{"MoebiusLadder",n},"DetourIndex"],{n,3,25}]

FindSequenceFunction[seq,n-2]//FullSimplify

Table[(1/2) n ((((-1))^n) (n-1)+(3-9 n+8 (n^2))),{n,3,20}]

Mycielski

Entity["Graph",{"Mycielski",n}]["DetourIndex"]

seq=Table[GraphData[{"Mycielski",n},"DetourIndex"],{n,11}]

FindLinearRecurrence[Drop[seq,3]]

Table[GraphData[{"Mycielski",n},"HamiltonConnected"],{n,11}]

Entity["Graph",{"Mycielski",n}]["VertexCount"]

With[{v=(3 (2^(n-2))-1)},v(v-1)^2/2]

With[{v=(3 (2^(n-2))-1)},v(v-1)^2/2]//FullSimplify

Table[Piecewise[{{0,n==1},{35,n==3}},(1/2) (((-2+3 (2^(-2+n))))^2) (-1+3 (2^(-2+n)))],{n,11}]

%==seq

seq=Table[Piecewise[{{0,n==1},{35,n==3}},(((3 (2^(n-2))-2))^2) (3 (2^(n-2))-1)/2],{n,15}]

FindLinearRecurrence[Drop[seq,3]]

Odd

Entity["Graph",{"Odd",n}]["DetourIndex"]

seq=Table[GraphData[{"Odd",n},"DetourIndex"],{n,7}]

FindSequenceFunction[Rest@DeleteMissing@seq,n-1]

Table[GraphData[{"Odd",n},"HamiltonConnected"],{n,7}]

Entity["Graph",{"Odd",n}]["VertexCount"]

With[{v=Binomial[-1+2 n,-1+n]},v(v-1)^2/2]

FullSimplify[%]

seq=Table[Piecewise[{{390,n==3}},(((Binomial[2 n-1,n-1]-1))^2) Binomial[2 n-1,n-1]/2],{n,20}]

FindLinearRecurrence[Drop[seq,3]]

FindGeneratingFunction[Drop[seq,3],x]//Head//Timing

GraphData[{"Odd",3},"DetourMatrix"]//TraditionalForm

Pan

seq=Table[GraphData[{"Pan",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]//FullSimplify

(1/16) (2+n+4 (n^2)+6 (n^3)+(((-1))^(1+n)) (2+n))//TraditionalForm

Table[(1/16) (2+n+4 (n^2)+6 (n^3)+(((-1))^(1+n)) (2+n)),{n,3,20}]

Path

A000292

Entity["Graph",{"Path",n}]["DetourIndex"]

Table[GraphData[{"Path",n},"DetourIndex"],{n,20}]

FindSequenceFunction[%,n]//Factor

PathComplement

Table[GraphData[{"PathComplement",n},"DetourIndex"],{n,20}]

seq=Table[GraphData[{"PathComplement",n},"DetourIndex"],{n,6,20}]

FindSequenceFunction[seq,n-5]//Factor

PermutationStar

A296782

Table[GraphData[{"PermutationStar",n},"DetourIndex"],{n,5}]

Table[GraphData[{"PermutationStar",n},"HamiltonConnected"],{n,5}]

Prism

Entity["Graph",{"Prism",n}]["DetourIndex"]

Table[GraphData[{"Prism",n},"DetourIndex"],{n,3,25}]

FindSequenceFunction[%,n-2]//FullSimplify

Table[(1/2) n ((((-1))^(n+1)) (n-1)+(3-9 n+8 (n^2))),{n,3,20}]

Select[GraphData["Prism"],GraphData[#,"DetourIndex"]=!=With[{n="Prism"/.GraphData[#,"NotationRules"]},1/2 (-1)^n n (1-n+(-1)^n (3+n (-9+8 n)))]&]

Queen n×n

A288959

seq=Table[GraphData[{"Queen",{n,n}},"DetourIndex"],{n,10}]

FindSequenceFunction[Drop[seq,2],n-2]//FullSimplify

Rook n×n

A288959

seq=Table[GraphData[{"Rook",{n,n}},"DetourIndex"],{n,10}]

FindSequenceFunction[Drop[seq,2],n-2]//FullSimplify

Table[(1/2) (n^2) (((-1+(n^2)))^2),{n,10}]

FindGeneratingFunction[{16,288,1800,7200,22050,56448,127008,259200},x]//Factor

Series[-((2 (8+88 x+60 (x^2)+44 (x^3)-35 (x^4)+21 (x^5)-7 (x^6)+(x^7))x)/(((-1+x))^7)),{x,0,10}]

RookComplement n×n

A288959

seq=Table[GraphData[{"RookComplement",{n,n}},"DetourIndex"],{n,10}]

FindSequenceFunction[Drop[seq,2],n-2]//FullSimplify

SierpinskiCarpet

Table[GraphData[{"SierpinskiCarpet",n},"DetourIndex"],{n,4}]

Table[GraphData[{"SierpinskiCarpet",n},"HamiltonConnected"],{n,4}]

Table[Sort@Tally[Flatten[GraphData[{"SierpinskiCarpet",n},"DetourMatrix"]]],{n,2}]//Column

SierpinskiSieve

A296783

seq=Table[GraphData[{"SierpinskiSieve",n},"DetourIndex"],{n,5}]

Table[GraphData[{"SierpinskiSieve",n},"HamiltonConnected"],{n,5}]

FindSequenceFunction[DeleteMissing@seq,n]//Factor

SierpinskiSponge

seq=Table[GraphData[{"SierpinskiSponge",n},"DetourIndex"],{n,2,6}]

FindSequenceFunction[DeleteMissing@seq,n-1]

SierpinskiTetrahedron

seq=Table[GraphData[{"SierpinskiTetrahedron",n},"DetourIndex"],{n,6}]

Table[GraphData[{"SierpinskiTetrahedron",n},"HamiltonConnected"],{n,5}]

Table[GraphData[{"SierpinskiTetrahedron",n},"V"],{n,6}]

FindSequenceFunction[%,n]

Table[With[{v=(1/2) (4+(2^(2 n)))},v(v-1)^2/2],{n,6}]

With[{v=(1/2) (4+(2^(2 n)))},v(v-1)^2/2]

FullSimplify[%]

Table[(1/4)((((4^n)+2))^2)((4^(n-1))+1),{n,6}]

Table[((((2^(2n-1))+1))^2)((4^(n-1))+1),{n,6}]

Star

A000290

Entity["Graph",{"Star",n}]["DetourIndex"]

seq=Table[GraphData[{"Star",n},"DetourIndex"],{n,25}]

FindSequenceFunction[seq,n]//FullSimplify

Select[GraphData["Star"],GraphData[#,"DetourIndex"]=!=With[{n="Star"/.GraphData[#,"NotationRules"]},(n-1)^2]&]

Sun

seq=Table[GraphData[{"Sun",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]//FullSimplify

Sunlet

seq=Table[GraphData[{"Sunlet",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]//FullSimplify

Table[(1/4) n ((((-1))^(n+1)) +3 (-1+2 (n^2))),{n,3,20}]

Tetrahedral

seq=Table[GraphData[{"Tetrahedral",n},"DetourIndex"],{n,6,10}]

FindSequenceFunction[seq,n-5]

Table[GraphData[{"Tetrahedral",n},"HamiltonConnected"],{n,6,10}]

Table[GraphData[{"Tetrahedral",n},"V"],{n,6,10}]

FindSequenceFunction[%,n-5]//Factor

Binomial[n,3]

Table[With[{v=Binomial[n,3]},v(v-1)^2/2],{n,10}]

With[{v=Binomial[n,3]},v(v-1)^2/2]//FullSimplify

(1/2) (Binomial[n, 3]) ((((Binomial[n, 3])-1))^2)

TorusGrid n×n

A296784

({{\[Piecewise], ({{(1/4) (n^2) (2 (n^4)-5 (n^2)+4), (Mod[n, 2])==0}, {(1/2) (n^2) ((((n^2)-1))^2), (Mod[n, 2])==1}})}})

seq=Table[GraphData[{"TorusGrid",{n,n}},"DetourIndex"],{n,3,10}]

FindSequenceFunction[DeleteMissing@seq[[2;;;;2]]]

Hamilton connected for odd n

Table[GraphData[{"TorusGrid",{n,n}},"HamiltonConnected"],{n,3,10}]

Table[GraphData[{"TorusGrid",{n,n}},"V"],{n,3,10}]

FindSequenceFunction[%,n-2]//Factor

Table[With[{v=(n^2)},v(v-1)^2/2],{n,3,10}]

With[{v=(n^2)},v(v-1)^2/2]//FullSimplify

n^2*(2*n^4-5*n^2+4)/4

seq=Table[Piecewise[{{n^2(2n^4-5n^2+4)/4,Mod[n,2]==0},{n^2(n^2-1)^2/2,Mod[n,2]==1}}],{n,3,30}]

coef=FindLinearRecurrence[seq]

Length[coef]

Take[seq,12]

LinearRecurrence[{2,4,-10,-5,20,0,-20,5,10,-4,-2,1},{288,1744,7200,21744,56448,126016,259200,487600,871200,1467216,2384928,3716944},20]

FindSequenceFunction[seq[[2;;;;2]],n/2-1]//Factor

FindGeneratingFunction[seq,x]//Head//Timing

16*x^3*(18+73*x+160*x^2+203*x^3+190*x^4+69*x^5-4*x^6+6*x^7+10*x^8-4*x^9-2*x^10+x^11)/((1-x)^7*(1+x)^5)

CoefficientList[Series[((16(18+73 x+160 (x^2)+203 (x^3)+190 (x^4)+69 (x^5)-4 (x^6)+6 (x^7)+10 (x^8)-4 (x^9)-2 (x^10)+(x^11)))/((((1-x))^7) (((1+x))^5))),{x,0,20}],x]

Transposition

A296785

Entity["Graph",{"Transposition",n}]["DetourIndex"]

seq=Table[GraphData[{"Transposition",n},"DetourIndex"],{n,6}]

Table[GraphData[{"Transposition",n},"HamiltonConnected"],{n,6}]

seq={0,1,69,6216,846120,185976720,63980285040,32772128296320,23892198317930880,23892346459702828800,31800733054746203116800,54951669873436196523801600,120728819293576143371142220800,331279880265073822312384445491200};

FullSimplify[n!(n!/2-1)^2+(n!/2)^2(n!-1)]

n!*(n!/2-1)^2+(n!/2)^2*(n!-1)

seq=Table[Piecewise[{{0,n==1}},n!(n!(2n!-5)+4)/4],{n,30}]

FindLinearRecurrence[Rest@seq]//Head//Timing

FindSequenceFunction[Rest@seq,n-1]//Head//Timing

FindGeneratingFunction[seq,x]//Head//Timing

Triangular

seq=Table[GraphData[{"Triangular",n},"DetourIndex"],{n,3,12}]

FullSimplify[FindSequenceFunction[seq,n-2],n∈Integers]

TriangularGrid

A288719

seq=Table[GraphData[{"TriangularGrid",n},"DetourIndex"],{n,10}]

Table[GraphData[{"TriangularGrid",n},"HamiltonConnected"],{n,10}]

FindSequenceFunction[Drop[seq,3],n-2]

gf=x FindGeneratingFunction[seq,x]

seq=Table[Piecewise[{{0,n==0},{6,n==1},{69,n==2},{399,n==3}},n^2 (n+1) (n+2) (n+3)^2/16-3],{n,20}]

({{\[Piecewise], ({{0, n==0}, {6, n==1}, {69, n==2}, {399, n==3}, {(1/16) (n^2) (n+1) (n+2) (((n+3))^2)-3, True}})}})

seq=Table[n^2 (n+1) (n+2) (n+3)^2/16-3,{n,20}]

FindLinearRecurrence[seq]

Web

seq=Table[GraphData[{"Web",n},"DetourIndex"],{n,3,20}]

FindSequenceFunction[seq,n-2]

gf=(x^3) FindGeneratingFunction[seq,x]

Series[((189+263 x-49 (x^2)-106 (x^3)+139 (x^4)+41 (x^5)-45 (x^6))/((((-1+x))^4) (((1+x))^3)))(x^3),{x,0,10}]

SeriesCoefficient[gf,{x,0,n}]//FullSimplify

Table[(1/8) n (72n^2-61n+22+(10-9n) (((-1))^n)),{n,3,20}]

Wheel

Entity["Graph",{"Wheel",n}]["DetourIndex"]

A002411

Table[GraphData[{"Wheel",n},"DetourIndex"],{n,4,20}]

FindSequenceFunction[%,n-3]//FullSimplify

Select[GraphData["Wheel"],GraphData[#,"DetourIndex"]=!=With[{n="Wheel"/.GraphData[#,"NotationRules"]},(n-1)^2 n/2]&]

WhiteBishop n×n

seq=Table[GraphData[{"WhiteBishop",{n,n}},"DetourIndex"],{n,2,10}]

FindSequenceFunction[seq,n-1]

gf=x FindGeneratingFunction[seq,x]

Table[GraphData[{"WhiteBishop",{n,n}},"HamiltonConnected"],{n,2,10}]

Table[GraphData[{"WhiteBishop",{n,n}},"V"],{n,2,10}]

seq={2,4,8,12,18,24,32,40,50};

FindSequenceFunction[{2,4,8,12,18,24,32,40,50},n-1]

FullSimplify[%,n∈Integers]

Table[With[{v=(1/4) (-1+(((-1))^n)+2 (n^2))},v(v-1)^2/2],{n,10}]

FullSimplify[With[{v=(1/4) (-1+(((-1))^n)+2 (n^2))},v(v-1)^2/2],n∈Integers]

Table[Piecewise[{{16,n==3},{194,n==4}},(1/128) (((-5+(((-1))^n)+2 (n^2)))^2) (-1+(((-1))^n)+2 (n^2))],{n,2,10}]