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.

Showing 1-10 of 11 results. Next

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

Original entry on oeis.org

0, 7, 19, 49, 91, 175, 253, 415, 571, 805, 1033, 1423, 1723, 2263, 2713, 3313, 3913, 4825, 5491, 6625, 7513, 8701, 9811, 11461, 12637, 14497, 16045, 18043, 19807, 22411, 24163, 27133, 29485, 32425, 35065, 38593, 41221, 45433, 48727, 52831
Offset: 0

Views

Author

Joshua Zucker, Nov 25 2003

Keywords

Comments

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

Examples

			a(2) = 19 because the 19 points with at least one coordinate=2 all make distinct lines and the remaining 7 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.
Cf. A071778.

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[3, k], {k, 0, 40}]
    a[n_] := Sum[MoebiusMu[k]*((Floor[n/k]+1)^3-1), {k, 1, n}]; Table[a[n], {n, 0, 39}] (* Jean-François Alcover, Nov 28 2013, after Vladeta Jovovic *)
  • PARI
    a(n)=(n+1)^3-sum(j=2,n+1,a(floor(n/j)))
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A090025(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A090025(k1)
            j, k1 = j2, n//j2
        return (n+1)**3-c+7*(j-n-1) # Chai Wah Wu, Mar 30 2021

Formula

a(n) = A090030(3, n).
a(n) = Sum_{k=1..n} moebius(k)*((floor(n/k)+1)^3-1). - Vladeta Jovovic, Dec 03 2004
a(n) = (n+1)^3 - Sum_{j=2..n+1} a(floor(n/j)). - Seth A. Troisi, Aug 29 2013
a(n) = 6*A015631(n) + 1 for n>=1. - Hugo Pfoertner, Mar 30 2021

A090020 Number of distinct lines through the origin in the n-dimensional lattice of side length 4.

Original entry on oeis.org

0, 1, 13, 91, 529, 2851, 14833, 75811, 383809, 1932931, 9705553, 48648931, 243605089, 1219100611, 6098716273, 30503196451, 152544778369, 762810181891, 3814309582993, 19072323542371, 95363943807649, 476826695752771
Offset: 0

Views

Author

Joshua Zucker, Nov 19 2003

Keywords

Comments

Equivalently, lattice points where the gcd of all the coordinates is 1.

Examples

			a(2) = 13 because in 2D the lines have slope 0, 1/4, 1/3, 1/2, 2/3, 3/4, 1, 4/3, 3/2, 2, 3, 4 and infinity.
		

Crossrefs

a(n) = T(n,4) from A090030. Cf. A000225, A001047, A060867, A090021, A090022, A090023, A090024 are for dimension n with side lengths 1, 2, 3, 5, 6, 7, 8 respectively. A049691, A090025, A090026, A090027, A090028, A090029 are for side length k in 2, 3, 4, 5, 6, 7 dimensions.

Programs

  • Mathematica
    Table[5^n - 3^n - 2^n + 1, {n, 0, 25}]
    LinearRecurrence[{11,-41,61,-30},{0,1,13,91},30] (* Indranil Ghosh, Feb 21 2017 *)
  • Python
    def A090020(n): return 5**n-3**n-2**n+1 # Indranil Ghosh, Feb 21 2017

Formula

a(n) = 5^n - 3^n - 2^n + 1.
G.f.: -x*(11*x^2-2*x-1)/((x-1)*(2*x-1)*(3*x-1)*(5*x-1)). [Colin Barker, Sep 04 2012]

A090024 Number of distinct lines through the origin in the n-dimensional lattice of side length 8.

Original entry on oeis.org

0, 1, 45, 571, 5841, 55651, 515025, 4702531, 42649281, 385447171, 3476958705, 31332052291, 282184860321, 2540643522691, 22870684139985, 205860600134851, 1852867557848961, 16676418630942211, 150090820212050865
Offset: 0

Views

Author

Joshua Zucker, Nov 20 2003

Keywords

Comments

Equivalently, lattice points where the gcd of all the coordinates is 1.

Examples

			a(2) = 45 because in 2D the lines have slope 0, 1/8, 3/8, 5/8, 7/8, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/6, 5/6, 1/5, 2/5, 3/5, 4/5, 1/4, 3/4, 1/3, 2/3, 1/2, 1 and their reciprocals.
		

Crossrefs

a(n) = T(n, 5) from A090030. Cf. A000225, A001047, A060867, A090020, A090021, A090022, A090023 are for dimension n with side lengths 1, 2, 3, 4, 5, 6, 7 respectively. A049691, A090025, A090026, A090027, A090028, A090029 are for side length k in 2, 3, 4, 5, 6, 7 dimensions.

Programs

  • Mathematica
    Table[9^n - 5^n - 3^n - 2^n + 2, {n, 0, 20}]
  • Python
    [9**n-5**n-3**n-2**n+2 for n in range(30)] # Gennady Eremin, Mar 12 2022

Formula

a(n) = 9^n - 5^n - 3^n - 2^n + 2.
G.f.: -x*(291*x^3-189*x^2+25*x+1)/((x-1)*(2*x-1)*(3*x-1)*(5*x-1)*(9*x-1)). [Colin Barker, Sep 04 2012]

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

Original entry on oeis.org

0, 15, 65, 225, 529, 1185, 2065, 3745, 5841, 9105, 13025, 19105, 25521, 35361, 45825, 59905, 75425, 96865, 117841, 147505, 177041, 214961, 254401, 306321, 355249, 420929, 485489, 565265, 645377, 748081, 841841, 966881, 1086241, 1230401, 1373185, 1549825
Offset: 0

Views

Author

Joshua Zucker, Nov 25 2003

Keywords

Comments

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

Examples

			a(2) = 65 because the 65 points with at least one coordinate=2 all make distinct lines and the remaining 15 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[4, k], {k, 0, 40}]
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A090026(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A090026(k1)
            j, k1 = j2, n//j2
        return (n+1)**4-c+15*(j-n-1) # Chai Wah Wu, Mar 30 2021

Formula

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

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

Original entry on oeis.org

0, 31, 211, 961, 2851, 7471, 15541, 31471, 55651, 95821, 152041, 239791, 351331, 517831, 723241, 1007041, 1352041, 1821721, 2359051, 3082921, 3904081, 4956901, 6151651, 7677901, 9334261, 11445361, 13746181, 16566691, 19644031, 23432851, 27408331, 32333581
Offset: 0

Views

Author

Joshua Zucker, Nov 25 2003

Keywords

Comments

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

Examples

			a(2) = 211 because the 211 points with at least one coordinate=2 all make distinct lines and the remaining 31 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[5, k], {k, 0, 40}]
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A090027(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A090027(k1)
            j, k1 = j2, n//j2
        return (n+1)**5-c+31*(j-n-1) # Chai Wah Wu, Mar 30 2021

Formula

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

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

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

Original entry on oeis.org

0, 127, 2059, 16129, 75811, 277495, 804973, 2078455, 4702531, 9905365, 19188793, 35533303, 61846723, 104511583, 168681913, 266042113, 405259513, 607140745, 883046011, 1269174145, 1780715833, 2472697501, 3366818491, 4548464341
Offset: 0

Views

Author

Joshua Zucker, Nov 25 2003

Keywords

Comments

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

Examples

			a(2) = 2059 because the 2059 points with at least one coordinate=2 all make distinct lines and the remaining 127 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[7, k], {k, 0, 40}]
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A090029(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A090029(k1)
            j, k1 = j2, n//j2
        return (n+1)**7-c+127*(j-n-1) # Chai Wah Wu, Mar 30 2021

Formula

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

A090030 Triangle read by rows: T(n,k) = number of distinct lines through the origin in the n-dimensional cubic lattice of side length k with one corner at the origin.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 1, 5, 7, 0, 0, 1, 9, 19, 15, 0, 0, 1, 13, 49, 65, 31, 0, 0, 1, 21, 91, 225, 211, 63, 0, 0, 1, 25, 175, 529, 961, 665, 127, 0, 0, 1, 37, 253, 1185, 2851, 3969, 2059, 255, 0, 0, 1, 45, 415, 2065, 7471, 14833, 16129, 6305, 511, 0, 0, 1, 57, 571, 3745, 15541, 45801, 75811, 65025, 19171, 1023, 0
Offset: 0

Views

Author

Joshua Zucker, Nov 24 2003

Keywords

Comments

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

Examples

			T(n,1) = 2^n-1 because there are 2^n-1 lattice points other than the corner, all of which make distinct lines. T(n,2) = 3^n - 2^n because if the given corner is the origin, all the points with coordinates in {0,1} make lines that are redundant with a point containing a coordinate 2.
Triangle T(n,k) begins:
  0;
  0, 0;
  0, 1,  0;
  0, 1,  3,   0;
  0, 1,  5,   7,    0;
  0, 1,  9,  19,   15,    0;
  0, 1, 13,  49,   65,   31,     0;
  0, 1, 21,  91,  225,  211,    63,     0;
  0, 1, 25, 175,  529,  961,   665,   127,    0;
  0, 1, 37, 253, 1185, 2851,  3969,  2059,  255,   0;
  0, 1, 45, 415, 2065, 7471, 14833, 16129, 6305, 511, 0;
  ...
		

Crossrefs

Cf. A000225, A001047, A060867, A090020, A090021, A090022, A090023, A090024 give T(n, k) for k = 1, 2, 3, 4, 5, 6, 7, 8, respectively. A049691, A090025, A090026, A090027, A090028, A090029 give T(n, k) for n=2, 3, 4, 5, 6, 7 respectively. A090225 counts only points with at least one coordinate = k.
T(n,n) gives A081474.
Cf. A008683.

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;lines[n, k]

Formula

With A(n, k) = A090225(n, k), T(n, k) =(k+1)^n - 1 - the sum for 0 < i < k of Floor[k/i-1]*A(n, i)
T(n,k) = Sum_{i=1..n-k} moebius(i)*((floor((n-k)/i)+1)^k-1). - Vladeta Jovovic, Dec 03 2004

A090021 Number of distinct lines through the origin in the n-dimensional lattice of side length 5.

Original entry on oeis.org

0, 1, 21, 175, 1185, 7471, 45801, 277495, 1672545, 10056991, 60405081, 362615815, 2176242705, 13059083311, 78359348361, 470170570135, 2821066729665, 16926530042431, 101559568723641, 609358576700455, 3656154951181425
Offset: 0

Views

Author

Joshua Zucker, Nov 19 2003

Keywords

Comments

Equivalently, lattice points where the gcd of all the coordinates is 1.

Examples

			a(2) = 21 because in 2D the lines have slope 0, 1/5, 2/5, 3/5, 4/5, 1/4, 3/4, 1/3, 2/3, 1/2, 1 and their reciprocals.
		

Crossrefs

a(n) = T(n, 5) from A090030. Cf. A000225, A001047, A060867, A090020, A090022, A090023, A090024 are for dimension n with side lengths 1, 2, 3, 4, 6, 7, 8 respectively. A049691, A090025, A090026, A090027, A090028, A090029 are for side length k in 2, 3, 4, 5, 6, 7 dimensions.

Programs

  • Mathematica
    Table[6^n - 3^n - 2*2^n + 2, {n, 0, 25}]
    LinearRecurrence[{12,-47,72,-36},{0,1,21,175},30] (* Harvey P. Dale, Jul 18 2016 *)

Formula

a(n) = 6^n - 3^n - 2*2^n + 2.
G.f.: -x*(30*x^2-9*x-1)/((x-1)*(2*x-1)*(3*x-1)*(6*x-1)). [Colin Barker, Sep 04 2012]

A090023 Number of distinct lines through the origin in the n-dimensional lattice of side length 7.

Original entry on oeis.org

0, 1, 37, 415, 3745, 31471, 257257, 2078455, 16704865, 133935391, 1072633177, 8585561095, 68702163985, 549687102511, 4397773276297, 35183283965335, 281470638631105, 2251782504544831, 18014329402322617, 144114912035163175, 1152920401607386225
Offset: 0

Views

Author

Joshua Zucker, Nov 20 2003

Keywords

Comments

Equivalently, lattice points where the gcd of all the coordinates is 1.

Examples

			a(2) = 37 because in 2D the lines have slope 0, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/6, 5/6, 1/5, 2/5, 3/5, 4/5, 1/4, 3/4, 1/3, 2/3, 1/2, 1 and their reciprocals.
		

Crossrefs

Equals A090030(n+7,n).
Cf. A000225, A001047, A060867, A090020, A090021, A090022, A090024 are for dimension n with side lengths 1, 2, 3, 4, 5, 6, 8 respectively. A049691, A090025, A090026, A090027, A090028, A090029 are for side length k in 2, 3, 4, 5, 6, 7 dimensions.

Programs

  • Mathematica
    Table[8^n - 4^n - 3^n - 2^n + 2, {n, 0, 20}]
  • Python
    [8**n-4**n-3**n-2**n+2 for n in range(25)] # Gennady Eremin, Mar 09 2022

Formula

a(n) = 8^n - 4^n - 3^n - 2^n + 2.
G.f.: -x*(200*x^3-136*x^2+19*x+1)/((x-1)*(2*x-1)*(3*x-1)*(4*x-1)*(8*x-1)). - Colin Barker, Sep 04 2012
Showing 1-10 of 11 results. Next