%I #27 Feb 16 2025 08:33:44
%S 1,3,2,3,0,4,10,5,0,7,3,0,0,0,11,21,5,8,0,0,16,3,0,0,0,0,0,22,36,14,0,
%T 12,0,0,0,29,10,0,8,0,0,0,0,0,37,21,5,0,0,17,0,0,0,0,46,3,0,0,0,0,0,0,
%U 0,0,0,56,78,27,19,12,0,23,0,0,0,0,0,67,3,0,0,0,0,0,0,0,0,0,0,0,79,21,5,0,0,0,0,30,0,0,0,0,0,0,92,21,0,8,0,17,0,0,0,0,0,0,0,0,0,106
%N Triangular table: T(n,k) = 0 if k does not divide n, otherwise T(n,k) = P(A046523(n/k), k), where P is sequence A000027 used as a pairing function N x N -> N. Table is read by rows as T(1,1), T(2,1), T(2,2), etc.
%C This sequence packs the values of A046523(n/k) and k (whenever k divides n) to a single term with the pairing function A000027. The two "components" can be accessed with functions A002260 & A004736, which allows us to generate from this sequence (among other things) various sums related to the enumeration of aperiodic necklaces, because Moebius mu (A008683) obtains the same value on any representative of the same prime signature.
%C For example, we have:
%C Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * mu(A002260(a(i))) * 2^(A004736(a(i))) = A027375(n).
%C and
%C Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * mu(A002260(a(i))) * 3^(A004736(a(i))) = A054718(n).
%C Triangle A286247 has the same property.
%H Antti Karttunen, <a href="/A286249/b286249.txt">Table of n, a(n) for n = 1..10585; the first 145 rows of triangle/antidiagonals of array</a>
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F As a triangle (with n >= 1, 1 <= k <= n):
%F T(n,k) = 0 if k does not divide n, otherwise T(n,k) = (1/2)*(2 + ((A046523(n/k)+k)^2) - A046523(n/k) - 3*k).
%e The first fifteen rows of triangle:
%e 1,
%e 3, 2,
%e 3, 0, 4,
%e 10, 5, 0, 7,
%e 3, 0, 0, 0, 11,
%e 21, 5, 8, 0, 0, 16,
%e 3, 0, 0, 0, 0, 0, 22,
%e 36, 14, 0, 12, 0, 0, 0, 29,
%e 10, 0, 8, 0, 0, 0, 0, 0, 37,
%e 21, 5, 0, 0, 17, 0, 0, 0, 0, 46,
%e 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,
%e 78, 27, 19, 12, 0, 23, 0, 0, 0, 0, 0, 67,
%e 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,
%e 21, 5, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 92,
%e 21, 0, 8, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106
%e -------------------------------------------------------------
%e Note how triangle A286247 contains on each row the same numbers in the same "divisibility-allotted" positions, but in reverse order.
%o (Scheme)
%o (define (A286249 n) (A286249tr (A002024 n) (A002260 n)))
%o (define (A286249tr n k) (if (not (zero? (modulo n k))) 0 (let ((a (A046523 (/ n k))) (b k)) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2)))))
%o (Python)
%o from sympy import factorint
%o import math
%o def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
%o def P(n):
%o f = factorint(n)
%o return sorted([f[i] for i in f])
%o def a046523(n):
%o x=1
%o while True:
%o if P(n) == P(x): return x
%o else: x+=1
%o def t(n, k): return 0 if n%k!=0 else T(a046523(n/k), k)
%o for n in range(1, 21): print [t(n, k) for k in range(1, n + 1)] # _Indranil Ghosh_, May 08 2017
%Y Transpose: A286248 (triangle reversed).
%Y Cf. A000027, A008683, A027375, A046523, A054718, A054525, A286156, A286247, A286239.
%Y Cf. A000124 (the right edge of the triangle).
%K nonn,tabl,changed
%O 1,2
%A _Antti Karttunen_, May 06 2017