A225653 Numbers n such that A225634(n) = A225644(n).
0, 1, 21, 30, 33, 35, 36, 40, 42, 44, 48, 51, 52, 56, 57, 58, 60, 62, 63, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 82, 84, 85, 88, 91, 92, 96
Offset: 0
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.
The top-left corner of the array: 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ... 1, 1, 2, 6, 12, 30, 30, 84, 120, 180, 210, 330, 420, ... 1, 1, 2, 6, 12, 60, 60, 420, 840, 1260, 840, 4620, 4620, ... 1, 1, 2, 6, 12, 60, 60, 420, 840, 2520, 2520, 13860, 13860, ... 1, 1, 2, 6, 12, 60, 60, 420, 840, 2520, 2520, 27720, 27720, ... ...
(define (A225640 n) (A225640bi (A025581 n) (A002262 n))) (define (A225640bi col row) (let ((maxlcm (list 0))) (let loop ((prevmaxlcm (max 1 col)) (stepsleft row)) (if (zero? stepsleft) prevmaxlcm (begin (gen_partitions col (lambda (p) (set-car! maxlcm (max (car maxlcm) (apply lcm (cons prevmaxlcm p)))))) (loop (car maxlcm) (- stepsleft 1))))))) (define (gen_partitions m colfun) (let recurse ((m m) (b m) (n 0) (partition (list))) (cond ((zero? m) (colfun partition)) (else (let loop ((i 1)) (recurse (- m i) i (+ 1 n) (cons i partition)) (if (< i (min b m)) (loop (+ 1 i))))))))
The first fifteen rows of table are: 1; 2; 3, 6; 4, 12; 5, 30, 60; 6, 30, 60; 7, 84, 420; 8, 120, 840; 9, 180, 1260, 2520; 10, 210, 840, 2520; 11, 330, 4620, 13860, 27720; 12, 420, 4620, 13860, 27720; 13, 780, 8580, 60060, 180180, 360360; 14, 630, 8190, 90090, 360360; 15, 840, 10920, 120120, 360360;
b[n_, i_] := b[n, i] = If[n == 0, {1}, If[i < 1, {}, Table[Map[Function[{x}, LCM[x, If[j == 0, 1, i]]], b[n - i * j, i - 1]], {j, 0, n/i}]]]; T[n_] := T[n] = Module[{d, h, t, lis}, t = b[n, n]; lis = {}; d = n; h = 0; While[d != h, AppendTo[lis, d]; h = d; d = Max[Table[LCM[h, i], {i, t}]]]; lis]; Table[T[n], {n, 1, 20}] // Flatten (* Jean-François Alcover, Mar 02 2016, after Alois P. Heinz *)
(define (A225634 n) (count_number_of_distinct_lcms_of_partitions_until_fixed_point_met n 1)) (define (count_number_of_distinct_lcms_of_partitions_until_fixed_point_met n initial_value) (let loop ((lcms (list initial_value initial_value))) (fold_over_partitions_of n 1 lcm (lambda (p) (set-car! lcms (max (car lcms) (lcm (second lcms) p))))) (if (= (car lcms) (second lcms)) (length (cdr lcms)) (loop (cons (car lcms) lcms))))) (define (fold_over_partitions_of m initval addpartfun colfun) (let recurse ((m m) (b m) (n 0) (partition initval)) (cond ((zero? m) (colfun partition)) (else (let loop ((i 1)) (recurse (- m i) i (+ 1 n) (addpartfun i partition)) (if (< i (min b m)) (loop (+ 1 i))))))))
Row 7 of A225632 is: 1, 12, 84, 420; Row 7 of A225642 is: 7, 84, 420; the last two terms (84 and 420) are common to them, thus a(7)=2. Row 14 of A225632 is: 1, 84, 1260, 16380, 180180, 360360; Row 14 of A225642 is: 14, 630, 8190, 90090, 360360; they have no common term until as the last term of those rows (which is A003418(14)=360360), thus a(14)=1.
Looking at A225632 and A225642, which are just arrays A225630 and A225640 transposed and eventually repeating values removed, we see that: row 11 of A225632 is 1, 30, 420, 4620, 13860, 27720; row 11 of A225642 is 11, 330, 4620, 13860, 27720; their first common term, 4620 (= A226055(11)), occurs as two positions after the initial 11 of that row in A225642, thus a(11)=2. Equivalently, 4620 occurs as the element A(2,11) of array A225640.
(define (A225639 n) (if (zero? n) n (let ((fun1 (lambda (seed) (let ((max1 (list 0))) (fold_over_partitions_of n 1 lcm (lambda (p) (set-car! max1 (max (car max1) (lcm seed p))))) (car max1)))) (fun2 (lambda (seed) (let ((max2 (list 0))) (fold_over_partitions_of n (max 1 n) lcm (lambda (p) (set-car! max2 (max (car max2) (lcm seed p))))) (car max2))))) (steps-to-convergence-nondecreasing fun2 fun1 n 1)))) (define (fold_over_partitions_of m initval addpartfun colfun) (let recurse ((m m) (b m) (n 0) (partition initval)) (cond ((zero? m) (colfun partition)) (else (let loop ((i 1)) (recurse (- m i) i (+ 1 n) (addpartfun i partition)) (if (< i (min b m)) (loop (+ 1 i)))))))) (define (steps-to-convergence-nondecreasing fun1 fun2 initval1 initval2) (let loop ((steps 0) (a1 initval1) (a2 initval2)) (cond ((equal? a1 a2) steps) ((< a1 a2) (loop (+ steps 1) (fun1 a1) a2)) (else (loop steps a1 (fun2 a2))))))
Comments