login
A098762
This sequence, the sequence of first differences and the sequence of partial sums, are disjoint; a(0) = 1.
2
1, 3, 8, 14, 21, 30, 40, 52, 65, 80, 96, 113, 131, 150, 170, 193, 217, 242, 268, 295, 323, 352, 383, 415, 448, 482, 518, 555, 593, 632, 673, 715, 758, 802, 847, 893, 940, 988, 1037, 1087, 1140, 1194, 1249, 1306, 1362, 1420, 1479, 1539, 1600, 1662, 1725, 1789
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
Cf. A098763.
Sequence in context: A333962 A366087 A022947 * A014848 A140479 A264689
KEYWORD
easy,nonn
AUTHOR
Eric Angelini, Oct 01 2004
EXTENSIONS
Better definition from Joshua Zucker, Jul 27 2006
STATUS
approved