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 25 results. Next

A001047 a(n) = 3^n - 2^n.

Original entry on oeis.org

0, 1, 5, 19, 65, 211, 665, 2059, 6305, 19171, 58025, 175099, 527345, 1586131, 4766585, 14316139, 42981185, 129009091, 387158345, 1161737179, 3485735825, 10458256051, 31376865305, 94134790219, 282412759265, 847255055011, 2541798719465, 7625463267259, 22876524019505
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the sum of the elements in the n-th row of triangle pertaining to A036561. - Amarnath Murthy, Jan 02 2002
Number of 2 X n binary arrays with a path of adjacent 1's and no path of adjacent 0's from top row to bottom row. - R. H. Hardin, Mar 21 2002
With offset 1, partial sums of A027649. - Paul Barry, Jun 24 2003
Number of distinct lines through the origin in the n-dimensional lattice of side length 2. A049691 has the values for the 2-dimensional lattice of side length n. - Joshua Zucker, Nov 19 2003
a(n+1)/(n+1)=(3*3^n-2*2^n)/(n+1) is the second binomial transform of the harmonic sequence 1/(n+1). - Paul Barry, Apr 19 2005
a(n+1) is the sum of n-th row of A036561. - Reinhard Zumkeller, May 14 2006
The sequence gives the sum of the lengths of the segments in Cantor's dust generating sequence up to the i-th step. Measurement unit = length of the segment of i-th step. - Giorgio Balzarotti, Nov 18 2006
Let T be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xTy if x is a proper subset of y. Then a(n) = |T|. - Ross La Haye, Dec 22 2006
From Alexander Adamchuk, Jan 04 2007: (Start)
a(n) is prime for n in A057468.
p divides a(p) - 1 for prime p.
Quotients (3^p - 2^p - 1)/p, where p = prime(n), are listed in A127071.
Numbers k such that k divides 3^k - 2^k - 1 are listed in A127072.
Pseudoprimes in A127072(n) include all powers of primes {2,3,7} and some composite numbers that are listed in A127073, which includes all Carmichael numbers A002997.
Numbers n such that n^2 divides 3^n - 2^n - 1 are listed in A127074.
5 divides a(2n).
5^2 divides a(2*5n).
5^3 divides a(2*5^2n).
5^4 divides a(2*5^3n).
7^2 divides a(6*7n).
13 divides a(4n).
13^2 divides a(4*13n).
19 divides a(3n).
19^2 divides a(3*19n).
23^2 divides a(11n).
23^3 divides a(11*23n).
23^4 divides a(11*23^2n).
29 divides a(7n).
p divides a((p-1)n) for prime p>3.
p divides a((p-1)/2) for prime p in A097934. Also primes p such that 6 is a square mod p, except {2,3}, A038876(n).
p^(k+1) divides a(p^k*(p-1)/2*n) for prime p in A097934.
p^(k+1) divides a(p^k*(p-1)*n) for prime p>3.
Note the exception that for p = 23, p^(k+2) divides a(p^k*(p-1)/2*n).
There are no more such exceptions for primes p up to 600000. (End)
a(n) divides a(q*(n+1)-1), for all q integer. Leonardo Sarasua, Apr 15 2024
Final digits of terms follow sequence 1,5,9,5. - Enoch Haga, Nov 26 2007
This is also the second column sequence of the Sheffer triangle A143494 (2-restricted Stirling2 numbers). See the e.g.f. given below. - Wolfdieter Lang, Oct 08 2011
Partial sums give A000392. - Jon Perry, Apr 05 2014
For n >= 1, this is also row 2 of A281890: when consecutive positive integers are written as a product of primes in nondecreasing order, "3" occurs in n-th position a(n) times out of every 6^n. - Peter Munn, May 17 2017
a(n) is the number of ternary sequences of length n which include the digit 2. For example, a(2)=5 since the sequences are 02,20,12,21,22. - Enrique Navarrete, Apr 05 2021
a(n-1) is the number of ways we can form disjoint unions of two nonempty subsets of [n] such that the union contains n. For example, for n = 3, a(2) = 5 since the disjoint unions are {1}U{3}, {1}U{2,3}, {2}U{3}, {2}U{1,3}, and {1,2}U{3}. Cf. A000392 if we drop the requirement that the union contains n. - Enrique Navarrete, Aug 24 2021
Configures as a composite Koch Snowflake Fractal (see illustration in links) based on the five-fold division of the Cantor Square/Cantor Dust Fractal of (9^n-4^n)/5 see my illustration in (A016153). - John Elias, Oct 13 2021
Number of pairs (A,B) where B is a subset of {1,2,...,n} and A is a proper subset of B. - Jianing Song, Jun 18 2022
From Manfred Boergens, Mar 29 2023: (Start)
With regard to the comments by Ross La Haye and Jianing Song: Omitting "proper" gives A000244.
Number of pairs (A,B) where B is a nonempty subset of {1,2,...,n} and A is a nonempty subset of B. For nonempty proper subsets see a(n+1) in A028243. (End)
a(n) is the number of n-digit numbers whose smallest decimal digit is 7. - Stefano Spezia, Nov 15 2023
a(n-1) is the number of all possible player-reduced binary games observed by each player in an nx2 game assuming the individual strategies of k < n - 1 players are fixed and the remaining n - k - 1 player will play as one, either maintaining their status quo strategies or jointly adopting an alternative strategy. - Ambrosio Valencia-Romero, Apr 11 2024

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 86-87.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = row sums of A091913, row 2 of A047969, column 1 of A090888 and column 1 of A038719.
Cf. partitions: A241766, A241759.
A diagonal of A262307.

Programs

  • Haskell
    a001047 n = a001047_list !! n
    a001047_list = map fst $ iterate (\(u, v) -> (3 * u + v, 2 * v)) (0, 1)
    -- Reinhard Zumkeller, Jun 09 2013
  • Magma
    [3^n - 2^n: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    seq(3^n - 2^n, n=0..40); # Giorgio Balzarotti, Nov 18 2006
    A001047:=1/(3*z-1)/(2*z-1); # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[ 3^n - 2^n, {n, 0, 25} ]
    LinearRecurrence[{5, -6}, {0, 1}, 25] (* Harvey P. Dale, Aug 18 2011 *)
    Numerator@NestList[(3#+1)/2&,1/2,100] (* Zak Seidov, Oct 03 2011 *)
  • PARI
    {a(n) = 3^n - 2^n};
    
  • Python
    [3**n - 2**n for n in range(25)] # Ross La Haye, Aug 19 2005; corrected by David Radcliffe, Jun 26 2016
    
  • Sage
    [lucas_number1(n, 5, 6) for n in range(26)]  # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: x/((1-2*x)*(1-3*x)).
a(n) = 5*a(n-1) - 6*a(n-2).
a(n) = 3*a(n-1) + 2^(n-1). - Jon Perry, Aug 23 2002
Starting 0, 0, 1, 5, 19, ... this is 3^n/3 - 2^n/2 + 0^n/6, the binomial transform of A086218. - Paul Barry, Aug 18 2003
a(n) = A083323(n)-1 = A056182(n)/2 = (A002783(n)-1)/2 = (A003063(n+2)-A003063(n+1))/2. - Ralf Stephan, Jan 12 2004
Binomial transform of A000225. - Ross La Haye, Feb 07 2005
a(n) = Sum_{k=0..n-1} binomial(n, k)*2^k. - Ross La Haye, Aug 20 2005
a(n) = 2^(2n) - A083324(n). - Ross La Haye, Sep 10 2005
a(n) = A112626(n, 1). - Ross La Haye, Jan 11 2006
E.g.f.: exp(3*x) - exp(2*x). - Mohammad K. Azarian, Jan 14 2009
a(n) = A217764(n,1). - Ross La Haye, Mar 27 2013
a(n) = 2*a(n-1) + 3^(n-1). - Toby Gottfried, Mar 28 2013
a(n) = A000244(n) - A000079(n). - Omar E. Pol, Mar 28 2013
a(n) = Sum_{k=0..2} Stirling1(2,k)*(k+1)^n = c_2^{(-n)}, poly-Cauchy numbers. - Takao Komatsu, Mar 28 2013
a(n) = A227048(n,A098294(n)). - Reinhard Zumkeller, Jun 30 2013
a(n+1) = Sum_{k=0..n} 2^k*3^(n-k). - J. M. Bergot, Mar 27 2018
Sum_{n>=1} 1/a(n) = A329064. - Amiram Eldar, Nov 20 2020
a(n) = (1/2)*Sum_{k=0..n} binomial(n, k)*(2^(n-k) + 2^k - 2).
a(n) = A001117(n) + 2*A000918(n) + 1. - Ambrosio Valencia-Romero, Mar 08 2022
a(n) = A000225(n) + A028243(n+1). - Ambrosio Valencia-Romero, Mar 09 2022
From Peter Bala, Jun 27 2025: (Start)
exp(Sum_{n >=1} a(2*n)/a(n)*x^n/n) = Sum_{n >= 0} a(n+1)*x^n.
exp(Sum_{n >=1} a(3*n)/a(n)*x^n/n) = 1 + 19*x + 247*x^2 + ... is the g.f. of A019443.
exp(Sum_{n >=1} a(4*n)/a(n)*x^n/n) = 1 + 65*x + 2743*x^2 + ... is the g.f. of A383754.
The following are all examples of telescoping series:
Sum_{n >= 1} 6^n/(a(n)*a(n+1)) = 2, since 6^n/(a(n)*a(n+1)) = b(n) - b(n+1), where b(n) = 2^n/a(n);
Sum_{n >= 1} 18^n/(a(n)*a(n+1)*a(n+2)) = 22/75, since 18^n/(a(n)*a(n+1)*a(n+2)) = c(n) - c(n+1), where c(n) = (5*6^n - 2*4^n)/(15*a(n)*a(n+1));
Sum_{n >= 1} 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = 634/48735 since 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = d(n) - d(n+1), where d(n) = (57*18^n - 38*12^n + 8*8^n)/(513*a(n)*a(n+1)*a(n+2)).
Sum_{n >= 1} 6^n/(a(n)*a(n+2)) = 14/25; Sum_{n >= 1} (-6)^n/(a(n)*a(n+2)) = -6/25.
Sum_{n >= 1} 6^n/(a(n)*a(n+3)) = 306/1805.
Sum_{n >= 1} 6^n/(a(n)*a(n+4)) = 4282/80275; Sum_{n >= 1} (-6)^n/(a(n)*a(n+4)) = -1698/80275. (End)

Extensions

Edited by Charles R Greathouse IV, Mar 24 2010

A060867 a(n) = (2^n - 1)^2.

Original entry on oeis.org

1, 9, 49, 225, 961, 3969, 16129, 65025, 261121, 1046529, 4190209, 16769025, 67092481, 268402689, 1073676289, 4294836225, 17179607041, 68718952449, 274876858369, 1099509530625, 4398042316801, 17592177655809, 70368727400449, 281474943156225, 1125899839733761
Offset: 1

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), May 04 2001

Keywords

Comments

Number of n X n matrices over GF(2) with rank 1.
Let M_2(n) be the 2 X 2 matrix M_2(n)(i,j)=i^n+j^n; then a(n)=-det(M_2(n)). - Benoit Cloitre, Apr 21 2002
Number of distinct lines through the origin in the n-dimensional lattice of side length 3. A001047 gives lines in the n-dimensional lattice of side length 2, A049691 gives lines in the 2-dimensional lattice of side length n. - Joshua Zucker, Nov 19 2003
a(n) is also the number of n-tuples with each entry chosen from the subsets of {1,2} such that the intersection of all n entries is empty. See example. This may be shown by exhibiting a bijection to a set whose cardinality is obviously (2^n-1)^2, namely the set of all pairs with each entry chosen from the 2^n-1 proper subsets of {1,..,n}, i.e., for both entries {1,..,n} is forbidden. The bijection is given by (X_1,..,X_n) |-> (Y_1,Y_2) where for each j in {1,2} and each i in {1,..,n}, i is in Y_j if and only if j is in X_i. For example, a(2)=9, because the nine pairs of subsets of {1,2} with empty intersection are: ({},{}), ({},{1}), ({},{2}), ({},{1,2}), ({1},{}), ({2},{}), ({1,2},{}), ({1},{2}), ({2},{1}). - Peter C. Heinig (algorithms(AT)gmx.de), Apr 13 2007
Partial sums of A165665. - J. M. Bergot, Dec 06 2014
Except for a(1)=4, the number of active (ON, black) cells at stage 2^n-1 of the two-dimensional cellular automaton defined by "Rule 737", based on the 5-celled von Neumann neighborhood. - Robert Price, May 23 2016
Apparently (with offset 0) also the number of active cells at state 2^n-1 of the automaton defined by "Rule 7". - Robert Price, Apr 12 2016
a(n) is the difference x-y where positive integer x has binary form of n leading ones followed by n zeros and nonnegative integer y has binary form of n leading zeros followed by n ones. For example, a(4) = (1111000-00001111)(base 2) = 240-15 = 225 = 15^2. The result follows readily by noting y=2^n-1 and x=2^(2*n)-1-y. Therefore x-y=2^(2*n)-2^(n+1)+1=(2^n-1)^2. - Dennis P. Walsh, Sep 19 2016
Also the number of dominating sets in the n-barbell graph. - Eric W. Weisstein, Jun 29 2017
For n > 1, also the number of connected dominating sets in the complete bipartite graph K_n,n. - Eric W. Weisstein, Jun 29 2017

Examples

			a(2) = 9 because there are 10 (the second element in sequence A060704) singular 2 X 2 matrices over GF(2), that have rank <= 1 of which only the zero matrix has rank zero so a(2) = 10 - 1 = 9.
		

References

  • Richard P. Stanley, Enumerative Combinatorics: Volume 1: Wadsworth & Brooks: 1986: p. 11.

Crossrefs

Cf. A000225, A060704, A065443, A165665 (first differences)

Programs

Formula

a(n) = (2^n - 1)^2 = A000225(n)^2.
a(n) = sum_{j=1..n} sum_{k=1..n} binomial(n+j,n-k). - Yalcin Aktar, Dec 28 2011
G.f.: x*(1+2*x)/((1-x)(1-2*x)(1-4*x)). a(n) = 7*a(n-1)-14*a(n-2)+8*a(n-3). - Colin Barker, Feb 03 2012
E.g.f.: (1 - 2*exp(x) + exp(3*x))*exp(x). - Ilya Gutkovskiy, May 23 2016
Sum_{n>=1} 1/a(n) = A065443. - Amiram Eldar, Nov 12 2020

Extensions

Description changed to formula by Eric W. Weisstein, Jun 29 2017

A049687 Array T read by diagonals: T(i,j)=number of lines passing through (0,0) and at least one other lattice point (h,k) satisfying 0<=h<=i, 0<=k<=j.

Original entry on oeis.org

0, 1, 1, 1, 3, 1, 1, 4, 4, 1, 1, 5, 5, 5, 1, 1, 6, 7, 7, 6, 1, 1, 7, 8, 9, 8, 7, 1, 1, 8, 10, 11, 11, 10, 8, 1, 1, 9, 11, 14, 13, 14, 11, 9, 1, 1, 10, 13, 15, 17, 17, 15, 13, 10, 1, 1, 11, 14, 18, 18, 21, 18, 18, 14, 11, 1, 1, 12, 16, 20, 22, 23, 23, 22, 20, 16, 12, 1, 1, 13, 17, 22, 24
Offset: 0

Views

Author

Keywords

Examples

			The array begins:
0 1 1 1 1  ...
1 3 4 5 6  ...
1 4 5 7 8  ...
1 5 7 9 11 ...
1 6 8 11 13 ...
...
		

Crossrefs

Main diagonal is A049691.

Programs

  • Mathematica
    a[0, 0] = 0; a[0, ] = a[, 0] = 1; a[i_, j_] := Module[{slopes, cnt}, slopes = Union @ Flatten @ Table[k/h, {h, 1, i }, {k, 1, j }]; cnt[ slope_] := Count[Flatten[Table[{h, k}, {h, 1, i }, {k, 1, j }], 1], {h_, k_} /; k/h == slope]; Count[cnt /@ slopes, c_ /; c >= 1] + 2]; Table[a[i-j, j], {i, 0, 12}, {j, 0, i}] // Flatten (* Jean-François Alcover, Apr 03 2017 *)
  • PARI
    T(i,j) = (i>0) + (j>0) + sum(g=1, min(i,j), (i\g) * (j\g) * moebius(g));
    for (i=0, 10, for(j=0, 10, print1(T(i,j), ", ")); print); \\ Andrew Howroyd, Sep 17 2017
    
  • PARI
    T(i,j) = sum(h=0, i, sum(k=0, j, gcd(h,k) == 1)); \\ Andrew Howroyd, Sep 17 2017

Formula

From Andrew Howroyd, Sep 17 2017: (Start)
T(i, j) = 2 + Sum_{g=1..min(i,j)} floor(i/g) * floor(j/g) * mu(g) for i > 0, j > 0.
T(i, j) = signum(i) + signum(j) + A135646(i, j).
T(i, j) = |{(x, y): gcd(x, y) = 1, 0<=x<=i, 0<=y<=j}|.
(End)

Extensions

More terms from Michael Somos

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]

A090022 Number of distinct lines through the origin in the n-dimensional lattice of side length 6.

Original entry on oeis.org

0, 1, 25, 253, 2065, 15541, 112825, 804973, 5692705, 40071781, 281367625, 1972955293, 13823978545, 96820307221, 677949854425, 4746473419213, 33228592555585, 232613204977861, 1628344491013225, 11398619145204733
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) = 25 because in 2D the lines have slope 0, 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, A090023, A090024 are for dimension n with side lengths 1, 2, 3, 4, 5, 7, 8 respectively. A049691, A090025, A090026, A090027, A090028, A090029 are for side length k in 2, 3, 4, 5, 6, 7 dimensions.

Programs

  • Magma
    [7^n-4^n-3^n+1: n in [0..20]]; // Wesley Ivan Hurt, Mar 06 2022
  • Mathematica
    Table[7^n - 4^n - 3^n + 1, {n, 0, 25}]
  • Python
    [7**n-4**n-3**n+1 for n in range(20)] # Gennady Eremin, Mar 06 2022
    

Formula

a(n) = 7^n - 4^n - 3^n + 1.
O.g.f.: 1/(-1+3*x) + 1/(-1+4*x) - 1/(-1+x) - 1/(-1+7*x). - R. J. Mathar, Feb 26 2008

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
Showing 1-10 of 25 results. Next