login
a(1) = 1, a(n) is the sum of m < n for which a(m) has at most as many divisors as n.
1

%I #20 Apr 04 2016 12:20:57

%S 1,1,3,6,6,15,6,28,6,37,16,66,16,47,61,100,45,125,45,162,94,115,45,

%T 240,45,137,163,306,98,347,128,365,252,252,252,456,128,252,252,477,

%U 128,558,128,437,481,341,128,819,128,572,387,623,128,988

%N a(1) = 1, a(n) is the sum of m < n for which a(m) has at most as many divisors as n.

%H Peter Kagey, <a href="/A269525/b269525.txt">Table of n, a(n) for n = 1..1000</a>

%e a(1) = 1;

%e a(2) = 1 because a(1) has at most as many divisors as 2;

%e a(3) = 3 because a(1) and a(2) have at most as many divisors as 3;

%e a(4) = 6 because a(1), a(2), and a(3) have at most as many divisors as 4;

%e a(5) = 6 because a(1), a(2), and a(3) have at most as many divisors as 5.

%t a = {1}; Do[d = DivisorSigma[0, n]; AppendTo[a, Total@ Select[Range[n - 1], DivisorSigma[0, a[[#]]] <= d &]], {n, 2, 54}]; a (* _Michael De Vlieger_, Mar 24 2016 *)

%o (Java)

%o int[] terms = new int[100];

%o terms[0] = 1;

%o for (int i = 1; i < 100; i++) {

%o int count = 0;

%o for (int j = 0; j < i; j++) {

%o if (divisors(terms[j]) <= divisors(i+1)) {

%o count = count + j + 1;

%o }

%o }

%o terms[i] = count;

%o }

%o (PARI) lista(nn) = {va = vector(nn); print1(va[1] = 1, ", "); for (n=2, nn, va[n] = sum(k=1, n-1, k*(numdiv(va[k]) <= numdiv(n))); print1(va[n], ", "););} \\ _Michel Marcus_, Feb 29 2016

%K easy,nonn

%O 1,3

%A _Alec Jones_, Feb 29 2016