Wiener Index

Author

Eric W. Weisstein
April 19, 2020

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

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

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

Missing

DateString[]

GraphData["WienerIndex","Missing"]

Identities

Y.-N. Yeh and I. Gutman. On the sum of all distances in composite graphs.
Discrete Mathematics, 135(1-3):359–365, 1994.

DeleteCases[Flatten[Table[{
{m,n},
GraphData[{"Grid",{m,n}},"WienerIndex"],
(m^2)GraphData[{"Path",n},"WienerIndex"]+(n^2)GraphData[{"Path",m},"WienerIndex"]
},{n,10},{m,n}],1],{_,x_,x_}]

DeleteCases[Flatten[Table[{
{m,n},
GraphData[{"TorusGrid",{m,n}},"WienerIndex"],
(m^2)GraphData[{"Cycle",n},"WienerIndex"]+(n^2)GraphData[{"Cycle",m},"WienerIndex"]
},{n,3,10},{m,3,n}],1],{_,x_,x_}]

Parametrized families

GraphDataCountTable["WienerIndex"]

Andrasfai

A292018

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

FindSequenceFunction[seq,n]//FullSimplify

seq=Table[(5n-4)(3n-1)/2,{n,50}]

FindLinearRecurrence[seq]

LinearRecurrence[{3,-3,1},{1,15,44},20]

gf=x FindGeneratingFunction[seq,x]

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

Antelope n×n

A292039

seq=Table[GraphData[{"Antelope",{n,n}},"WienerIndex"],{n,10}]

(seq=Monitor[Table[WienerIndex[AntelopeGraph[n,n]],{n,50}],n])//Timing

seq={0,∞,∞,∞,∞,∞,∞,11548,16660,24320,35548,50572,70036,94812,125968,164564,211632,268576,336952,418136,513764,625848,756484,907584,1081368,1280708,1508184,1766420,2058648,2388508,2759076,3174148,3637872,4154736,4728784,5364824,6068036,6844000,7697708,8635076,9662444,10786620,12013632,13350628,14805240,16385612,18098888,19953568,21958704,24123888};

FindLinearRecurrence[Drop[seq,7]]

FindLinearRecurrence[Drop[seq,9]]

FindSequenceFunction[Drop[seq,7],n-6]

gf=(x^8)FindGeneratingFunction[Drop[seq,7],x]

Antiprism

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

A002411

seq=Table[GraphData[{"Antiprism",n},"WienerIndex"],{n,3,20}]

seq=Table[WienerIndex[AntiprismGraph[n]],{n,3,20}]

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

Apollonian

A289022

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

seq={6,27,204,1941,19572,198567,1999056,19931337,196939572,1930784091,18802964760,182062831005,1754100012108,16826739416271,160799296563312,1531421717572401,14540848734272388,137690120683444995,1300613432805623496,1225814203971788454};

FindLinearRecurrence[seq]

gf=((x (6-111 x+627 (x^2)-741 (x^3)-1497 (x^4)+2862 (x^5)-5670 (x^6)+8748 (x^7)))/((1-x) (((1-3 x))^2) (((1-9 x))^2) (1+2 x) (1+2 (x^2))));

Series[gf,{x,0,20}]

seq=CoefficientList[Series[((6-111 x+627 (x^2)-741 (x^3)-1497 (x^4)+2862 (x^5)-5670 (x^6)+8748 (x^7))/((1-x) (((1-3 x))^2) (((1-9 x))^2) (1+2 x) (1+2 (x^2)))),{x,0,50}],x]

coef=FindLinearRecurrence[seq]

Take[seq,Length@coef]

LinearRecurrence[{23,-174,448,-29,-1221,2088,-4050,2916},{6,27,204,1941,19572,198567,1999056,19931337},20]

FullSimplify[SeriesCoefficient[gf,{x,0,n}],n>0&&n∈Integers]

Table[((6655+31 (((-1))^n) (2^(n+2))+5 (3^(1+2 n)) (24+11 n)+(3^(n+1)) (1197+55 n)+5 (2^(5+(n/2))) Cos[((n π)/2)]-155 (2^((3+n)/2)) Sin[((n π)/2)])/3630),{n,20}]

Bishop n×n

seq=Table[GraphData[{"Bishop",{n,n}},"WienerIndex"],{n,10}]

BlackBishop n×n

A292051

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

(seq=Table[WienerIndex[BlackBishopGraph[n,n]],{n,20}])//Timing

FindSequenceFunction[seq,n]

coef=FindLinearRecurrence[seq]

Take[seq,Length@coef]

LinearRecurrence[{2,2,-6,0,6,-2,-2,1},{0,1,14,42,124,251,506,852},40]

gf=x FindGeneratingFunction[seq,x]

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

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

Factor[{3-10 n+6 (n^2)-8 (n^3)+6 (n^4),(1+2 (-1+n) n)}]

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

Bruhat

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

FindSequenceFunction[seq,n]

FindSequenceFunction[Rest@seq,n-1]

(seq=Table[WienerIndex[BruhatGraph[n]],{n,7}])//Timing

Do[Print[{k,FindSequenceFunction[Drop[seq,k],n-k]//Head//Timing}],{k,0,3}]

Centipede

seq=Table[GraphData[{"Centipede",n},"WienerIndex"],{n,10}]

FindSequenceFunction[seq,n]//Factor

CocktailParty

A001105

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

FindSequenceFunction[Drop[l,1]][n-1]//Simplify

Complete

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

A000217

seq=Table[GraphData[{"Complete",n},"WienerIndex"],{n,20}]

Table[WienerIndex[System`CompleteGraph[n]],{n,30}]

Table[n(n-1)/2,{n,20}]

CompleteBipartite m×n

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

CompleteBipartite n×n

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

A000567

seq=Table[GraphData[{"CompleteBipartite",{n,n}},"WienerIndex"],{n,20}]

FindLinearRecurrence[seq]

LinearRecurrence[{3,-3,1},{1,8,21},{0,20}]

FindSequenceFunction[seq,n]//Factor

PolygonalNumber[8, Range[0,20]]

CompleteTripartite k×m×n

Entity["Graph",{"CompleteTripartite",{k,m,n}}]["WienerIndex"]

CompleteTripartite n×n×n

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

A094159

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

FindLinearRecurrence[seq]

LinearRecurrence[{3,-3,1},{3,18,45},{0,20}]

FindSequenceFunction[seq,n]//Factor

Table[3n(2n-1),{n,0,20}]

3PolygonalNumber[6,Range[0,20]]

CrossedPrism

A292022

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

FindSequenceFunction[seq,n-1]//Factor

seq=Table[4n((n^2)+2),{n,50}]

coef=FindLinearRecurrence[seq]

Take[seq,Length@coef]

LinearRecurrence[{4,-6,4,-1},{12,48,132,288},20]

gf=x FindGeneratingFunction[seq,x]

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

Crown

A033428

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

FindSequenceFunction[seq,n-2]//Factor

FindLinearRecurrence[seq]

CubeConnectedCycle

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

A292028

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

Do[Print[{{"CubeConnectedCycle",n},WienerIndex[CubeConnectedCycleGraph[n]]//Timing}],{n,3,10}]

seq={1,64,888,9472,76160,556032,3605504,22224896,128471040,719708160,3874455552,20416954368,104732426240,528985096192,2620635217920,12831147687936,61916622880768,296036213981184,1399459946692608,6566769862901760};

FindSequenceFunction[seq,n]

FindLinearRecurrence[Drop[seq,3]]

gf=x FindGeneratingFunction[seq,x]

Cycle

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

3/4 Binomial[n+1,3]//Expand//FullSimplify

n((n^2)-1)/8

Sela Fried.  The disorder number of a graph. 7 Aug 2022.  https://arxiv.org/abs/2208.03788

A034828

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

FindSequenceFunction[seq,n-2]/FullSimplify

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

Table[Floor[n^2/4]n/2,{n,3,20}]

DiagonalIntersection

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

Do[Print[{k,FindSequenceFunction[Drop[seq,k],n-k]//Head//Timing}],{k,0,3}]

Dipyramid

seq=Table[GraphData[{"Dipyramid",n},"WienerIndex"],{n,3,14}]

FindSequenceFunction[seq,n-2]//Factor

Empty

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

Table[WienerIndex[EmptyGraph[n]],{n,20}]

FibonacciCube

A238419

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

FindLinearRecurrence[seq]

LinearRecurrence[{4,0,-10,0,4,-1},{1,4,16,54,176,548},20]

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

gf=x FindGeneratingFunction[seq,x]

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

Table[(n LucasL[2(n+2)]+2Fibonacci[2n+1]-(n+2)(-1)^n)/25,{n,0,20}]

Fiveleaper n×n

A292040

seq=Table[GraphData[{"Fiveleaper",{n,n}},"WienerIndex"],{n,10}]

Do[Print[{{"Fiveleaper",{n,n}},WienerIndex[FiveleaperGraph[n,n]]//Timing}],{n,50}]

seq={0,∞,∞,∞,∞,∞,∞,6364,9888,15216,22664,32648,45728,62656,84196,111200,144552,185368,234908,294504,365528,449552,548384,663924,798252,953504,1132044,1336532,1569696,1834540,2134116,2471732,2851024,3275772,3750056,4277980,4863920,5512736,6229396,7019180,7887380,8839704,9882348,11021592,12264068,13616520,15086080,16680416,18407280,20274912};

FindLinearRecurrence[Drop[seq,7]]

FindLinearRecurrence[Drop[seq,9]]

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

gf=(x^8)FindGeneratingFunction[Drop[seq,7],x]

FoldedCube

A292029

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

Do[Print[{{"FoldedCube",n},WienerIndex[FoldedCubeGraph[n]]//Timing}],{n,2,20}]

seq={1,6,40,200,1056,4928,23808,107136,494080,2173952,9744384,42225664,185679872,795770880,3451518976,14668955648};

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

seq=Table[DifferenceRoot[Function[{\[FormalY],\[FormalN]},{(-512-256 \[FormalN]) \[FormalY][\[FormalN]]+(320+128 \[FormalN]) \[FormalY][1+\[FormalN]]+(-28-8 \[FormalN]) \[FormalY][3+\[FormalN]]+(4+\[FormalN]) \[FormalY][4+\[FormalN]]==0,\[FormalY][1]==1,\[FormalY][2]==6,\[FormalY][3]==40,\[FormalY][4]==200}]][n],{n,100}]

Head/@Table[FindLinearRecurrence[Drop[seq,k]],{k,0,3}]

(gf=x FindGeneratingFunction[seq,x])//Timing

FullSimplify[gf]

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

SeriesCoefficient[((1+4 x-(Sqrt[1-16 (x^2)]))/(4 x(((1-4 x))^2) (1+4 x))),{x,0,n}]

FunctionExpand[%155,n>0]

Table[DifferenceRoot[Function[{\[FormalY],\[FormalN]},{(-1+\[FormalN]) (-1+(((-1))^n)+2 \[FormalN]-2 n) \[FormalY][\[FormalN]]-(-1+\[FormalN]) (-1+(((-1))^n)+2 \[FormalN]-2 n) \[FormalY][1+\[FormalN]]-(2+\[FormalN]) (-5+(((-1))^n)+2 \[FormalN]-2 n) \[FormalY][2+\[FormalN]]+(2+\[FormalN]) (-5+(((-1))^n)+2 \[FormalN]-2 n) \[FormalY][3+\[FormalN]]==0,\[FormalY][-1]==0,\[FormalY][0]==0,\[FormalY][1]==(4^n) (5+(((-1))^(1+n))+2 n)}]][2+n],{n,100}]

{(-1+\[FormalN]) (-1+(((-1))^n)+2 \[FormalN]-2 n) \[FormalY][\[FormalN]]-(-1+\[FormalN]) (-1+(((-1))^n)+2 \[FormalN]-2 n) \[FormalY][1+\[FormalN]]-(2+\[FormalN]) (-5+(((-1))^n)+2 \[FormalN]-2 n) \[FormalY][2+\[FormalN]]+(2+\[FormalN]) (-5+(((-1))^n)+2 \[FormalN]-2 n) \[FormalY][3+\[FormalN]]==0,\[FormalY][-1]==0,\[FormalY][0]==0,\[FormalY][1]==(4^n) (5+(((-1))^(1+n))+2 n)}/.\[FormalN]->n+2//Simplify

RSolve[{{(3+(((-1))^n)) (1+n) \[FormalY][2+n]==(3+(((-1))^n)) (1+n) \[FormalY][3+n]+(-1+(((-1))^n)) (4+n) (\[FormalY][4+n]-\[FormalY][5+n]),\[FormalY][-1]==0,\[FormalY][0]==0,\[FormalY][1]==(4^n) (5+(((-1))^(1+n))+2 n)}},\[FormalY][n], n]

FindLinearRecurrence[%]

x FindGeneratingFunction[%%,x]

seq=Table[(2^(n-3))n((2^(n-1))-Binomial[n-1,Floor[(n-1)/2]]),{n,2,100}]

FullSimplify[(x^2)FindGeneratingFunction[seq,x]]

FindLinearRecurrence[seq]//Head

FindLinearRecurrence[Drop[seq,5]]//Head

Gear

A049598

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

FindSequenceFunction[seq,n-2]//Factor

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

12PolygonalNumber[3,Range[0,20]]

12Binomial[Range[20],2]

FindLinearRecurrence[seq]

LinearRecurrence[{3,-3,1},{12,36,72},{0,20}]

Grid m×n

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

DeleteCases[Block[{m,n},Sort[{{m,n}="Grid"/.GraphData[#,"NotationRules"],GraphData[#,"WienerIndex"],m*n*(n+m)*(m*n-1)/6}&/@Select[GraphData["Grid"],Length["Grid"/.GraphData[#,"NotationRules"]]==2&]]],{_,x_,x_}]

Grid n×n

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

Sela Fried.  The disorder number of a graph. 7 Aug 2022.  https://arxiv.org/abs/2208.03788

A143945

m*n*(n+m)*(m*n-1)/6/.m->n

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

FindSequenceFunction[seq,n]//Factor

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

FindLinearRecurrence[seq]

LinearRecurrence[{6,-15,20,-15,6,-1},{0,8,72,320,1000,2520},20]

gf=x FindGeneratingFunction[seq,x]

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

Grid k×m×n

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

Grid n×n×n

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

A292045

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

FindSequenceFunction[seq,n]//Factor

seq=Table[(n-1)(n+1)(n^5)/2,{n,30}]

coef=FindLinearRecurrence[seq]

Take[seq,Length@coef]

LinearRecurrence[{8,-28,56,-70,56,-28,8,-1},{0,48,972,7680,37500,136080,403368,1032192},20]

gf=x FindGeneratingFunction[seq,x]

CoefficientList[Series[((12 x (4+49 x+104 (x^2)+49 (x^3)+4 (x^4)))/(((-1+x))^8)),{x,0,20}],x]

HalvedCube

A292044

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

FindSequenceFunction[Take[l,9]][n]

FindSequenceFunction[Take[l,{2,9}]][n-1]//Simplify

seq=Table[If[n==1,0,(2^(2 n-5)) n],{n,40}]

FindLinearRecurrence[Rest@seq]

Join[{0},LinearRecurrence[{8,-16},{1,6},20]]

gf=x FindGeneratingFunction[seq,x]

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

Hanoi

A290004

seq=Table[GraphData[{"Hanoi",n},"WienerIndex"],{n,5}]

gf=((3 x (1-11 x+28 (x^2)+24 (x^3)))/((1-3 x) (1-9 x) (1-18 x) (1-5 x+2 (x^2))));

Series[((3 x (1-11 x+28 (x^2)+24 (x^3)))/((1-3 x) (1-9 x) (1-18 x) (1-5 x+2 (x^2)))),{x,0,20}]

seq=CoefficientList[Series[((3(1-11 x+28 (x^2)+24 (x^3)))/((1-3 x) (1-9 x) (1-18 x) (1-5 x+2 (x^2)))),{x,0,20}],x]

coef=FindLinearRecurrence[seq]

Take[seq,Length@coef]

LinearRecurrence[{35,-395,1761,-2916,972},{3,72,1419,26580,487839},20]

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

Table[(3/1003) (2^(-n))( (34-3 (Sqrt[17])) (((5-(Sqrt[17])))^n)+ (((5+(Sqrt[17])))^n) (34+3 (Sqrt[17])))-((3^(n+1))/10)+ (9^n)((233/885) (2^n)-(1/6)),{n,10}]//Expand

Table[(3/1003) (2^(-n))( (34-3 (Sqrt[17])) (((5-(Sqrt[17])))^n)+ (((5+(Sqrt[17])))^n) (34+3 (Sqrt[17])))-((3^(n+1))/10)+ (9^n)((233/885) (2^n)-(1/6)),{n,10}]

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

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

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

Table[(3^n),{n,5}]

2Limit[(((3/1003) (2^(-n))( (34-3 (Sqrt[17])) (((5-(Sqrt[17])))^n)+ (((5+(Sqrt[17])))^n) (34+3 (Sqrt[17])))-((3^(n+1))/10)+ (9^n)((233/885) (2^n)-(1/6)))/(((((3^n)))^2)((2^n)-1))),n->∞]

Hypercube

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

Sela Fried.  The disorder number of a graph. 7 Aug 2022.  https://arxiv.org/abs/2208.03788

A002697

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

FindSequenceFunction[seq,n+1]

FindLinearRecurrence[seq]

gf=FindGeneratingFunction[seq,x]

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

Keller

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

A292056

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

Do[Print[{{"Keller",n},WienerIndex[KellerGraph[n]]//Timing}],{n,10}]

seq={∞,200,2944,43392,650240,9889792,152174592};

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

coef=FindLinearRecurrence[Rest@seq]

LinearRecurrence[{36,-432,1984,-3072},{12,200,2944,43392},20]

gf=x FindGeneratingFunction[Rest@seq,x]

CoefficientList[Series[-((8 (-25+532 x-2976 (x^2)+4608 (x^3)))/((((-1+4 x))^2) (1-28 x+192 (x^2)))),{x,0,20}],x]

King n×n

A292053

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

FindLinearRecurrence[seq]

gf=x FindGeneratingFunction[seq,x]

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

Refine[SeriesCoefficient[gf,{x,0,n}],n>0]//Factor

seq=Table[(n-1) n (1+n) (7 (n^2)+2)/30,{n,40}]

coef=FindLinearRecurrence[seq]

Take[seq,Length@coef]

LinearRecurrence[{6,-15,20,-15,6,-1},{0,6,52,228,708,1778},20]

Knight m×n

Entity["Graph",{"Knight",{m,n}}]["WienerIndex"]

Knight n×n

Rewrite linear recurrence as a formula

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

A292054

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

(seq=Monitor[Table[WienerIndex[KnightGraph[n,n]],{n,100}],n])//Timing

seq={0,∞,∞,288,708,1580,3144,5804,9996,16388,25660,38808,56808,81048,112856,154080,206448,272332,353920,454172,575784,722372,897196,1104592,1348436,1633848,1965376,2348992,2789964,3295180,3870688,4524356,5263060,6095716,7030084,8076192,9242736,10540920,11980432,13573720,15331512,17267564,19393704,21725060,24274608,27058916,30092164,33392424,36975132,40859928,45063560,49607304,54509268,59792428,65476312,71585660,78141468,85170308,92694700,100743112,109339640,118514712,128294056,138710128,149790336,161569228,174075952,187347212,201413944,216315076,232083388,248760096,266379876,284986296,304615984,325314928,347121756,370084940,394245168,419653460,446352612,474396260,503829364,534708240,567080064,601003896,636529184,673717800,712621512,753305068,795822616,840241844,886619328,935025764,985520212,1038176440,1093056044,1150235928,1209780280,1271769208};

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

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

FindLinearRecurrence[Drop[seq,3]]

coef=FindLinearRecurrence[Drop[seq,4]]

Length@coef

Take[Drop[seq,4],Length@coef]

Join[{288},LinearRecurrence[{2,1,-3,0,-1,2,2,-1,0,-3,1,2,-1},{708,1580,3144,5804,9996,16388,25660,38808,56808,81048,112856,154080,206448},20]]

gf=(x^4)FindGeneratingFunction[Drop[seq,4],x]

gf=(x^4)FindGeneratingFunction[Take[Drop[seq,4],20],x]

Lollipop

Sela Fried.  The disorder number of a graph. 7 Aug 2022.  https://arxiv.org/abs/2208.03788

MengerSponge

A292036

seq=Table[GraphData[{"MengerSponge",n},"WienerIndex"],{n,3}]

Do[Print[{{"MengerSponge",n},WienerIndex[MengerSpongeGraph[n]]//Timing}],{n,4}]

MoebiusLadder

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

A180857

seq=Table[GraphData[{"MoebiusLadder",n},"WienerIndex"],{n,3,20}]

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

expr2=FullSimplify[Expand[%]/.(((-1))^(2n)):>1]

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

gf=x FindGeneratingFunction[seq,x]

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

FindLinearRecurrence[seq]

LinearRecurrence[{2,1,-4,1,2,-1},{1,6,21,44,85,138},20]

Mycielski

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

A292055

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

FindSequenceFunction[seq,n]

FindSequenceFunction[Rest@seq,n-1]//FullSimplify

seq=Table[If[n==1,0,(216-27 (2^(n+3))-56 (3^n)+81 (4^n))/144],{n,30}]

coef=FindLinearRecurrence[Rest@seq]

Join[{0},LinearRecurrence[{10,-35,50,-24},{1,15,90,435},20]]

gf=x FindGeneratingFunction[seq,x]

CoefficientList[Series[((x (1+5 x-25 (x^2)+10 (x^3)))/(1-10 x+35 (x^2)-50 (x^3)+24 (x^4))),{x,0,20}],x]

Odd

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

Inactive[Sum][a[k],{k,n}]//Activate//TraditionalForm

Inactive[Sum][a[k],{k,n}]//TraditionalForm

A136328

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

seq={0,3,75,1435,25515,436821,7339332,121782375,2005392675,32835436777,535550923908,8707954925033,141270179732500,2287544190032700,36988236910737360,597341791692978975,9637351741503033075 };

FindSequenceFunction[seq,n]

FindSequenceFunction[Rest@seq,n-1]

FindLinearRecurrence[seq]

FindLinearRecurrence[Rest@seq]

Table[1/2 Binomial[2 n-1,n-1] (Sum[((2 j+1) n)/(j+1) Binomial[n-1,j]^2,{j,0,Floor[(n-2)/2]}]+Sum[(2 (n-1-j) n)/(j+1) Binomial[n-1,j]^2,{j,1+Floor[(n-2)/2],n-2}]),{n,20}]

Take[seq=Table[Binomial[2n-1,n-1]/2(Sum[((2j+1)n)/(j+1)Binomial[n-1,j]^2,{j,0,Floor[n/2]-1}]+Sum[(2(n-1-j)n)/(j+1)Binomial[n-1,j]^2,{j,Floor[n/2],n-2}]),{n,100}],20]

Head/@Table[FindLinearRecurrence[Drop[seq,k]],{k,0,4}]

FindGeneratingFunction[seq,x]

Refine[Floor[(k-2)/2],Mod[k,2]==#]&/@{0,1}//Simplify

(1/2) (-3+k)+1//Simplify

FullSimplify[(1/2)Binomial[2k-1,k-1](Sum[(((2j+1)k)/(j+1))((Binomial[k-1,j])^2),{j,0,k/2-1}]+Sum[((2(k-1-j)k)/(j+1))((Binomial[k-1,j])^2),{j,k/2,k-2}])]

FullSimplify[(1/2)Binomial[2k-1,k-1](Sum[(((2j+1)k)/(j+1))((Binomial[k-1,j])^2),{j,0,(1/2) (-3+k)}]+Sum[((2(k-1-j)k)/(j+1))((Binomial[k-1,j])^2),{j,(1/2) (-1+k),k-2}])]

Table[k Binomial[-1+2 k,-1+k] Piecewise[{{((((-1+k) (1+2 (-1+k) k) Gamma[-2+2 k])/((Gamma[1+k])^2))-((3 ((Binomial[-1+k,(k/2)])^2) HypergeometricPFQ[{1,1-(k/2),1-(k/2)},{1+(k/2),2+(k/2)},1])/(2+k))-((4 ((Binomial[-1+k,1+(k/2)])^2) HypergeometricPFQ[{2,2-(k/2),2-(k/2)},{2+(k/2),3+(k/2)},1])/(4+k))),Mod[k,2]==0},{((((-1+k) (1+2 (-1+k) k) Gamma[-2+2 k])/((Gamma[1+k])^2))-((((Binomial[-1+k,(1/2) (-1+k)])^2) HypergeometricPFQ[{1,(1/2)-(k/2),(1/2)-(k/2)},{(1/2)+(k/2),(3/2)+(k/2)},1])/(1+k))-((4 ((Binomial[-1+k,((1+k)/2)])^2) HypergeometricPFQ[{2,(3/2)-(k/2),(3/2)-(k/2)},{(3/2)+(k/2),(5/2)+(k/2)},1])/(3+k))),Mod[k,2]==1}}],{k,10}]

Pan

A180861

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

FindSequenceFunction[seq,n-2]//FullSimplify

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

FindLinearRecurrence[seq]

LinearRecurrence[{2,1,-4,1,2,-1},{8,16,26,42,61,88},{-1,1}]

seq=LinearRecurrence[{2,1,-4,1,2,-1},{1,4,8,16,26,42},20]

gf=x FindGeneratingFunction[seq,x]

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

Path

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

Sela Fried.  The disorder number of a graph. 7 Aug 2022.  https://arxiv.org/abs/2208.03788

A000292

seq=Table[GraphData[{"Path",n},"WienerIndex"],{n,20}]

FindSequenceFunction[seq,n]//Factor

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

FindLinearRecurrence[seq]

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

gf=x FindGeneratingFunction[seq,x]

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

Binomial[Range[20]+1, 3]

PathComplement

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

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

PermutationStar

A284039

Table[GraphData[{"PermutationStar",n},"WienerIndex"],{n,6}]

Do[Print[{n,WienerIndex[PermutationStarGraph[n]]//Timing}],{n,10}]

Construct using:

A007799

a[n_,0]=1;a[n_,1]=n-1;a[n_,2]=(n-1)(n-2);a[n_,k_/;k≥2]:=a[n,k]=(n-1)a[n-1,k-1]+Sum[j a[j,k-3],{j,n-2}];

Sum[j a[j,k-3],{j,n-2}]

Table[a[n,k],{n,1,9},{k,0,Floor[3(n-1)/2]}]//Column

Take[seq=Table[n!/2 Sum[k a[n,k],{k,Floor[3(n-1)/2]}],{n,50}],20]

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

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

Prism

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

A138179

seq=Table[GraphData[{"Prism",n},"WienerIndex"],{n,3,25}]

coef=FindLinearRecurrence[seq]

Take[seq,Length@coef]

LinearRecurrence[{2,1,-4,1,2,-1},{21,48,85,144,217,320},{-1,1}]

seq=LinearRecurrence[{2,1,-4,1,2,-1},{1,8,21,48,85,144},20]

FindSequenceFunction[seq,n]//FullSimplify

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

gf=x FindGeneratingFunction[seq,x]

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

Queen n×n

A292057

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

FindSequenceFunction[seq,n]//Factor

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

FindLinearRecurrence[seq]

LinearRecurrence[{5,-10,10,-5,1},{0,6,44,164,440},20]

gf=x FindGeneratingFunction[seq,x]

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

Rook n×n

A085537

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

FindSequenceFunction[seq,n]

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

FindLinearRecurrence[seq]

LinearRecurrence[{5,-10,10,-5,1},{0,8,54,192,500},{0,20}]

gf=FindGeneratingFunction[seq,x]

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

RookComplement n×n

A292058

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

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

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

FindLinearRecurrence[seq]

LinearRecurrence[{5,-10,10,-5,1},{0,10,54,168,400},20]

gf=x FindGeneratingFunction[seq,x]

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

SierpinskiCarpet

A292025

seq=Table[GraphData[{"SierpinskiCarpet",n},"WienerIndex"],{n,4}]

Do[Print[{{"SierpinskCarpet",n},WienerIndex[SierpinskiCarpetGraph[n]]//Timing}],{n,10}]

seq={64,13224,2535136,485339728,93077094928};

FindSequenceFunction[seq,n]

FindLinearRecurrence[seq]

SierpinskiSieve

A290129

Apparently, there is a formula in the A. Hinz reference.  (eww: not that I can identify.)

A. Hinz, A. Schief, The average distance on the Sierpinski gasket, Probab. Th. Rel. Fields (1990) 87: 129.

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

Do[Print[{{"SierpinskiSieve",n},WienerIndex[SierpinskiSieveGraph[n]]//Timing}],{n,12}]

bug(339509): GraphDistanceMatrix[CycleGraph[250000]] returns $Aborted[]

seq={3,21,246,3765,64032,1130463,20215254,363069729,6530385420,117517503027,2115137375634};

FindLinearRecurrence[seq]

FindLinearRecurrence[Rest@seq]

FindSequenceFunction[seq,n]

gf=x FindGeneratingFunction[seq,x]

SierpinskiTetrahedron

A292026

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

Do[Print[{{"SierpinskiTetrahedron",n},WienerIndex[SierpinskiTetrahedronGraph[n]]//Timing}],{n,10}]

seq={6,66,1476,42984,1343568,42744480,1365843264,43691203200,1397992469760};

FindLinearRecurrence[seq]

seq=LinearRecurrence[{46,-504,1856,-2048},{6,66,1476,42984},20]

gf=x FindGeneratingFunction[seq,x]

CoefficientList[Series[-((6 (-1+35 x-244 (x^2)+464 (x^3)))/(1-46 x+504 (x^2)-1856 (x^3)+2048 (x^4))),{x,0,20}],x]

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

Table[(2^(n-6)) (2016+15 (2^(n+4))+175 (4^(n+1))+89 (16^n))/35,{n,20}]

StackedBook m×n

StackedBook n×n

seq=Table[GraphData[{"StackedBook",{n,n}},"WienerIndex"],{n,10}]

FindSequenceFunction[seq,n]//FullSimplify

Star

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

A000290

seq=Table[GraphData[{"Star",n},"WienerIndex"],{n,20}]

Table[WienerIndex[Star[n]],{n,20}]

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

Sun

A180863

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

FindSequenceFunction[seq,n-2]//Factor

seq=Table[n(4n-5),{n,3,40}]

FindLinearRecurrence[seq]

LinearRecurrence[{3,-3,1},{21,44,75},20]

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

CoefficientList[Series[((-21+19 x-6 (x^2))/(((-1+x))^3)),{x,0,20}],x]

Sunlet

A180574

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

FullSimplify[Expand[FindSequenceFunction[seq,n-2]]/.(((-1))^(k_+2n)):>(((-1))^k),n∈Integers]

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

FindLinearRecurrence[seq]

seq=LinearRecurrence[{2,1,-4,1,2,-1},{27,60,105,174,259,376},20]

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

CoefficientList[Series[((27+6 x-42 (x^2)+12 (x^3)+19 (x^4)-10 (x^5))/((((-1+x))^4) (((1+x))^2))),{x,0,20}],x]

Tetrahedral

A292061

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

(seq=Monitor[Table[WienerIndex[JohnsonGraph[n,3]],{n,6,20}],n])//Timing

FindSequenceFunction[seq,n-5]//Factor

seq=Table[(n-3) (((n-2))^2) (((n-1))^2) n/24,{n,40}]

coef=FindLinearRecurrence[seq]

Length@coef

Take[seq,Length@coef]

LinearRecurrence[{7,-21,35,-35,21,-7,1},{0,0,0,6,60,300,1050},20]

gf=x FindGeneratingFunction[seq,x]

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

TorusGrid n×n

Sela Fried.  The disorder number of a graph. 7 Aug 2022.  https://arxiv.org/abs/2208.03788

A122657

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

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

FindLinearRecurrence[seq]

Expand[FindSequenceFunction[seq,n]]/.(((-1))^(k_.+2n)):>(((-1))^k)

FullSimplify[%,n∈Integers]

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

gf=x FindGeneratingFunction[seq,x]

...wrong...

FindGeneratingFunction[Drop[seq,2],x]

...wrong...

CoefficientList[Series[((2 (x^2) (4 (x^6)+19 (x^5)+62 (x^4)+70 (x^3)+62 (x^2)+19 x+4))/((((x+1))^4) (((x-1))^6))),{x,0,20}],x]

Transposition

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

A292062

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

Do[Print[{{"Transposition",n},WienerIndex[TranspositionGraph[n]]//Timing}],{n,10}]

seq={0,1,21,552,19560,920160,55974240,4293596160,406306575360,46556342784000,6357567896064000,1020650937901056000,190386526063878144000,40844355820490686464000,9987985777548364185600000,2762125829379285162393600000,857790151281459139077734400000};

FindSequenceFunction[seq,n]

FindLinearRecurrence[seq]

FindLinearRecurrence[Rest@seq]

gf=x FindGeneratingFunction[seq,x]

Table[n!(n n!-Abs[StirlingS1[n+1,2]])/2,{n,20}]

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

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

Triangular

A006011

seq=Table[GraphData[{"Triangular",n},"WienerIndex"],{n,2,20}]

FindSequenceFunction[seq,n-1]//Factor

Binomial[Range[20]^2,2]/2

FindLinearRecurrence[seq]

LinearRecurrence[{5,-10,10,-5,1},{0,3,18,60,150},20]

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

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

TriangularGrid

A112851

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

FindSequenceFunction[seq,n+1]//Factor

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

FindLinearRecurrence[seq]

gf=FindGeneratingFunction[seq,x]

TriangularHoneycombAcuteKnight

TriangularHoneycombBishop

TriangularHoneycombObtuseKnight

TriangularHoneycombQueen

TriangularHoneycombRook

TriangularSnake

seq=Table[GraphData[{"TriangularSnake",n},"WienerIndex"],{n,1,20,2}]

FindSequenceFunction[seq,n]//Factor

Web

A180576

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

FindSequenceFunction[seq,n-2]//FullSimplify

FullSimplify[Expand[(1/16) (((-1))^n) n (9+(((-1))^n) (-25+2 n (40+9 n)))]/.(((-1))^(2n)):>1]

Table[n (-25+9 (((-1))^n)+2 n (40+9 n))/16,{n,20}]

coef=FindLinearRecurrence[seq]

Length[coef]

Take[seq,Length@coef]

LinearRecurrence[{2,1,-4,1,2,-1},{69,148,255,417,616,888},{-1,1}]

seq=LinearRecurrence[{2,1,-4,1,2,-1},{4,27,69,148,255,4178},20]

gf=x FindGeneratingFunction[seq,x]

CoefficientList[Series[((4+19 x+11 (x^2)-(x^3)-6 (x^4)+3761 (x^5))/((((-1+x))^4) (((1+x))^2))),{x,0,20}],x]

Wheel

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

A002378

seq=Table[GraphData[{"Wheel",n},"WienerIndex"],{n,4,20}]

Table[WienerIndex[Wheel[n]],{n,20}]

FindSequenceFunction[seq,n-3]//Factor

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

WhiteBishop n×n

A292059

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

(seq=Table[WienerIndex[WhiteBishopGraph[n,n]],{n,2,20}])//Timing

FindSequenceFunction[seq,n-1]

coef=FindLinearRecurrence[seq]

Length@coef

Take[seq,8]

seq=LinearRecurrence[{2,2,-6,0,6,-2,-2,1},{1,8,42,104,251,464,852,1360},40]

FullSimplify[FindSequenceFunction[seq,n-1]]

Expand[(-1+2 (-1+n) n)]

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

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

CoefficientList[Series[((-1-6 x-24 (x^2)-10 (x^3)-7 (x^4))/((((-1+x))^5) (((1+x))^3))),{x,0,20}],x]

Co-Wiener

List

Table[Total[Length/@Select[Split[Sort[WienerIndex/@ConnectedGraphs[n,"Format"->"V7"]]],Length[#]>1&]],{n,8}]//Timing

Table[Total[Length/@Select[Split[Sort[WienerIndex/@ConnectedGraphs[n,"Format"->"V7"]]],Length[#]>1&]],{n,9}]//Timing

seq={2,16,108,847,11110,261072};

FindSequenceFunction[l,n-3]

FindGeneratingFunction[l,x]

FindLinearRecurrence[l]

3 Connected

{#[[1]],Length[#]}&/@Select[Split[Sort[WienerIndex/@ConnectedGraphs[3,"Format"->"V7"]]],Length[#]>1&]

4 All

GraphicsGrid[Partition[Graphs[4],5,5,{1,1},{}],Dividers->All]

Partition[WienerIndex/@Graphs[4,"Format"->"V7"],5,5,{1,1},{}]

4 Connected

{#[[1]],Length[#]}&/@Select[Split[Sort[WienerIndex/@ConnectedGraphs[4,"Format"->"V7"]]],Length[#]>1&]

{#[[1,1]],#[[All,2]]}&/@Select[SplitBy[SortBy[{WienerIndex[#],RecognizeGraph[#]}&/@ConnectedGraphs[4,"Format"->"V7"],First],First],Length[#]>1&]

5 All

GraphicsGrid[Partition[Graphs[5],8,8,{1,1},{}],Dividers->All]

Partition[WienerIndex/@Graphs[5,"Format"->"V7"],8,8,{1,1},{}]//Column

5 Connected

{#[[1]],Length[#]}&/@Select[Split[Sort[WienerIndex/@ConnectedGraphs[5,"Format"->"V7"]]],Length[#]>1&]

{#[[1,1]],#[[All,2]]}&/@Select[SplitBy[SortBy[{WienerIndex[#],RecognizeGraph[#]}&/@ConnectedGraphs[5,"Format"->"V7"],First],First],Length[#]>1&]//Column

Checks

GraphData["WienerIndex","Missing"]

DeleteCases[{#,GraphData[#,"WienerIndex"],WienerIndex[GraphData[#]]}&/@GraphData[;;100],{_,x_,x_}]//Timing

DeleteCases[{#,GraphData[#,"WienerIndex"],WienerIndex[GraphData[#]]}&/@GraphData[;;1000],{_,x_,x_}]//Timing

DeleteCases[{#,GraphData[#,"WienerIndex"],WienerIndex[GraphData[#]]}&/@GraphData[All],{_,x_,x_}]//Timing