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.

A090028 Number of distinct lines through the origin in 6-dimensional cube of side length n.

Original entry on oeis.org

0, 63, 665, 3969, 14833, 45801, 112825, 257257, 515025, 980217, 1720145, 2934505, 4693473, 7396137, 11112129, 16464385, 23555441, 33430033, 45927505, 62881561, 83865257, 111331241, 144772201, 187839225, 238778281, 303522401, 379323785
Offset: 0

Views

Author

Joshua Zucker, Nov 25 2003

Keywords

Comments

Equivalently, lattice points where the GCD of all coordinates = 1.

Examples

			a(2) = 665 because the 665 points with at least one coordinate=2 all make distinct lines and the remaining 63 points and the origin are on those lines.
		

Crossrefs

Cf. A000225, A001047, A060867, A090020, A090021, A090022, A090023, A090024 are for n dimensions with side length 1, 2, 3, 4, 5, 6, 7, 8, respectively. A049691, A090025, A090026, A090027, A090028, A090029 are this sequence for 2, 3, 4, 5, 6, 7 dimensions. A090030 is the table for n dimensions, side length k.

Programs

  • Mathematica
    aux[n_, k_] := If[k == 0, 0, (k + 1)^n - k^n - Sum[aux[n, Divisors[k][[i]]], {i, 1, Length[Divisors[k]] - 1}]];lines[n_, k_] := (k + 1)^n - Sum[Floor[k/i - 1]*aux[n, i], {i, 1, Floor[k/2]}] - 1;Table[lines[6, k], {k, 0, 40}]
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A090028(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A090028(k1)
            j, k1 = j2, n//j2
        return (n+1)**6-c+63*(j-n-1) # Chai Wah Wu, Mar 30 2021

Formula

a(n) = A090030(6, n).
a(n) = (n+1)^6 - 1 - Sum_{j=2..n+1} a(floor(n/j)). - Chai Wah Wu, Mar 30 2021