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.

Previous Showing 11-13 of 13 results.

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

Original entry on oeis.org

0, 1, 5, 49, 529, 7471, 112825, 2078455, 42649281, 997784221, 25875851825, 742641202183, 23283999690561, 793616663524231, 29188521870580929, 1152885848976064513, 48659336030073207425, 2185894865613157551481, 104126348669497256201905, 5242869988601103651841105
Offset: 0

Views

Author

Joshua Zucker, Nov 25 2003

Keywords

Comments

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

Examples

			a(3) = 49 because in the 3-dimensional lattice of side length 3, the lines through the origin are determined by all 37 points with at least one coordinate = 3 and 6 permutations of (2,1,0) and 3 permutations each of (2,1,1) and (2,2,1).
		

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

  • Maple
    a:= n-> add(numtheory[mobius](i)*((floor(n/i)+1)^n-1), i=1..n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Mar 09 2022
  • 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[k, k], {k, 0, 20}]

Formula

a(n) = A090030(n,n).

A339756 Mark each point on the n X n X n grid with the number of points that are visible from it; a(n) is the number of distinct values in the grid.

Original entry on oeis.org

1, 4, 4, 8, 4, 17, 12, 15, 14, 33, 12, 58, 28, 43, 52, 113, 39, 140, 57, 124, 129, 240, 66, 241, 173, 270, 217, 362, 58, 388, 292, 454, 351, 539, 166, 783, 471, 723, 463, 880, 229, 1134, 642, 843, 763, 1441, 311, 1415, 740, 1295, 987, 1888, 357, 1629, 1063, 1750, 1231, 2381, 289, 2652
Offset: 1

Views

Author

Torlach Rush, Dec 15 2020

Keywords

Comments

a(n) <= A058187(n). This is because A058187(n) is the maximum number of points required to calculate a(n).

Examples

			a(1) = 1 because there are 7 visible points from every point on the grid.
a(2) = 4 because 19 points are visible from every vertex of the grid, 23 points are visible from the midpoint of every edge of the grid, 25 points are visible from the midpoint of every face of the grid, and 26 points are visible from the middle of the grid.
a(3) = 4 because 49 points are visible from every vertex of the grid, 53 points are visible from the inner points of every edge of the grid, 55 points are visible from the inner points of every face of the grid, and 56 points are visible from the inner points of the grid.
		

Crossrefs

Programs

  • PARI
    \\ n = side length, d = dimension
    cdvps(n, d) ={my(m=Map());
      forvec(u=vector(d, i, [0, n\2]),
        my(c=0); forvec(v=[[t-n, t]|t<-u], c+=(gcd(v)==1));
        mapput(m, c, 1), 1);
      #m; }
    a(n) = cdvps(n, 3)

A175549 Number of triples (a, b, c) with gcd(a, b, c) = 1 and -n <= a,b,c <= n.

Original entry on oeis.org

0, 26, 98, 290, 578, 1154, 1730, 2882, 4034, 5762, 7490, 10370, 12674, 16706, 20162, 24770, 29378, 36290, 41474, 50114, 57026, 66242, 74882, 87554, 96770, 111170, 123266, 138818, 152642, 172802, 186626, 209666, 228098, 251138, 271874, 299522
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[If[n>0, 8 * Sum[MoebiusMu[k] * ((Floor[n/k] + 1)^3 - 1), {k, 1, n}] - 24 * Sum[EulerPhi[k], {k, 1, n}] - 6, 0], {n, 0, 35}] (* Indranil Ghosh, Mar 11 2017 *)
  • PARI
    a(n)=if(n>0,8*sum(k=1,n,moebius(k)*((n\k+1)^3-1))-24*sum(k=1,n,eulerphi(k))-6)
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A175549(n):
        if n == 0:
            return 0
        c, j = 0, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A175549(k1)
            j, k1 = j2, n//j2
        return 4*n*(n - 1)*(2*n + 5)-c+26*(j-1)# Chai Wah Wu, Mar 30 2021

Formula

For n > 0, a(n) = 8*A090025(n) - 12*A018805(n) - 18.
a(n) = 2*n*(4*n^2 + 6*n + 3) - Sum_{j=2..n} a(floor(n/j)). - Chai Wah Wu, Mar 30 2021

Extensions

Edited by Charles R Greathouse IV, Jul 19 2010
Previous Showing 11-13 of 13 results.