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-4 of 4 results.

A199408 Triangle T(n,k) = n + k - gcd(n,k) read by rows, 1 <= n, 1 <= k <= n.

Original entry on oeis.org

1, 2, 2, 3, 4, 3, 4, 4, 6, 4, 5, 6, 7, 8, 5, 6, 6, 6, 8, 10, 6, 7, 8, 9, 10, 11, 12, 7, 8, 8, 10, 8, 12, 12, 14, 8, 9, 10, 9, 12, 13, 12, 15, 16, 9, 10, 10, 12, 12, 10, 14, 16, 16, 18, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 11, 12, 12, 12, 12, 16, 12
Offset: 1

Views

Author

Brian Hopkins, Nov 05 2011

Keywords

Comments

A diagonal of an n by k rectangle drawn on a square grid passes through T(n,k) squares: the diagonal enters n squares crossing horizontal segments and enters k squares crossing vertical segments. Gcd(n,k) counts the squares entered at a lattice point, which have been over-counted.

Examples

			T(6,4) = 6 + 4 - 2 = 8.
Triangular array begins
  1
  2  2
  3  4  3
  4  4  6  4
  5  6  7  8  5
  6  6  6  8 10  6
  7  8  9 10 11 12  7
  8  8 10  8 12 12 14  8
		

References

  • M. Ollerton, Mathematics Teacher's Handbook, Continuum, 2009, pp. 14-15.

Crossrefs

Cf. A049627, A074712. Third column A061800.

Programs

Formula

T(d*a,d*b) = d*T(a,b).

A226246 Triangle T(n, k), read by rows 1<=n, 1<=k<=n: Number of cells touched by a unit-width diagonal in a regular n X k grid.

Original entry on oeis.org

1, 2, 4, 3, 6, 7, 4, 8, 10, 10, 5, 8, 11, 14, 13, 6, 10, 14, 14, 16, 16, 7, 12, 13, 16, 19, 20, 19, 8, 14, 16, 20, 20, 22, 24, 22, 9, 14, 17, 18, 21, 22, 25, 28, 25, 10, 16, 20, 20, 26, 24, 28, 30, 30, 28, 11, 18, 21, 22, 25, 26, 29, 30, 33, 34, 31
Offset: 1

Views

Author

Andrew Woods, Jun 01 2013

Keywords

Examples

			A paintbrush of unit width is dragged centrally along the diagonal of a rectangular 5 X 7 grid. The number of squares in the grid which contain paint in their interiors is T(5,7) = 19.
		

References

  • J. D. E. Konhauser, D. J. Velleman and S. Wagon, Which Way Did the Bicycle Go?, Cambridge University Press, 1996, page 179.

Crossrefs

The zero-width case is A199408 (or A074712).

Formula

Let g := gcd(n,k), r := sqrt(n*n+k*k)/2.
T(n,k) = n+k+g+2*(g*floor(r/g)-floor(r/min(n,k))-1).

A344485 a(n) = Sum_{d|n} (n-d) * phi(n/d).

Original entry on oeis.org

0, 1, 4, 8, 16, 21, 36, 44, 60, 73, 100, 104, 144, 157, 180, 208, 256, 261, 324, 328, 376, 421, 484, 476, 560, 601, 648, 680, 784, 765, 900, 912, 984, 1057, 1108, 1128, 1296, 1333, 1396, 1420, 1600, 1569, 1764, 1768, 1836, 1981, 2116, 2064, 2268, 2305, 2436, 2504, 2704, 2673
Offset: 1

Views

Author

Wesley Ivan Hurt, May 20 2021

Keywords

Comments

a(n) is the sum of the (n - 1)-th antidiagonal in A074712. - Ctibor O. Zizka, Mar 14 2025
Möbius transform of A189835(n). - Wesley Ivan Hurt, Jul 16 2025

Examples

			a(6) = Sum_{d|6} (6-d) * phi(6/d) = 5*phi(6) + 4*phi(3) + 3*phi(2) + 0*phi(1) = 5*2 + 4*2 + 3*1 + 0*1 = 21.
		

Crossrefs

Programs

  • Maple
    with(numtheory): seq(add((n-d)*phi(n/d), d in divisors(n)), n=1..80); # Ridouane Oudra, Jan 21 2024
  • Mathematica
    Table[Sum[(n - k)*EulerPhi[n/k^(1 - Ceiling[n/k] + Floor[n/k])] (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 80}]
  • PARI
    a(n) = sumdiv(n, d, (n-d) * eulerphi(n/d)); \\ Michel Marcus, May 21 2021

Formula

a(n) = A000290(n) - A018804(n). - Ridouane Oudra, Jan 21 2024
From Wesley Ivan Hurt, Jul 16 2025: (Start)
a(n) = Sum_{d|n} A189835(d) * mu(n/d).
a(p^k) = p^(2*k)-p^k-k*p^k+k*p^(k-1) for p prime and k>=1. (End)

A292421 Square array T(n,k) = number of tiles crossed by the line segment (0,0) -- (n,k) in a running bond pattern tiling with square tiles, read by antidiagonals.

Original entry on oeis.org

1, 2, 2, 4, 3, 3, 4, 3, 4, 4, 5, 4, 4, 5, 5, 6, 8, 6, 7, 6, 6, 8, 7, 5, 6, 6, 7, 7, 8, 9, 6, 8, 8, 7, 8, 8, 9, 8, 12, 9, 7, 8, 10, 9, 9, 10, 10, 10, 7, 10, 10, 10, 9, 10, 10, 12, 11, 11, 8, 10, 9, 13, 10, 10, 11, 11, 12, 11, 12, 16, 12, 11, 12, 10, 12, 13, 12, 12
Offset: 1

Views

Author

Luc Rousseau, Sep 16 2017

Keywords

Comments

Running bond pattern: the tiles form horizontal rows and for all i (row number), row i+1 is row i translated by vector (1/2, 1). The first row is supposed to contain the tile with bottom-left vertex (0,0). A tile is considered crossed if its interior intersects the line segment (0,0) -- (n,k).

Examples

			T(3,5) = 5 because (0,0) -- (3,5) crosses the following tiles, identified by their bottom-left vertices: (0,0), (0.5,1), (1,2), (1.5,3), (2,4).
T(5,3) = 6 because (0,0) -- (5,3) crosses the following tiles, identified by their bottom-left vertices: (0,0), (1,0), (1.5,1), (2.5,1), (3,2), (4,2).
		

Crossrefs

Cf. A074712.

Programs

  • Mathematica
    F[a_, b_, p_, q_, i_] :=
      Block[{x0, x1, d}, x0 = (p/q - a/b)*i; x1 = x0 + p/q;
       d = Floor[x1] - Floor[x0]; If[IntegerQ[x1], d, d + 1]];
    FF[a_, b_, p_, q_] := Sum[F[a, b, p, q, i], {i, 0, q - 1}];
    a = 1; b = 2;
    Table[FF[a, b, p, s - p], {s, 2, 13}, {p, 1, s - 1}] // Flatten
Showing 1-4 of 4 results.