%I #19 Aug 25 2017 08:13:07
%S 0,0,1,1,3,3,5,5,7,9,10,11,14,15,16,19,20,23,24,27,28,33,30,37,36,42,
%T 40,48,44,53,49,57,55,65,55,72,64,74,70,83,72,90,77,95,87,102,84,112,
%U 94,112,104,124,102,133,109,135,123,142,117,160,128,152,138
%N Number of ways of writing n in the form i*j+k*m with 0<i<=j, 0<k<=m, and (j<m or j=m and i<k).
%H Alois P. Heinz, <a href="/A212597/b212597.txt">Table of n, a(n) for n = 1..10000</a>
%e 1*1+1*4 = 1*2+1*3 = 1*1+2*2 = 5, so a(5) = 3.
%p with(numtheory):
%p a:= proc(n) local j, l, m;
%p add(add(add(`if`(j<m or j=m and l*m<(n-l)*j, 1, 0),
%p m=select(h-> is(h>=sqrt(n-l)), divisors(n-l))),
%p j=select(h-> is(h>=sqrt(l)), divisors(l))), l=1..n-1)
%p end:
%p seq(a(n), n=1..100); # _Alois P. Heinz_, May 24 2012
%t a[n_] := Sum[Sum[Sum[If[j < m || j == m && l*m < (n-l)*j, 1, 0], {m, Select[Divisors[n-l], # >= Sqrt[n-l]&]}], {j, Select[Divisors[l], # >= Sqrt[l]&]}], {l, 1, n-1}];
%t Array[a, 100] (* _Jean-François Alcover_, Mar 27 2017, after _Alois P. Heinz_ *)
%Y Cf. A007875, A094820.
%K nonn,look
%O 1,5
%A _John W. Layman_, May 22 2012
|