login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A166540 Number of ways to place 2 nonattacking kings on an n X n X n raumschach board. 4
0, 0, 0, 193, 1548, 6714, 21280, 55395, 125748, 257908, 489024, 870885, 1473340, 2388078, 3732768, 5655559, 8339940, 12009960, 16935808, 23439753, 31902444, 42769570, 56558880, 73867563, 95379988, 121875804, 154238400, 193463725, 240669468, 297104598, 364159264 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
We consider that kings "attack" any square that differs by at most one in any combination of the indices from its current space. A logical extension of sequence A061995.
LINKS
FORMULA
a(n) = (n^6 - (3*n-2)^3) / 2 = (n^6)/2 - (27*n^3)/2 + 27*n^2 - 18*n + 4 for n>0. - Andrew Woods, Aug 30 2011
G.f.: x^3*(193 +197*x -69*x^2 +35*x^3 +4*x^4)/(1-x)^7. - Colin Barker, Jan 09 2013
E.g.f.: (8 -8*x +4*x^2 +63*x^3 +65*x^4 +15*x^5 +x^6)*exp(x)/2 -4. - G. C. Greubel, Apr 03 2019
MATHEMATICA
LinearRecurrence[{7, -21, 35, -35, 21, -7, 1}, {0, 0, 0, 193, 1548, 6714, 21280, 55395}, 35] (* G. C. Greubel, May 16 2016; a(7) appended by Georg Fischer, Apr 03 2019 *)
PROG
(Python) # Two non-attacking kings in n x n x n cubic "board" .
m=int(input('What\'s the biggest board to investigate? '))
for n in range (0, m+1):
sum=0
for x1 in range (1, n+1):
for y1 in range (1, n+1):
for z1 in range (1, n+1):
for x2 in range (1, n+1):
for y2 in range (1, n+1):
for z2 in range (1, n+1):
if abs(x1-x2)>1 or abs(y1-y2)>1 or abs(z1-z2)>1:
sum=sum+1
sum=sum//2
print(n, sum)
(PARI) {a(n) = if(n==0, 0, (n^6 -(3*n-2)^3)/2)}; \\ G. C. Greubel, Apr 03 2019
(Magma) [0] cat [(n^6 -(3*n-2)^3)/2: n in [1..35]]; // G. C. Greubel, Apr 03 2019
(Sage) [0]+[(n^6 -(3*n-2)^3)/2 for n in (1..35)] # G. C. Greubel, Apr 03 2019
CROSSREFS
Sequence in context: A174521 A204711 A125647 * A178265 A201112 A250156
KEYWORD
nonn,easy
AUTHOR
Michael Engling, Oct 16 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)