cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A303743 a(n) is a number of lattice points in 3D Cartesian grid between cube with edge length 2*n centered in origin and its inscribed sphere. Three pairs of the cube's faces are parallel to the planes XOY, XOZ, YOZ respectively.

Original entry on oeis.org

0, 0, 8, 92, 220, 412, 784, 1272, 1848, 2696, 3692, 5020, 6460, 8176, 10248, 12720, 15464, 18476, 21988, 25924, 30016, 35040, 40248, 46052, 52388, 59132, 66364, 74416, 83256, 92304, 102500, 112988, 124076, 136252, 148936, 162648, 176928, 192332, 208100, 225284, 243088
Offset: 1

Views

Author

Kirill Ustyantsev, Apr 29 2018

Keywords

Comments

If two parallel faces of the inscribed cube are parallel XOY-plane and other two pairs are parallel planes x=y and x=-y respectively we'll have another sequence.

Examples

			For n=3 we have 8 points between the defined cube and its inscribed sphere:
  (-2,-2,-2)
  (-2,-2, 2)
  (-2, 2,-2)
  (-2, 2, 2)
  ( 2,-2,-2)
  ( 2,-2, 2)
  ( 2, 2,-2)
  ( 2, 2, 2)
		

Crossrefs

For the 2D case see A303642.

Programs

  • PARI
    a(n) = sum(x=-n+1, n-1, sum(y=-n+1, n-1, sum(z=-n+1, n-1, x*x+y*y+z*z>n^2))); \\ Michel Marcus, Jun 23 2018
  • Python
    for n in range (1, 42):
      count=0
      n2 = n*n
      for x in range(-n+1, n):
        for y in range(-n+1, n):
          for z in range(-n+1, n):
            if x*x+y*y+z*z > n2:
              count += 1
      print(count)
    

Formula

a(n) = A016755(n-1) - A000605(n) - 6.