OFFSET
1,4
COMMENTS
There are only 40 distinct values among the first 10000 terms. The records occur at positions: 1, 4, 12, 30, 48, 72, 120, 180, 240, 360, 480, 720, 840, 1260, 1680, 2160, 2520, 4620, 5040, ... - Antti Karttunen, Oct 21 2017
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10001
EXAMPLE
The divisors of 12 are 1, 2, 3, 4, 6 and 12. Of these, only the four divisors 3, 4, 6 and 12 do not occur among the first 11 terms of the sequence. So a(12) = 4.
MAPLE
with(numtheory): a[1]:=1: for n from 2 to 120 do div:=divisors(n): M:=convert([seq(a[j], j=1..n-1)], set): a[n]:=nops(div minus M): od: seq(a[n], n=1..120); # Emeric Deutsch, Apr 01 2006
PROG
(Scheme)
;; We define a mutual recurrence with the memoization-macro definec:
(definec (A115751 n) (if (= 1 n) n (length (remove (lambda (d) (zero? (modulo (Aauxseq_forA115751 (- n 1)) (A000040 d)))) (divisors n)))))
;; The other member of the mutual recurrence has not been submitted. Its n-th term keeps track in its prime factorization what distinct values has so far occurred in A115751(1) .. A115751(n). That is, iff value k has occurred in range a(1) .. a(n), then the n-th term of this auxiliary sequence is divisible by the k-th prime:
(definec (Aauxseq_forA115751 n) (if (= 1 n) 2 (lcm (A000040 (A115751 n)) (Aauxseq_forA115751 (- n 1)))))
(define (divisors n) (cons 1 (proper-divisors n)))
(define (proper-divisors n) (let loop ((k n) (divs (list))) (cond ((= 1 k) divs) ((zero? (modulo n k)) (loop (- k 1) (cons k divs))) (else (loop (- k 1) divs)))))
;; Antti Karttunen, Oct 21 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 28 2006
EXTENSIONS
More terms from Emeric Deutsch, Apr 01 2006
STATUS
approved