A186230
Triangle T(n,k), n>=1, 1<=k<=n, read by rows: T(n,k) is the number of positive integers j
0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 2, 4, 2, 0, 0, 0, 1, 0, 2, 0, 3, 0, 0, 1, 0, 1, 3, 0, 4, 3, 0, 0, 0, 1, 0, 0, 0, 2, 0, 2, 0, 0, 1, 2, 2, 4, 2, 6, 4, 6, 4, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 0, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 4, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 4, 0, 5, 0
Offset: 1
A258820 Reversed rows of A178252 presented as diagonals of an irregular triangle.
1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 5, 2, 1, 1, 3, 10, 1, 1, 7, 5, 5, 1, 1, 4, 7, 5, 1, 1, 9, 28, 35, 3, 1, 1, 5, 12, 14, 7, 1, 1, 11, 15, 21, 14, 7, 1, 1, 6, 55, 30, 126, 28, 1, 1, 13, 22, 165, 42, 21, 4, 1
Offset: 0
Comments
The diagonals of T are the reversed rows of A178252. E.g., the fifth diagonal of T is (1,2,2,1,1) from the example below, which is the fifth reversed row of A178252.
Factoring out the greatest common divisor (gcd) of the coefficients of the sub-polynomials in the indeterminate q of the polynomials in s presented on p. 12 of the Alexeev et al. link and then evaluating the sub-polynomials at q=1 gives the first nine rows of T given in the example below. E.g., for k=6 (the seventh row), q*s^6 + (6*q + 9*q^2) s^4 + (15*q + 15*q^2) s^2 + 5 = q*s^6 + 3*(2*q + 3*q^2)*s^4 + 15*(q + q^2)*s^2 + 5 generates (1,2+3,1+1,1)=(1,5,2,1).
The row length sequence of this irregular triangle is A008619(n) = 1 + floor(n/2). - Wolfdieter Lang, Aug 25 2015
Examples
The irregular triangle T(n,k) starts n\k 0 1 2 3 4 5 ... 0: 1 1: 1 2: 1 1 3: 1 1 4: 1 3 1 5: 1 2 1 6: 1 5 2 1 7: 1 3 10 1 8: 1 7 5 5 1 9: 1 4 7 5 1 10: 1 9 28 35 3 1 ... reformatted. - _Wolfdieter Lang_, Aug 25 2015
Links
- N. Alexeev, J. Andersen, R. Penner, P. Zograf, Enumeration of chord diagrams on many intervals and their non-orientable analogs, arXiv:1307.0967 [math.CO], 2013-2014.
Programs
-
Mathematica
max = 15; coes = Table[ PadRight[ CoefficientList[ BernoulliB[n, x], x], max], {n, 0, max-1}]; inv = Inverse[coes] // Numerator; t[n_, k_] := inv[[n, k]]; t[n_, k_] /; k == n+1 = 1; Table[t[n-k+1, k], {n, 2, max+1}, {k, 2, Floor[n/2]+1}] // Flatten (* Jean-François Alcover, Jul 22 2015 *)
A285724 Square array read by descending antidiagonals: If n > k, A(n,k) = T(lcm(n,k), gcd(n,k)), otherwise A(n,k) = T(gcd(n,k), lcm(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table.
1, 2, 3, 4, 5, 6, 7, 16, 21, 10, 11, 12, 13, 14, 15, 16, 46, 67, 78, 55, 21, 22, 23, 106, 25, 120, 27, 28, 29, 92, 31, 191, 210, 34, 105, 36, 37, 38, 211, 80, 41, 90, 231, 44, 45, 46, 154, 277, 379, 436, 465, 406, 300, 171, 55, 56, 57, 58, 59, 596, 61, 630, 63, 64, 65, 66, 67, 232, 436, 631, 781, 862, 903, 820, 666, 465, 253, 78, 79, 80, 529, 212, 991, 302, 85, 324, 1035, 230, 561, 90, 91
Offset: 1
Comments
The array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
Examples
The top left 12 X 12 corner of the array: 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, 67 3, 5, 16, 12, 46, 23, 92, 38, 154, 57, 232, 80 6, 21, 13, 67, 106, 31, 211, 277, 58, 436, 529, 94 10, 14, 78, 25, 191, 80, 379, 59, 631, 212, 947, 109 15, 55, 120, 210, 41, 436, 596, 781, 991, 96, 1486, 1771 21, 27, 34, 90, 465, 61, 862, 302, 193, 467, 2146, 142 28, 105, 231, 406, 630, 903, 85, 1541, 1954, 2416, 2927, 3487 36, 44, 300, 63, 820, 324, 1596, 113, 2557, 822, 3829, 355 45, 171, 64, 666, 1035, 208, 2016, 2628, 145, 4006, 4852, 706 55, 65, 465, 230, 101, 495, 2485, 860, 4095, 181, 5996, 1832 66, 253, 561, 990, 1540, 2211, 3003, 3916, 4950, 6105, 221, 8647 78, 90, 103, 117, 1830, 148, 3570, 375, 739, 1890, 8778, 265
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10585; the first 145 antidiagonals of array
- MathWorld, Pairing Function
Crossrefs
Programs
A287957 Table read by antidiagonals: T(n, k) = greatest common recursive divisor of n and k; n > 0 and k > 0.
1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 2, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 2, 1, 2, 5, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 7, 2, 1
Offset: 1
Comments
We use the definition of recursive divisor given in A282446.
More informally, the prime tower factorization of T(n, k) is the intersection of the prime tower factorizations of n and k (the prime tower factorization of a number is defined in A182318).
This sequence has connections with the classical GCD (A003989).
For any i > 0, j > 0 and k > 0:
- T(i, j) = 1 iff gcd(i, j) = 1,
- T(i, j) >= 1,
- T(i, j) <= min(i, j),
- T(i, j) <= gcd(i, j),
- T(i, 1) = 1,
- T(i, i) = i,
- T(i, j) = T(j, i) (the sequence is commutative),
- T(i, T(j, k)) = T(T(i, j), k) (the sequence is associative),
- T(i, i*j) <= i,
- if gcd(i, j) = 1 then T(i*j, k) = T(i, k) * T(j, k) (the sequence is multiplicative),
- T(i, 2*i) = A259445(i).
See also A287958 for the LCM equivalent.
Examples
Table starts: n\k| 1 2 3 4 5 6 7 8 9 10 ---+----------------------------------------------- 1 | 1 1 1 1 1 1 1 1 1 1 ... 2 | 1 2 1 2 1 2 1 2 1 2 ... 3 | 1 1 3 1 1 3 1 1 3 1 ... 4 | 1 2 1 4 1 2 1 2 1 2 ... 5 | 1 1 1 1 5 1 1 1 1 5 ... 6 | 1 2 3 2 1 6 1 2 3 2 ... 7 | 1 1 1 1 1 1 7 1 1 1 ... 8 | 1 2 1 2 1 2 1 8 1 2 ... 9 | 1 1 3 1 1 3 1 1 9 1 ... 10 | 1 2 1 2 5 2 1 2 1 10 ... ... T(4, 8) = T(2^2, 2^3) = 2.
Links
- Rémy Sigrist, First 100 antidiagonals of array, flattened
- Rémy Sigrist, Illustration of the first terms
Programs
-
PARI
T(n,k) = my (g=factor(gcd(n,k))); return (prod(i=1, #g~, g[i,1]^T(valuation(n, g[i,1]), valuation(k, g[i,1]))))
A331306 Lexicographically earliest infinite sequence such that a(i) = a(j) => A285732(i) = A285732(j) for all i, j.
1, 2, 2, 3, 4, 5, 6, 5, 3, 7, 8, 9, 10, 9, 11, 12, 13, 7, 6, 14, 15, 16, 17, 14, 18, 13, 19, 20, 21, 22, 23, 11, 8, 23, 24, 25, 26, 27, 28, 19, 29, 17, 30, 31, 32, 33, 34, 35, 30, 15, 12, 28, 36, 37, 38, 39, 40, 41, 42, 24, 43, 22, 42, 44, 45, 46, 47, 48, 49, 50, 36, 20, 16, 35, 51, 52, 53, 54, 55, 56, 57, 58, 51, 31, 59, 27, 50, 60, 61, 62, 63, 64, 65, 66, 67, 68, 44, 25, 21, 41
Offset: 1
Comments
Links
- Antti Karttunen, Table of n, a(n) for n = 1..25425
Programs
-
PARI
up_to = 25425; \\ = binomial(225+1,2) rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; }; A000027pairton(a,b) = ((2+((a+b)^2 - a) - (3*b))/2); A285732sq(n, k) = if(n==k,-n,if(n>k,A000027pairton(n-k,k),A000027pairton(n,k-n))); A285732list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A285732sq(col,(a-(col-1))))); (v); }; v331306 = rgs_transform(A285732list(up_to)); A331306(n) = v331306[n];
A345418 Table read by upward antidiagonals: Given m, n >= 1, write gcd(prime(m),prime(n)) as d = u*prime(m)+v*prime(n) where u, v are minimal; T(m,n) = v.
1, -1, 1, -2, 1, 1, -3, 2, -1, 1, -5, -2, 1, 1, 1, -6, 4, 3, -2, -1, 1, -8, -4, -2, 1, 1, 1, 1, -9, 6, -5, -3, 2, 2, -1, 1, -11, -6, 7, 2, 1, -1, -2, 1, 1, -14, 8, 4, 5, 6, -5, -2, -1, -1, 1, -15, 10, -9, -8, -3, 1, 2, 3, 2, -1, 1, -18, -10, 6, 10, 7, 4, -3, -4, -3, -1, 1, 1
Offset: 1
Comments
The gcd is 1 unless m=n when it is m; u is given in A345417. Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when m=n. If we ignore the diagonal, the v table is the transpose of the u table.
Examples
The u table (A345417) begins: [0, -1, -2, -3, -5, -6, -8, -9, -11, -14, -15, -18, -20, -21, -23, -26] [1, 0, 2, -2, 4, -4, 6, -6, 8, 10, -10, -12, 14, -14, 16, 18] [1, -1, 0, 3, -2, -5, 7, 4, -9, 6, -6, 15, -8, -17, 19, -21] [1, 1, -2, 0, -3, 2, 5, -8, 10, -4, 9, 16, 6, -6, -20, -15] [1, -1, 1, 2, 0, 6, -3, 7, -2, 8, -14, -10, 15, 4, -17, -24] [1, 1, 2, -1, -5, 0, 4, 3, -7, 9, 12, -17, 19, 10, -18, -4] [1, -1, -2, -2, 2, -3, 0, 9, -4, 12, 11, -13, -12, -5, -11, 25] [1, 1, -1, 3, -4, -2, -8, 0, -6, -3, -13, 2, 13, -9, 5, 14] [1, -1, 2, -3, 1, 4, 3, 5, 0, -5, -4, -8, -16, 15, -2, -23] [1, -1, -1, 1, -3, -4, -7, 2, 4, 0, 15, -14, 17, 3, 13, 11] [1, 1, 1, -2, 5, -5, -6, 8, 3, -14, 0, 6, 4, -18, -3, 12] [1, 1, -2, -3, 3, 6, 6, -1, 5, 11, -5, 0, 10, 7, 14, -10] ... The v table (this entry) begins: [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] [ -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1] [ -2, 2, 1, -2, 1, 2, -2, -1, 2, -1, 1, -2, 1, 2, -2, 2] [ -3, -2, 3, 1, 2, -1, -2, 3, -3, 1, -2, -3, -1, 1, 3, 2] [ -5, 4, -2, -3, 1, -5, 2, -4, 1, -3, 5, 3, -4, -1, 4, 5] [ -6, -4, -5, 2, 6, 1, -3, -2, 4, -4, -5, 6, -6, -3, 5, 1] [ -8, 6, 7, 5, -3, 4, 1, -8, 3, -7, -6, 6, 5, 2, 4, -8] [ -9, -6, 4, -8, 7, 3, 9, 1, 5, 2, 8, -1, -6, 4, -2, -5] [-11, 8, -9, 10, -2, -7, -4, -6, 1, 4, 3, 5, 9, -8, 1, 10] [-14, 10, 6, -4, 8, 9, 12, -3, -5, 1, -14, 11, -12, -2, -8, -6] [-15, -10, -6, 9, -14, 12, 11, -13, -4, 15, 1, -5, -3, 13, 2, -7] [-18, -12, 15, 16, -10, -17, -13, 2, -8, -14, 6, 1, -9, -6, -11, 7] ...
A123275 Square array A(n,m) = largest divisor of m which is coprime to n, read by upwards antidiagonals.
1, 1, 2, 1, 1, 3, 1, 2, 3, 4, 1, 1, 1, 1, 5, 1, 2, 3, 4, 5, 6, 1, 1, 3, 1, 5, 3, 7, 1, 2, 1, 4, 5, 2, 7, 8, 1, 1, 3, 1, 1, 3, 7, 1, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 1, 1, 5, 1, 7, 1, 1, 5, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 1, 3, 1, 5, 3, 1, 1, 9, 5, 11, 3, 13, 1, 2, 1, 4, 1, 2, 7, 8, 1, 2
Offset: 1
Comments
Read by upwards antidiagonals as A(1,1), A(2,1), A(1,2), A(3,1), A(2,2), A(1,3), etc.
Seen as a triangle, the rows appear to be the reversed rows of the regular triangle defined by t(n,k) = denominator(n*k/(n-k)) for n>=2 and 1<=kMichel Marcus, Mar 24 2022
Examples
The top left 18 x 18 corner of the array: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1, 17, 9 1, 2, 1, 4, 5, 2, 7, 8, 1, 10, 11, 4, 13, 14, 5, 16, 17, 2 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1, 17, 9 1, 2, 3, 4, 1, 6, 7, 8, 9, 2, 11, 12, 13, 14, 3, 16, 17, 18 1, 1, 1, 1, 5, 1, 7, 1, 1, 5, 11, 1, 13, 7, 5, 1, 17, 1 1, 2, 3, 4, 5, 6, 1, 8, 9, 10, 11, 12, 13, 2, 15, 16, 17, 18 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1, 17, 9 1, 2, 1, 4, 5, 2, 7, 8, 1, 10, 11, 4, 13, 14, 5, 16, 17, 2 1, 1, 3, 1, 1, 3, 7, 1, 9, 1, 11, 3, 13, 7, 3, 1, 17, 9 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 12, 13, 14, 15, 16, 17, 18 1, 1, 1, 1, 5, 1, 7, 1, 1, 5, 11, 1, 13, 7, 5, 1, 17, 1 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 14, 15, 16, 17, 18 1, 1, 3, 1, 5, 3, 1, 1, 9, 5, 11, 3, 13, 1, 15, 1, 17, 9 1, 2, 1, 4, 1, 2, 7, 8, 1, 2, 11, 4, 13, 14, 1, 16, 17, 2 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1, 17, 9 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 18 1, 1, 1, 1, 5, 1, 7, 1, 1, 5, 11, 1, 13, 7, 5, 1, 17, 1 ... A(12,1) = 12 because d=12 is the largest divisor of 12 for which gcd(d,1) = 1. A(12,2) = 3 because d=3 is the largest divisor of 12 for which gcd(d,2) = 1. A(12,3) = 4 because d=4 is the largest divisor of 12 for which gcd(d,3) = 1. A(12,4) = 3 because d=3 is the largest divisor of 12 for which gcd(d,4) = 1. A(12,6) = 1 because d=1 is the largest divisor of 12 for which gcd(d,6) = 1.
Links
Programs
-
Mathematica
t[n_, m_] := Last[Select[Divisors[m], GCD[ #, n] == 1 &]];Flatten[Table[t[i + 1 - j, j], {i, 15}, {j, i}]] (* Ray Chandler, Oct 17 2006 *)
-
Python
# Produces the triangle when the array is read by antidiagonals (upwards) from sympy.ntheory import divisors from math import gcd def T(n,m): return [i for i in divisors(m) if gcd(i,n)==1][-1] for i in range(1, 16): print([T(i+1-j, j) for j in range(1, i+1)]) # Indranil Ghosh, Mar 22 2017
-
Scheme
;; A naive implementation of A020639 given under that entry. The result of (A123275bi b a) is a product of all those prime factors of a (possibly occurring multiple times) that are not prime factors of b: (define (A123275 n) (A123275bi (A004736 n) (A002260 n))) (define (A123275bi b a) (let loop ((a a) (m 1)) (let ((s (A020639 a))) (cond ((= 1 a) m) ((zero? (modulo b s)) (loop (/ a s) m)) (else (loop (/ a s) (* s m))))))) ;; Antti Karttunen, Mar 22 2017
Extensions
Extended by Ray Chandler, Oct 17 2006
Name and Example section edited by Antti Karttunen, Mar 22 2017
A178340 Triangle T(n,m) read by rows: denominator of the coefficient [x^m] of the umbral inverse Bernoulli polynomial B^{-1}(n,x).
1, 2, 1, 3, 1, 1, 4, 1, 2, 1, 5, 1, 1, 1, 1, 6, 1, 2, 3, 2, 1, 7, 1, 1, 1, 1, 1, 1, 8, 1, 2, 1, 4, 1, 2, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 10, 1, 2, 1, 1, 5, 1, 1, 2, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 1, 2, 3, 4, 1, 1, 1, 4, 3, 2, 1, 13
Offset: 0
Comments
This is the triangle of denominators associated with the numerators of A178252.
(Unlike the coefficients of the Bernoulli Polynomials, the coefficients of the umbral inverse Bernoulli polynomials are all positive.)
Usually T(n,m) = A003989(n-m+1,m) for m>=1, but since we are tabulating denominators of reduced fractions here, this formula may be wrong by a cancelling integer factor.
Examples
The triangle T(n,m) begins: n\m 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 0: 1 1: 2 1 2: 3 1 1 3: 4 1 2 1 4: 5 1 1 1 1 5: 6 1 2 3 2 1 6: 7 1 1 1 1 1 1 7: 8 1 2 1 4 1 2 1 8: 9 1 1 3 1 1 3 1 1 9: 10 1 2 1 1 5 1 1 2 1 10: 11 1 1 1 1 1 1 1 1 1 1 11: 12 1 2 3 4 1 1 1 4 3 2 1 12: 13 1 1 1 1 1 1 1 1 1 1 1 1 13: 14 1 2 1 2 1 2 7 2 1 2 1 2 1 14: 15 1 1 3 1 5 3 1 1 3 5 1 3 1 1 ... reformatted. - _Wolfdieter Lang_, Aug 25 2015 ------------------------------------------------- The rational triangle TinvB(n,m):= A178252(n,m) / T(n,m) begins: n\m 0 1 2 3 4 5 6 7 8 9 10 0: 1 1: 1/2 1 2: 1/3 1 1 3 1/4 1 3/2 1 4: 1/5 1 2 2 1 5: 1/6 1 5/2 10/3 5/2 1 6: 1/7 1 3 5 5 3 1 7: 1/8 1 7/2 7 35/4 7 7/2 1 8: 1/9 1 4 28/3 14 14 28/3 4 1 9: 1/10 1 9/2 12 21 126/5 21 12 9/2 1 10: 1/11 1 5 15 30 42 42 30 15 5 1 ... - _Wolfdieter Lang_, Aug 25 2015 Recurrence from the Sheffer a-sequence: Tinv(3,2) = (3/2)*TinvB(2,1) = (3/2)*1 = 3/2. From the z-sequence: Tinv(3,0) = 3*Sum_{j=0..2} z_j*TinvB(2,j) = 3*((1/2)*(1/3) -(1/12)*1 + 0*1) = 3*(1/6 - 1/12) = 1/4. - _Wolfdieter Lang_, Aug 25 2015
Crossrefs
Cf. A178252.
Programs
-
Mathematica
max = 13; coes = Table[ PadRight[ CoefficientList[ BernoulliB[n, x], x], max], {n, 0, max-1}]; inv = Inverse[coes]; Table[ Take[inv[[n]], n], {n, 1, max}] // Flatten // Denominator (* Jean-François Alcover_, Aug 09 2012 *)
Formula
T(n,0) = n+1.
Recurrence for the rational triangle
TinvB(n,m):= A178252(n,m) / T(n,m) from the Sheffer a-sequence, which is 1, (repeat 0), see the comment under A178252: TinvB(n,m) = (n/m)*TinvB(n-1,m-1), for n >= m >= 1. From the z-sequence: TinvB(n,0) = n*Sum_{j=0..n-1} z_j * TinvB(n-1,j), n >= 1, TinvB(0,0) = 1. - Wolfdieter Lang, Aug 25 2015
A180172 a(n) = gcd(prime(n)+2, n).
1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 11, 3, 1, 1, 1, 1, 1, 9, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 5, 1, 1, 1, 1, 1, 9, 1, 1, 13, 5, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 11, 1, 1, 1, 1, 71, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 15, 7, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1
Offset: 1
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[GCD(n,NthPrime(n) +2): n in [1..110]]; // G. C. Greubel, Mar 12 2023
-
Mathematica
Table[GCD[n,Prime[n]+2],{n,200}]
-
SageMath
[gcd(nth_prime(n) + 2, n) for n in range(1,111)] # G. C. Greubel, Mar 12 2023
A261176 Minimum value of (1/2)*Sum_{i=1..n} Sum_{j=1..n} Sum_{k=1..n} Sum_{l=1..n} gcd(b(i,j),b(k,l)) * ((i-k)^2+(j-l)^2) for an n X n matrix b filled with the integers 1 to n^2.
0, 9, 126, 802, 3158, 10040, 25464, 58837, 123422, 238203, 429467, 733923, 1200319, 1912928, 2945116, 4369570, 6338678, 9053512, 12622814, 17359779, 23503546, 31347788, 41161317
Offset: 1
Comments
In one of his programming contests, Al Zimmermann coined the term "Delacorte Numbers" (after G. T. Delacorte, Jr., a New York City philantropist and benefactor) for the sum of D(a,b) = gcd(a,b) * distance^2(a,b), taken over all distinct pairs of integers (a,b) in a rectangular matrix.
The challenge in the contest was to find two kinds of arrangements of 1 to n^2, one minimizing the combined sum (this sequence) and the other maximizing the combined sum (A261177).
All terms beyond a(5) are conjectured based on numerical results. Terms up to a(17) have at least 5 independent verifications.
Upper bounds for the next terms are a(24)<=53670478, a(25)<=68938808, a(26)<=87777189, a(27)<=110759499.
Examples
a(2)=9, because the matrix ((1 2)(3 4)) has Delacorte Number D(1,2) + D(1,3) + D(1,4) + D(2,3) + D(2,4) + D(3,4) = gcd(1,2)*(1^2 + 0^2) + gcd(1,3)*(0^2 + 1^2) + gcd(1,4)*(1^2 + 1^2) + gcd(2,3)*(1^2 + 1^2) + gcd(2,4)*(0^2 + 1^2) + gcd(3,4)*(1^2 + 0^2) = 1*1 + 1*1 + 1*2 + 1*2 + 2*1 + 1*1 = 9. Putting (2,4) in a row or column gives the minimum value of the matrix, whereas putting this pair in one of the diagonals gives the maximum. a(3)=126, because no arrangement of the matrix elements exists that produces a smaller Delacorte Number than e.g. ((1 2 4)(3 6 8)(5 9 7)).
Links
- Al Zimmermann's Programming Contests, Delacorte Numbers, Description, October 2014.
- Al Zimmermann's Programming Contests, Delacorte Numbers, Final Report, January 2015.
- The New York Community Trust: George T. Delacorte.
- Arch D. Robison, Computing Delacorte Numbers with Julia, January 21, 2015.
Comments
Examples
Links
Crossrefs
Programs
Maple
Mathematica
Formula