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-3 of 3 results.

A286235 Triangular table T(n,k) = P(phi(k), floor(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, 1, 3, 7, 2, 3, 3, 11, 2, 3, 3, 10, 16, 4, 5, 3, 10, 3, 22, 4, 5, 3, 10, 3, 21, 29, 7, 5, 5, 10, 3, 21, 10, 37, 7, 8, 5, 10, 3, 21, 10, 21, 46, 11, 8, 5, 14, 3, 21, 10, 21, 10, 56, 11, 8, 5, 14, 3, 21, 10, 21, 10, 55, 67, 16, 12, 8, 14, 5, 21, 10, 21, 10, 55, 10, 79, 16, 12, 8, 14, 5, 21, 10, 21, 10, 55, 10, 78, 92, 22, 12, 8, 14, 5, 27, 10, 21, 10, 55, 10, 78, 21
Offset: 1

Views

Author

Antti Karttunen, May 05 2017

Keywords

Comments

Equally: square array A(n,k) = P(A000010(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 the triangle:
    1,
    2,  1,
    4,  1,  3,
    7,  2,  3, 3,
   11,  2,  3, 3, 10,
   16,  4,  5, 3, 10, 3,
   22,  4,  5, 3, 10, 3, 21,
   29,  7,  5, 5, 10, 3, 21, 10,
   37,  7,  8, 5, 10, 3, 21, 10, 21,
   46, 11,  8, 5, 14, 3, 21, 10, 21, 10,
   56, 11,  8, 5, 14, 3, 21, 10, 21, 10, 55,
   67, 16, 12, 8, 14, 5, 21, 10, 21, 10, 55, 10,
   79, 16, 12, 8, 14, 5, 21, 10, 21, 10, 55, 10, 78,
   92, 22, 12, 8, 14, 5, 27, 10, 21, 10, 55, 10, 78, 21,
  106, 22, 17, 8, 19, 5, 27, 10, 21, 10, 55, 10, 78, 21, 36
		

Crossrefs

Transpose: A286234.
Cf. A286237 (same triangle but with zeros in positions where k does not divide n).

Programs

  • Mathematica
    Map[(2 + (#1 + #2)^2 - #1 - 3 #2)/2 & @@ # & /@ # &, Table[{EulerPhi@ k, Floor[n/k]}, {n, 14}, {k, n}]] // Flatten (* Michael De Vlieger, May 06 2017 *)
  • Python
    from sympy import totient
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def t(n, k): return T(totient(k), int(n//k))
    for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 11 2017
  • Scheme
    (define (A286235 n) (A286235bi (A002260 n) (A004736 n)))
    (define (A286235bi row col) (let ((a (A000010 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 + ((A000010(k)+floor(n/k))^2) - A000010(k) - 3*floor(n/k)).

A286236 Square array A(n,k) = P(A000010(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, 1, 2, 3, 0, 4, 3, 0, 2, 7, 10, 0, 0, 0, 11, 3, 0, 0, 5, 4, 16, 21, 0, 0, 0, 0, 0, 22, 10, 0, 0, 0, 5, 0, 7, 29, 21, 0, 0, 0, 0, 0, 8, 0, 37, 10, 0, 0, 0, 0, 14, 0, 0, 11, 46, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 10, 0, 0, 0, 0, 0, 5, 0, 8, 12, 16, 67, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 21, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 22, 92, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 17, 0, 106
Offset: 1

Views

Author

Antti Karttunen, May 05 2017

Keywords

Comments

This is transpose of A286237, see comments there.

Examples

			The top left 12 X 12 corner of the array:
   1,  1,  3,  3, 10, 3, 21, 10, 21, 10, 55, 10
   2,  0,  0,  0,  0, 0,  0,  0,  0,  0,  0,  0
   4,  2,  0,  0,  0, 0,  0,  0,  0,  0,  0,  0
   7,  0,  5,  0,  0, 0,  0,  0,  0,  0,  0,  0
  11,  4,  0,  5,  0, 0,  0,  0,  0,  0,  0,  0
  16,  0,  0,  0, 14, 0,  0,  0,  0,  0,  0,  0
  22,  7,  8,  0,  0, 5,  0,  0,  0,  0,  0,  0
  29,  0,  0,  0,  0, 0, 27,  0,  0,  0,  0,  0
  37, 11,  0,  8,  0, 0,  0, 14,  0,  0,  0,  0
  46,  0, 12,  0,  0, 0,  0,  0, 27,  0,  0,  0
  56, 16,  0,  0, 19, 0,  0,  0,  0, 14,  0,  0
  67,  0,  0,  0,  0, 0,  0,  0,  0,  0, 65,  0
The first 15 rows when viewed as a triangle:
   1,
   1, 2,
   3, 0, 4,
   3, 0, 2, 7,
  10, 0, 0, 0, 11,
   3, 0, 0, 5,  4, 16,
  21, 0, 0, 0,  0,  0, 22,
  10, 0, 0, 0,  5,  0,  7, 29,
  21, 0, 0, 0,  0,  0,  8,  0, 37,
  10, 0, 0, 0,  0, 14,  0,  0, 11, 46,
  55, 0, 0, 0,  0,  0,  0,  0,  0,  0, 56,
  10, 0, 0, 0,  0,  0,  5,  0,  8, 12, 16, 67,
  78, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0, 79,
  21, 0, 0, 0,  0,  0,  0, 27,  0,  0,  0,  0, 22, 92,
  36, 0, 0, 0,  0,  0,  0,  0,  0,  0, 19,  0, 17,  0, 106
		

Crossrefs

Programs

  • Mathematica
    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[Reverse[t[n, #] & /@ Range[n]], {n, 1, 20}] (* 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)][::-1]) # Indranil Ghosh, May 10 2017
  • Scheme
    (define (A286236 n) (A286236bi (A002260 n) (A004736 n)))
    (define (A286236bi row col) (if (not (zero? (modulo (+ row col -1) col))) 0 (let ((a (A000010 col)) (b (/ (+ row col -1) col))) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2)))))
    ;; Alternatively, with triangular indexing:
    (define (A286236 n) (A286236tr (A002024 n) (A002260 n)))
    (define (A286236tr n k) (A286236bi k (+ 1 (- n k))))
    

Formula

T(n,k) = A113998(n,k) * A286234(n,k).

A286244 Square array A(n,k) = P(A046523(k), floor((n+k-1)/k)), 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, 3, 4, 10, 3, 5, 7, 3, 10, 3, 5, 11, 21, 3, 10, 5, 8, 16, 3, 21, 3, 10, 5, 8, 22, 36, 3, 21, 3, 14, 5, 12, 29, 10, 36, 3, 21, 3, 14, 8, 12, 37, 21, 10, 36, 3, 21, 5, 14, 8, 17, 46, 3, 21, 10, 36, 3, 21, 5, 14, 8, 17, 56, 78, 3, 21, 10, 36, 3, 27, 5, 19, 12, 23, 67, 3, 78, 3, 21, 10, 36, 3, 27, 5, 19, 12, 23, 79
Offset: 1

Views

Author

Antti Karttunen, May 06 2017

Keywords

Comments

Transpose of A286245.

Examples

			The top left 12 X 12 corner of the array:
   1,  3,  3, 10, 3, 21, 3, 36, 10, 21, 3, 78
   2,  3,  3, 10, 3, 21, 3, 36, 10, 21, 3, 78
   4,  5,  3, 10, 3, 21, 3, 36, 10, 21, 3, 78
   7,  5,  5, 10, 3, 21, 3, 36, 10, 21, 3, 78
  11,  8,  5, 14, 3, 21, 3, 36, 10, 21, 3, 78
  16,  8,  5, 14, 5, 21, 3, 36, 10, 21, 3, 78
  22, 12,  8, 14, 5, 27, 3, 36, 10, 21, 3, 78
  29, 12,  8, 14, 5, 27, 5, 36, 10, 21, 3, 78
  37, 17,  8, 19, 5, 27, 5, 44, 10, 21, 3, 78
  46, 17, 12, 19, 5, 27, 5, 44, 14, 21, 3, 78
  56, 23, 12, 19, 8, 27, 5, 44, 14, 27, 3, 78
  67, 23, 12, 19, 8, 27, 5, 44, 14, 27, 5, 78
The first fifteen rows when viewed as a triangle:
   1,
   3,  2,
   3,  3,  4,
  10,  3,  5,  7,
   3, 10,  3,  5, 11,
  21,  3, 10,  5,  8, 16,
   3, 21,  3, 10,  5,  8, 22,
  36,  3, 21,  3, 14,  5, 12, 29,
  10, 36,  3, 21,  3, 14,  8, 12, 37,
  21, 10, 36,  3, 21,  5, 14,  8, 17, 46,
   3, 21, 10, 36,  3, 21,  5, 14,  8, 17, 56,
  78,  3, 21, 10, 36,  3, 27,  5, 19, 12, 23, 67,
   3, 78,  3, 21, 10, 36,  3, 27,  5, 19, 12, 23, 79,
  21,  3, 78,  3, 21, 10, 36,  5, 27,  5, 19, 12, 30, 92,
  21, 21,  3, 78,  3, 21, 10, 36,  5, 27,  8, 19, 17, 30, 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 T(a046523(k), int((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 (A286244 n) (A286244bi (A002260 n) (A004736 n)))
    (define (A286244bi row col) (let ((a (A046523 col)) (b (quotient (+ row col -1) col))) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2))))
    
Showing 1-3 of 3 results.