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.

A297003 a(n) = 2^(n-1), n=1,2,3; for n >= 4, a(n) is the number of the previous terms dividing n.

This page as a plain text file.
%I A297003 #35 Dec 26 2017 19:14:04
%S A297003 1,2,4,3,1,4,2,6,3,4,2,11,2,6,4,10,2,11,2,13,4,10,2,18,2,11,4,16,2,17,
%T A297003 2,19,7,13,3,24,2,14,7,21,2,23,2,24,5,16,2,31,4,19,6,25,2,24,6,27,7,
%U A297003 17,2,35,2,20,9,28,5,29,2,29,6,29,2,41,2,22,8,31
%N A297003 a(n) = 2^(n-1), n=1,2,3; for n >= 4, a(n) is the number of the previous terms dividing n.
%H A297003 Peter J. C. Moses, <a href="/A297003/b297003.txt">Table of n, a(n) for n = 1..10000</a>
%F A297003 a(p) = 2, where p is prime, other than 3 and 5.
%e A297003 1-3) a(1)=1, a(2)=2 a(3)=4 by the definition;
%e A297003 4) Let n=4. From the previous terms {1,2,4} everyone divides 4, so a(4)=3;
%e A297003 5) Let n=5. From the previous terms {1,2,4,3} only 1 divides 5. So a(5)=1;
%e A297003 6) Let n=6. From the previous terms {1,2,4,3,1} exactly four divide 6. So a(6)=4; etc.
%t A297003 first[n_] := Fold[Append[#1, Count[#1, k_ /; Divisible[#2, k]]] &,
%t A297003   2^Range[0, Min[n - 1, 2]], Range[4, n]] (* _Michael De Vlieger_, Dec 23 2017 *)
%o A297003 (PARI) first(n) = my(res = vector(n), c = 0); for(x = 1, min(n, 3), res[x] = 1<<(x-1)); for(x=4, n, for(k=1, x-1, if(x%res[k]==0, c++)); res[x] = c; c = 0); res \\ _Iain Fox_, Dec 23 2017
%o A297003 (Sage)
%o A297003 def A297003_list(leng):
%o A297003     L = [1, 2, 4]
%o A297003     if leng < 4: return L[0:leng]
%o A297003     for n in (4..leng) :
%o A297003         count = 0
%o A297003         for l in L: count += int(l.divides(n))
%o A297003         L.append(count)
%o A297003     return L
%o A297003 print(A297003_list(76)) # _Peter Luschny_, Dec 24 2017
%Y A297003 Cf. A088167.
%K A297003 nonn,look
%O A297003 1,2
%A A297003 _Vladimir Shevelev_, Dec 23 2017
%E A297003 More terms from _Peter J. C. Moses_, Dec 23 2017