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.

A286237 Triangular table: T(n,k) = 0 if k does not divide n, otherwise T(n,k) = P(phi(k), n/k), where P is sequence A000027 used as a pairing function N x N -> N, and phi is Euler totient function, A000010. Table is read by rows as T(1,1), T(2,1), T(2,2), etc.

Original entry on oeis.org

1, 2, 1, 4, 0, 3, 7, 2, 0, 3, 11, 0, 0, 0, 10, 16, 4, 5, 0, 0, 3, 22, 0, 0, 0, 0, 0, 21, 29, 7, 0, 5, 0, 0, 0, 10, 37, 0, 8, 0, 0, 0, 0, 0, 21, 46, 11, 0, 0, 14, 0, 0, 0, 0, 10, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 67, 16, 12, 8, 0, 5, 0, 0, 0, 0, 0, 10, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 92, 22, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 21, 106, 0, 17, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36
Offset: 1

Views

Author

Antti Karttunen, May 05 2017

Keywords

Comments

Equally: square array A(n,k) = P(A000010(n), (n+k-1)/n) if n divides (n+k-1), 0 otherwise, read by descending antidiagonals as A(1,1), A(1,2), A(2,1), etc. Here P is sequence A000027 used as a pairing function N x N -> N.
When viewed as a triangular table, this sequence packs the values of phi(k) and quotient n/k (when it is integral) 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).
For example, we have:
Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * A002260(a(i)) * 2^(A004736(a(i))) = A053635(n).
and
Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * A002260(a(i)) * 3^(A004736(a(i))) = A054610(n).

Examples

			The first fifteen rows of the triangle:
    1,
    2,  1,
    4,  0,  3,
    7,  2,  0,  3,
   11,  0,  0,  0, 10,
   16,  4,  5,  0,  0,  3,
   22,  0,  0,  0,  0,  0, 21,
   29,  7,  0,  5,  0,  0,  0, 10,
   37,  0,  8,  0,  0,  0,  0,  0, 21,
   46, 11,  0,  0, 14,  0,  0,  0,  0, 10,
   56,  0,  0,  0,  0,  0,  0,  0,  0,  0, 55,
   67, 16, 12,  8,  0,  5,  0,  0,  0,  0,  0, 10,
   79,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 78,
   92, 22,  0,  0,  0,  0, 27,  0,  0,  0,  0,  0,  0, 21,
  106,  0, 17,  0, 19,  0,  0,  0,  0,  0,  0,  0,  0,  0, 36
---------------------------------------------------------------
Note how triangle A286239 contains on each row the same numbers in the same "divisibility-allotted" positions, but in reverse order.
In the following examples: a = this sequence interpreted as a one-dimensional sequence, A = interpreted as a square array, T = interpreted as a triangular table, P = A000027 interpreted as a pairing function N x N -> N, phi = Euler totient function, A000010.
---
a(7) = A(1,4) = T(4,1) = P(phi(1),4/1) = P(1,4) = 1+(((1+4)^2 - 1 - (3*4))/2) = 7.
a(30) = A(2,7) = T(8,2) = P(phi(2),8/2) = P(1,4) (i.e., same as above) = 7.
a(10) = A(5,1) = T(5,5) = P(phi(5),5/5) = P(4,1) = 1+(((4+1)^2 - 4 - (3*1))/2) = 10.
a(110) = A(5,11) = T(15,5) = P(phi(5),15/5) = P(4,3) = 1+((4+3)^2 - 4 - (3*3))/2 = 19.
		

Crossrefs

Transpose: A286236.
Cf. A000124 (left edge of the triangle), A000217 (every number at the right edge is a triangular number).

Programs

  • Mathematica
    (* Based on Python script by Indranil Ghosh *)
    T[n_, m_] := ((n + m)^2 - n - 3*m + 2)/2
    t[n_, k_] := If[Mod[n, k] != 0, 0, T[EulerPhi[k], n/k]]
    Table[t[n, k], {n, 1, 20}, {k, 1, n}]
    (* David Radcliffe, Jun 12 2025 *)
  • Python
    from sympy import totient
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def t(n, k): return 0 if n%k!=0 else T(totient(k), n//k)
    for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 10 2017
  • Scheme
    (define (A286237 n) (A286237bi (A002260 n) (A004736 n)))
    (define (A286237bi row col) (if (not (zero? (modulo (+ row col -1) row))) 0 (let ((a (A000010 row)) (b (quotient (+ row col -1) row))) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2)))))
    ;; Alternatively, with triangular indexing:
    (define (A286237 n) (A286237tr (A002024 n) (A002260 n)))
    (define (A286237tr n k) (if (not (zero? (modulo n k))) 0 (let ((a (A000010 k)) (b (/ n k))) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2)))))
    ;; Note that: (A286237tr n k) is equal to (A286237bi k (+ 1 (- n k))).
    

Formula

As a triangle (with n >= 1, 1 <= k <= n):
T(n,k) = 0 if k does not divide n, otherwise T(n,k) = (1/2)*(2 + ((A000010(k)+(n/k))^2) - A000010(k) - 3*(n/k)).
T(n,k) = A051731(n,k) * A286235(n,k).
Other identities. For all n >= 1:
T(prime(n),prime(n)) = A000217(prime(n)-1).

A286245 Triangular table T(n,k) = P(A046523(k), floor(n/k)), read by rows as T(1,1), T(2,1), T(2,2), etc. Here P is sequence A000027 used as a pairing function N x N -> N.

Original entry on oeis.org

1, 2, 3, 4, 3, 3, 7, 5, 3, 10, 11, 5, 3, 10, 3, 16, 8, 5, 10, 3, 21, 22, 8, 5, 10, 3, 21, 3, 29, 12, 5, 14, 3, 21, 3, 36, 37, 12, 8, 14, 3, 21, 3, 36, 10, 46, 17, 8, 14, 5, 21, 3, 36, 10, 21, 56, 17, 8, 14, 5, 21, 3, 36, 10, 21, 3, 67, 23, 12, 19, 5, 27, 3, 36, 10, 21, 3, 78, 79, 23, 12, 19, 5, 27, 3, 36, 10, 21, 3, 78, 3
Offset: 1

Views

Author

Antti Karttunen, May 06 2017

Keywords

Comments

Equally: square array A(n,k) = P(A046523(n), floor((n+k-1)/n)), read by descending antidiagonals as A(1,1), A(1,2), A(2,1), etc. Here P is a two-argument form of sequence A000027 used as a pairing function N x N -> N.

Examples

			The first fifteen rows of triangle:
    1,
    2,  3,
    4,  3,  3,
    7,  5,  3, 10,
   11,  5,  3, 10, 3,
   16,  8,  5, 10, 3, 21,
   22,  8,  5, 10, 3, 21, 3,
   29, 12,  5, 14, 3, 21, 3, 36,
   37, 12,  8, 14, 3, 21, 3, 36, 10,
   46, 17,  8, 14, 5, 21, 3, 36, 10, 21,
   56, 17,  8, 14, 5, 21, 3, 36, 10, 21, 3,
   67, 23, 12, 19, 5, 27, 3, 36, 10, 21, 3, 78,
   79, 23, 12, 19, 5, 27, 3, 36, 10, 21, 3, 78, 3,
   92, 30, 12, 19, 5, 27, 5, 36, 10, 21, 3, 78, 3, 21,
  106, 30, 17, 19, 8, 27, 5, 36, 10, 21, 3, 78, 3, 21, 21
		

Crossrefs

Transpose: A286244.
Cf. A286247 (same triangle but with zeros in positions where k does not divide n), A286235.

Programs

  • Python
    from sympy import factorint
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def t(n, k): return T(a046523(k), int(n//k))
    for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286245 n) (A286245bi (A002260 n) (A004736 n)))
    (define (A286245bi row col) (let ((a (A046523 row)) (b (quotient (+ row col -1) row))) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2))))
    

Formula

As a triangle (with n >= 1, 1 <= k <= n):
T(n,k) = (1/2)*(2 + ((A046523(k)+floor(n/k))^2) - A046523(k) - 3*floor(n/k)).

A286249 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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Antti Karttunen, May 06 2017

Keywords

Comments

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.
For example, we have:
Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * mu(A002260(a(i))) * 2^(A004736(a(i))) = A027375(n).
and
Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * mu(A002260(a(i))) * 3^(A004736(a(i))) = A054718(n).
Triangle A286247 has the same property.

Examples

			The first fifteen rows of triangle:
   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, 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,  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
  -------------------------------------------------------------
Note how triangle A286247 contains on each row the same numbers in the same "divisibility-allotted" positions, but in reverse order.
		

Crossrefs

Transpose: A286248 (triangle reversed).
Cf. A000124 (the right edge of the triangle).

Programs

  • Python
    from sympy import factorint
    import math
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def t(n, k): return 0 if n%k!=0 else T(a046523(n//k), k)
    for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 08 2017
  • Scheme
    (define (A286249 n) (A286249tr (A002024 n) (A002260 n)))
    (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)))))
    

Formula

As a triangle (with n >= 1, 1 <= k <= n):
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).

A286246 Square array A(n,k) = P(A046523(k), (n+k-1)/k) if k divides (n+k-1), 0 otherwise, read by descending antidiagonals as A(1,1), A(1,2), A(2,1), etc. Here P is a two-argument form of sequence A000027 used as a pairing function N x N -> N.

Original entry on oeis.org

1, 3, 2, 3, 0, 4, 10, 0, 5, 7, 3, 0, 0, 0, 11, 21, 0, 0, 5, 8, 16, 3, 0, 0, 0, 0, 0, 22, 36, 0, 0, 0, 14, 0, 12, 29, 10, 0, 0, 0, 0, 0, 8, 0, 37, 21, 0, 0, 0, 0, 5, 0, 0, 17, 46, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 78, 0, 0, 0, 0, 0, 27, 0, 19, 12, 23, 67, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 21, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 30, 92, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 17, 0, 106
Offset: 1

Views

Author

Antti Karttunen, May 06 2017

Keywords

Examples

			The top left 12 X 12 corner of the array:
   1,  3,  3, 10,  3, 21,  3, 36, 10, 21,  3, 78
   2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
   4,  5,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
   7,  0,  5,  0,  0,  0,  0,  0,  0,  0,  0,  0
  11,  8,  0, 14,  0,  0,  0,  0,  0,  0,  0,  0
  16,  0,  0,  0,  5,  0,  0,  0,  0,  0,  0,  0
  22, 12,  8,  0,  0, 27,  0,  0,  0,  0,  0,  0
  29,  0,  0,  0,  0,  0,  5,  0,  0,  0,  0,  0
  37, 17,  0, 19,  0,  0,  0, 44,  0,  0,  0,  0
  46,  0, 12,  0,  0,  0,  0,  0, 14,  0,  0,  0
  56, 23,  0,  0,  8,  0,  0,  0,  0, 27,  0,  0
  67,  0,  0,  0,  0,  0,  0,  0,  0,  0,  5,  0
The first fifteen rows of triangle:
   1,
   3, 2,
   3, 0, 4,
  10, 0, 5, 7,
   3, 0, 0, 0, 11,
  21, 0, 0, 5,  8, 16,
   3, 0, 0, 0,  0,  0, 22,
  36, 0, 0, 0, 14,  0, 12, 29,
  10, 0, 0, 0,  0,  0,  8,  0, 37,
  21, 0, 0, 0,  0,  5,  0,  0, 17, 46,
   3, 0, 0, 0,  0,  0,  0,  0,  0,  0, 56,
  78, 0, 0, 0,  0,  0, 27,  0, 19, 12, 23, 67,
   3, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 79,
  21, 0, 0, 0,  0,  0,  0,  5,  0,  0,  0,  0, 30, 92,
  21, 0, 0, 0,  0,  0,  0,  0,  0,  0,  8,  0, 17,  0, 106
		

Crossrefs

Programs

  • Python
    from sympy import factorint
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def A(n, k): return 0 if (n + k - 1)%k!=0 else T(a046523(k), (n + k - 1)//k)
    for n in range(1, 21): print([A(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286246 n) (A286246bi (A002260 n) (A004736 n)))
    (define (A286246bi row col) (if (not (zero? (modulo (+ row col -1) col))) 0 (let ((a (A046523 col)) (b (/ (+ row col -1) col))) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2)))))
    ;; Alternatively, with triangular indexing:
    (define (A286246 n) (A286246tr (A002024 n) (A002260 n)))
    (define (A286246tr n k) (A286246bi k (+ 1 (- n k))))
    

Formula

T(n,k) = A113998(n,k) * A286244(n,k).
Showing 1-4 of 4 results.