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.

This page as a plain text file.
%I A115751 #16 Oct 21 2017 15:40:09
%S A115751 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,
%T A115751 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,
%U A115751 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
%N A115751 a(1)=1. a(n) = number of positive divisors of n which are not among the first (n-1) terms of the sequence.
%C A115751 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
%H A115751 Antti Karttunen, <a href="/A115751/b115751.txt">Table of n, a(n) for n = 1..10001</a>
%e A115751 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.
%p A115751 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
%o A115751 (Scheme)
%o A115751 ;; We define a mutual recurrence with the memoization-macro definec:
%o A115751 (definec (A115751 n) (if (= 1 n) n (length (remove (lambda (d) (zero? (modulo (Aauxseq_forA115751 (- n 1)) (A000040 d)))) (divisors n)))))
%o A115751 ;; 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:
%o A115751 (definec (Aauxseq_forA115751 n) (if (= 1 n) 2 (lcm (A000040 (A115751 n)) (Aauxseq_forA115751 (- n 1)))))
%o A115751 (define (divisors n) (cons 1 (proper-divisors n)))
%o A115751 (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)))))
%o A115751 ;; _Antti Karttunen_, Oct 21 2017
%Y A115751 Cf. A088167.
%K A115751 nonn
%O A115751 1,4
%A A115751 _Leroy Quet_, Mar 28 2006
%E A115751 More terms from _Emeric Deutsch_, Apr 01 2006