cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A115751 a(1)=1. a(n) = number of positive divisors of n which are not among the first (n-1) terms of the sequence.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 4, 1, 2, 3, 2, 1, 3, 1, 3, 2, 2, 1, 4, 2, 2, 2, 3, 1, 5, 1, 3, 2, 2, 2, 5, 1, 2, 2, 4, 1, 5, 1, 3, 3, 2, 1, 6, 2, 3, 2, 3, 1, 4, 2, 5, 2, 2, 1, 6, 1, 2, 4, 4, 2, 4, 1, 3, 2, 5, 1, 7, 1, 2, 3, 3, 2, 4, 1, 6, 3, 2, 1, 6, 2, 2, 2, 5, 1, 7, 2, 3, 2, 2, 2, 7, 1, 3, 4, 5, 1, 4, 1, 5, 4
Offset: 1

Views

Author

Leroy Quet, Mar 28 2006

Keywords

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

Examples

			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.
		

Crossrefs

Cf. A088167.

Programs

  • 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
  • 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

Extensions

More terms from Emeric Deutsch, Apr 01 2006