A140819
Triangle read by rows: T(n, m) = m if 2*m = n, otherwise 2*gcd(n, m).
Original entry on oeis.org
0, 2, 2, 4, 1, 4, 6, 2, 2, 6, 8, 2, 2, 2, 8, 10, 2, 2, 2, 2, 10, 12, 2, 4, 3, 4, 2, 12, 14, 2, 2, 2, 2, 2, 2, 14, 16, 2, 4, 2, 4, 2, 4, 2, 16, 18, 2, 2, 6, 2, 2, 6, 2, 2, 18
Offset: 0
{0},
{2, 2},
{4, 1, 4},
{6, 2, 2, 6},
{8, 2, 2, 2, 8},
{10, 2, 2, 2, 2, 10},
{12, 2, 4, 3, 4, 2, 12},
{14, 2, 2, 2, 2, 2, 2, 14},
{16, 2, 4, 2, 4, 2, 4, 2, 16},
{18, 2, 2, 6, 2, 2, 6, 2, 2, 18}
-
M[d_, x_, y_] := Sum[Sum[If[n == m, GCD[d - 1, m - 1], If[n == d - m + 1, GCD[ d - 1, n - 1], 0]]*x^(n - 1)*y^(m - 1), {n, 1, d}], {m, 1, d}]
Table[CoefficientList[M[d, x, 1], x], {d, 1, 10}]
Flatten[%]
Table[Apply[Plus, CoefficientList[M[d, x, 1], x]], {d, 1, 10}]
Definition simplified by the editors of the OEIS, Jan 03 2024
A140822
Triangle T(n,m) = binomial(n,gcd(n,m)) read by rows, 0<=m<=n.
Original entry on oeis.org
1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 5, 5, 5, 5, 1, 1, 6, 15, 20, 15, 6, 1, 1, 7, 7, 7, 7, 7, 7, 1, 1, 8, 28, 8, 70, 8, 28, 8, 1, 1, 9, 9, 84, 9, 9, 84, 9, 9, 1, 1, 10, 45, 10, 45, 252, 45, 10, 45, 10, 1
Offset: 0
1;
1, 1;
1, 2, 1;
1, 3, 3, 1;
1, 4, 6, 4, 1;
1, 5, 5, 5, 5, 1;
1, 6, 15, 20, 15, 6, 1;
1, 7, 7, 7, 7, 7, 7, 1;
1, 8, 28, 8, 70, 8, 28, 8, 1;
1, 9, 9, 84, 9, 9, 84, 9, 9, 1;
1, 10, 45, 10, 45, 252, 45, 10, 45, 10, 1;
-
a = Table[Table[Binomial[n, GCD[n, m]], {m, 0, n}], {n, 0, 10}]; Flatten[a]
A140875
Triangle read by rows: T(n,m) = gcd(n,m+2) - 2*gcd(n,m+1) - gcd(n,m), with diagonal and subdiagonal removed.
Original entry on oeis.org
-2, -4, 0, -4, -4, 0, -6, -2, -2, 2, -6, -2, -6, -6, 2, -8, -2, -2, -2, -2, 4, -8, -4, 0, -8, -4, -4, 4, -10, 0, -6, -4, 0, -6, -4, 6, -10, -4, -2, 0, -10, -8, -2, -4, 6, -12, -2, -2, -2, -2, -2, -2, -2, -2, 8, -12, -2, -4, -10, 0, -12, -4, -6, -8, -6, 8, -14, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 10
Offset: 1
{ -2},
{ -4, 0},
{ -4, -4, 0},
{ -6, -2, -2, 2},
{ -6, -2, -6, -6, 2},
{ -8, -2, -2, -2, -2, 4},
{ -8, -4, 0, -8, -4, -4, 4},
{-10, 0, -6, -4, 0, -6, -4, 6},
{-10, -4, -2, 0, -10, -8, -2, -4, 6}
-
G[n_, m_] := GCD[n, m]
D2[n_, m_] := If[m + 2 <= n, G[n, m + 2] - 2*G[n, m + 1] - G[n, m], {} ];
a = Table[Flatten[Table[D2[n, m], {m, 0, n}]], {n, 0, 10}]; Flatten[a]
Definition corrected and more terms from
Georg Fischer, Jun 08 2023
A244590
a(n) = sum( floor(k*n/8), k=1..7 ).
Original entry on oeis.org
0, 0, 4, 7, 12, 14, 18, 21, 28, 28, 32, 35, 40, 42, 46, 49, 56, 56, 60, 63, 68, 70, 74, 77, 84, 84, 88, 91, 96, 98, 102, 105, 112, 112, 116, 119, 124, 126, 130, 133, 140, 140, 144, 147, 152, 154, 158, 161, 168, 168
Offset: 0
-
[&+[Floor(k*n/8): k in [1..7]]: n in [0..50]]; // Bruno Berselli, Jul 01 2014
-
G:=(n,m)-> sum(floor(k*n/m), k=1..m-1): seq(G(n,8), n = 0..60);
-
Table[Sum[Floor[k n/8], {k, 1, 7}], {n, 0, 50}] (* Bruno Berselli, Jul 01 2014 *)
-
[sum(floor(k*n/8) for k in (1..7)) for n in (0..50)] # Bruno Berselli, Jul 01 2014
A330761
Array read by antidiagonals: T(n,k) is the number of faces on a ring formed by connecting the ends of a prismatic rod whose cross-section is an n-sided regular polygon after applying a twist of k/n turns.
Original entry on oeis.org
2, 3, 1, 4, 1, 2, 5, 1, 1, 1, 6, 1, 2, 3, 2, 7, 1, 1, 1, 1, 1, 8, 1, 2, 1, 4, 1, 2, 9, 1, 1, 3, 1, 1, 3, 1, 10, 1, 2, 1, 2, 5, 2, 1, 2, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, 1, 2, 1, 2, 1, 2, 7, 2, 1, 2, 1, 2
Offset: 1
A prismatic rod having a cross-section that is an octagon will have:
8 faces if no twist is applied or if the amount of twisting is a multiple of 8: 0/8, 8/8, 16/8, etc.;
4 faces if the amount of twisting is 4/8, 12/8, etc.
2 faces if the amount of twisting is 2/8, 6/8, 10/8, etc.
1 face if the amount of twisting is 1/8, 3/8, 5/8, 7/8, 9/8, etc.
Note that the number of faces is equal to gcd(n,k) where n=number of sides of the prismatic rod and k=amount of twist applied to the rod.
T(n,k) as a table begins:
(n=number of sides of polygon; k=amount of fractional twist applied)
n |k=0 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
---+-------------------------------------------
2 | 2 1 2 1 2 1 2 1 2 1 2 1 2 1...
3 | 3 1 1 3 1 1 3 1 1 3 1 1 3 1...
4 | 4 1 2 1 4 1 2 1 4 1 2 1 4 1...
5 | 5 1 1 1 1 5 1 1 1 1 5 1 1 1...
6 | 6 1 2 3 2 1 6 1 2 3 2 1 6 1...
7 | 7 1 1 1 1 1 1 7 1 1 1 1 1 1...
8 | 8 1 2 1 4 1 2 1 8 1 2 1 4 1...
9 | 9 1 1 3 1 1 3 1 1 9 1 1 3 1...
10 | 10 1 2 1 2 5 2 1 2 1 10 1 2 1...
11 | 11 1 1 1 1 1 1 1 1 1 1 11 1 1...
12 | 12 1 2 3 4 1 6 1 4 3 2 1 12 1...
13 | 13 1 1 1 1 1 1 1 1 1 1 1 1 13...
...
A384446
Triangle read by rows: T(n, k) = |gcd(n, k) - k|.
Original entry on oeis.org
0, 1, 0, 2, 0, 0, 3, 0, 1, 0, 4, 0, 0, 2, 0, 5, 0, 1, 2, 3, 0, 6, 0, 0, 0, 2, 4, 0, 7, 0, 1, 2, 3, 4, 5, 0, 8, 0, 0, 2, 0, 4, 4, 6, 0, 9, 0, 1, 0, 3, 4, 3, 6, 7, 0, 10, 0, 0, 2, 2, 0, 4, 6, 6, 8, 0, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 12, 0, 0, 0, 0, 4, 0, 6, 4, 6, 8, 10, 0
Offset: 0
Triangle starts:
[0] [0]
[1] [1, 0]
[2] [2, 0, 0]
[3] [3, 0, 1, 0]
[4] [4, 0, 0, 2, 0]
[5] [5, 0, 1, 2, 3, 0]
[6] [6, 0, 0, 0, 2, 4, 0]
[7] [7, 0, 1, 2, 3, 4, 5, 0]
[8] [8, 0, 0, 2, 0, 4, 4, 6, 0]
[9] [9, 0, 1, 0, 3, 4, 3, 6, 7, 0]
A384447
Array read by ascending antidiagonals: A(n, k) = gcd(n, k) if n > 0 otherwise 0.
Original entry on oeis.org
0, 1, 0, 2, 1, 0, 3, 1, 1, 0, 4, 1, 2, 1, 0, 5, 1, 1, 1, 1, 0, 6, 1, 2, 3, 2, 1, 0, 7, 1, 1, 1, 1, 1, 1, 0, 8, 1, 2, 1, 4, 1, 2, 1, 0, 9, 1, 1, 3, 1, 1, 3, 1, 1, 0, 10, 1, 2, 1, 2, 5, 2, 1, 2, 1, 0, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 0
Offset: 0
The array begins:
[0] [0, 0, 0, 0, 0, 0, 0, 0, ...
[1] [1, 1, 1, 1, 1, 1, 1, 1, ...
[2] [2, 1, 2, 1, 2, 1, 2, 1, ...
[3] [3, 1, 1, 3, 1, 1, 3, 1, ...
[4] [4, 1, 2, 1, 4, 1, 2, 1, ...
[5] [5, 1, 1, 1, 1, 5, 1, 1, ...
[6] [6, 1, 2, 3, 2, 1, 6, 1, ...
[7] [7, 1, 1, 1, 1, 1, 1, 7, ...
[8] [8, 1, 2, 1, 4, 1, 2, 1, ...
[9] [9, 1, 1, 3, 1, 1, 3, 1, ...
...
-
A[n_,k_]:=(1-KroneckerDelta[n,0])GCD[n,k]; Table[A[n-k,k],{n,0,12},{k,0,n}]//Flatten (* Stefano Spezia, Jun 02 2025 *)
-
from math import gcd
def A(n, k): return gcd(n, k) if n > 0 else 0
for n in range(10): print([A(n, k) for k in range(8)])
A384710
a(n) = Sum_{k=0..n} [gcd(k, n) = 1], where [.] are the Iverson brackets.
Original entry on oeis.org
0, 2, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 4, 12, 6, 8, 8, 16, 6, 18, 8, 12, 10, 22, 8, 20, 12, 18, 12, 28, 8, 30, 16, 20, 16, 24, 12, 36, 18, 24, 16, 40, 12, 42, 20, 24, 22, 46, 16, 42, 20, 32, 24, 52, 18, 40, 24, 36, 28, 58, 16, 60, 30, 36, 32, 48, 20, 66, 32, 44, 24
Offset: 0
[gcd(0,0)] = [0] => a(0) = 0.
[gcd(0,1), gcd(1,1)] = [1, 1] => a(1) = 2.
[gcd(0,2), gcd(1,2), gcd(2,2)] = [2, 1, 2] => a(2) = 1.
- R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, Addison-Wesley, 2nd ed., 1994, ch. 4.5.
-
isPrimeTo := (k, n) -> ifelse(igcd(k, n) = 1, 1, 0):
a := n -> add(isPrimeTo(k, n), k = 0..n): seq(a(n), n = 0..70);
-
Table[Sum[Boole[CoprimeQ[k, n]], {k, 0, n}], {n, 0, 70}] (* Michael De Vlieger, Jun 07 2025 *)
-
a(n) = sum(k = 0, n, gcd(k, n) == 1); \\ Amiram Eldar, Jun 08 2025
-
from math import gcd
def a(n: int) -> int: return sum(int(1 == gcd(n, k)) for k in range(n + 1))
print([a(n) for n in range(71)])
Comments