A285730 Square array: If A001222(n) < k, then A(n,k) = n, otherwise A(n,k) = product of k largest prime factors of n (taken with multiplicity), read by descending antidiagonals.
1, 1, 2, 1, 2, 3, 1, 2, 3, 2, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 3, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 2, 1, 2, 3, 4, 5, 6, 7, 4, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 6, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 7
Offset: 1
Examples
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.
Links
Programs
-
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 *)
-
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
-
Scheme
(define (A285730 n) (A285730bi (A002260 n) (A004736 n))) (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)))))
Comments