OFFSET
0,3
COMMENTS
Positions of zeros in A225654.
PROG
(Scheme with Antti Karttunen's IntSeq-library):
(define A225653 (MATCHING-POS 0 0 inA225653?))
(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))))
(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))))))
(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))))))))
;; Alternatively, but somewhat slower, as:
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 16 2013
STATUS
approved