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.
%I A286239 #25 Jun 10 2025 13:53:32 %S A286239 1,1,2,3,0,4,3,2,0,7,10,0,0,0,11,3,5,4,0,0,16,21,0,0,0,0,0,22,10,5,0, %T A286239 7,0,0,0,29,21,0,8,0,0,0,0,0,37,10,14,0,0,11,0,0,0,0,46,55,0,0,0,0,0, %U A286239 0,0,0,0,56,10,5,8,12,0,16,0,0,0,0,0,67,78,0,0,0,0,0,0,0,0,0,0,0,79,21,27,0,0,0,0,22,0,0,0,0,0,0,92,36,0,19,0,17,0,0,0,0,0,0,0,0,0,106 %N A286239 Triangular table: T(n,k) = 0 if k does not divide n, otherwise T(n,k) = P(A000010(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 A286239 This sequence packs the values of phi(n/k) and k (whenever k divides n) to a single value, with the pairing function A000027. The two "components" can be accessed with functions A002260 & A004736, which allows us generate from this sequence various sums related to necklace enumeration (among other things). %C A286239 For example, we have: %C A286239 Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * A002260(a(i)) * 2^(A004736(a(i))) = A053635(n). %C A286239 and %C A286239 Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * A002260(a(i)) * 3^(A004736(a(i))) = A054610(n) %C A286239 Triangle A286237 has the same property. %H A286239 Antti Karttunen, <a href="/A286239/b286239.txt">Table of n, a(n) for n = 1..10585; the first 145 rows of triangle/antidiagonals of array</a> %F A286239 As a triangle (with n >= 1, 1 <= k <= n): %F A286239 T(n,k) = 0 if k does not divide n, otherwise T(n,k) = (1/2)*(2 + ((A000010(n/k)+k)^2) - A000010(n/k) - 3*k). %e A286239 The first fifteen rows of triangle: %e A286239 1, %e A286239 1, 2, %e A286239 3, 0, 4, %e A286239 3, 2, 0, 7, %e A286239 10, 0, 0, 0, 11, %e A286239 3, 5, 4, 0, 0, 16, %e A286239 21, 0, 0, 0, 0, 0, 22, %e A286239 10, 5, 0, 7, 0, 0, 0, 29, %e A286239 21, 0, 8, 0, 0, 0, 0, 0, 37, %e A286239 10, 14, 0, 0, 11, 0, 0, 0, 0, 46, %e A286239 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, %e A286239 10, 5, 8, 12, 0, 16, 0, 0, 0, 0, 0, 67, %e A286239 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, %e A286239 21, 27, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 92, %e A286239 36, 0, 19, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106 %e A286239 ------------------------------------------------------------- %e A286239 Note how triangle A286237 contains on each row the same numbers in the same "divisibility-allotted" positions, but in reverse order. %o A286239 (Scheme) %o A286239 (define (A286239 n) (A286239tr (A002024 n) (A002260 n))) %o A286239 (define (A286239tr n k) (if (not (zero? (modulo n k))) 0 (let ((a (A000010 (/ n k))) (b k)) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2))))) %o A286239 (Python) %o A286239 from sympy import totient %o A286239 def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2 %o A286239 def t(n, k): return 0 if n%k!=0 else T(totient(n//k), k) %o A286239 for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)]) # _Indranil Ghosh_, May 09 2017 %Y A286239 Transpose: A286238. %Y A286239 Cf. A000124 (the right edge of the triangle). %Y A286239 Cf. A000010, A000027, A053635, A054610, A054523, A286156, A286237, A286249. %K A286239 nonn,tabl %O A286239 1,3 %A A286239 _Antti Karttunen_, May 06 2017