login
Numbers n such that A225634(n) = A225644(n).
5

%I #8 May 23 2013 14:44:24

%S 0,1,21,30,33,35,36,40,42,44,48,51,52,56,57,58,60,62,63,65,66,68,69,

%T 70,72,74,75,76,77,78,80,82,84,85,88,91,92,96

%N Numbers n such that A225634(n) = A225644(n).

%C Positions of zeros in A225654.

%o (Scheme with _Antti Karttunen_'s IntSeq-library):

%o (define A225653 (MATCHING-POS 0 0 inA225653?))

%o (define (inA225653? n) (or (zero? 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 n lcm (lambda (p) (set-car! max2 (max (car max2) (lcm seed p))))) (car max2))))) (equal-steps-to-convergence-nondecreasing? fun1 fun2 1 n))))

%o (define (equal-steps-to-convergence-nondecreasing? fun1 fun2 initval1 initval2) (let loop ((steps 0) (a1 initval1) (a2 initval2)) (cond ((equal? a1 a2) (zero? steps)) ((< a1 a2) (loop (+ steps 1) (fun1 a1) a2)) (else (loop (- steps 1) a1 (fun2 a2))))))

%o (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))))))))

%o ;; Alternatively, but somewhat slower, as:

%o (define A225653v2 (MATCHING-POS 0 0 (lambda (i) (= (A225634 i) (A225644 i)))))

%Y Cf. A225648, A225649, A225650, A225651, A225654.

%K nonn

%O 0,3

%A _Antti Karttunen_, May 16 2013