OFFSET
1,3
COMMENTS
Square array A(n,k) [where n is row and k is column] is read by descending antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc
LINKS
EXAMPLE
The top left 5x18 corner of the array:
1, 1, 1, 1, 1
2, 2, 2, 2, 2
3, 3, 3, 3, 3
2, 4, 4, 4, 4
5, 5, 5, 5, 5
3, 6, 6, 6, 6
7, 7, 7, 7, 7
2, 4, 8, 8, 8
3, 9, 9, 9, 9
5, 10, 10, 10, 10
11, 11, 11, 11, 11
3, 6, 12, 12, 12
13, 13, 13, 13, 13
7, 14, 14, 14, 14
5, 15, 15, 15, 15
2, 4, 8, 16, 16
17, 17, 17, 17, 17
3, 9, 18, 18, 18
For A(18,1) we take just the largest prime factor of 18 = 2*3*3, thus A(18,1) = 3.
For A(18,2) we take the product of two largest prime factors of 18 (duplicates not discarded), thus A(18,2) = 3*3 = 9.
For A(18,3) we take the product of three largest prime factors of 18, thus A(18,2) = 3*3*2 = 18.
MATHEMATICA
With[{nn = 14}, Function[s, Table[s[[#, k]] &[n - k + 1], {n, nn}, {k, n, 1, -1}]]@ MapIndexed[PadRight[#1, nn, First@ #2] &, Table[FoldList[Times, Reverse@ Flatten[FactorInteger[n] /. {p_, e_} /; e > 0 :> ConstantArray[p, e]]], {n, nn}]]] // Flatten (* Michael De Vlieger, Apr 28 2017 *)
PROG
(Scheme)
(define (A285730bi row col) (let loop ((n row) (k col) (m 1)) (if (zero? k) m (loop (/ n (A006530 n)) (- k 1) (* m (A006530 n))))))
;; Alternatively, implemented with the given recurrence formula:
(define (A285730bi row col) (if (= 1 col) (A006530 row) (* (A006530 row) (A285730bi (A052126 row) (- col 1)))))
(Python)
from sympy import primefactors
def a006530(n): return 1 if n==1 else max(primefactors(n))
def A(n, k): return a006530(n) if k==1 else a006530(n)*A(n/a006530(n), k - 1)
for n in range(1, 21): print [A(k, n - k + 1) for k in range(1, n + 1)] # Indranil Ghosh, Apr 28 2017
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Apr 28 2017
STATUS
approved