OFFSET
0,2
EXAMPLE
If first row gives the sums and the third row the differences, then:
.4 11 22 35 51 70 92 117 145
1 3 8 14 21 30 40 52 65 80 ... [this sequence]
.2 5 6 7 9 10 12 13 15
PROG
(PLT Scheme)
(define (element? item a-list)
(ormap (lambda (i) (equal? item i)) a-list))
(define (A098762 n seq bad ops)
(local ((define newbads (map (lambda (op) (op n (first seq))) ops))
(define (ok? n)
(and (not (element? n bad))
(not (ormap (lambda (x) (element? x bad)) newbads))
(not (ormap (lambda (x) (element? x seq)) newbads)))))
(cond
[(> n 10000) (reverse seq)]
[(ok? n) (A098762 (add1 n) (cons n seq) (append newbads bad) ops)]
[else (A098762 (add1 n) seq bad ops)])))
(A098762 2 (list 1) empty (list + -))
;; Joshua Zucker, Jul 27 2006
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Eric Angelini, Oct 01 2004
EXTENSIONS
Better definition from Joshua Zucker, Jul 27 2006
STATUS
approved