%I #13 Oct 09 2020 18:16:32
%S 1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,1,1,0,0,
%T 0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,0,1,0,0,1,1,0,1,1,
%U 0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,1,0,0,1,0,0,1,1,1,0,1
%N G.f.: Sum_{k>=1} x^(k*(3*k - 2)) / (1 - x^(6*k)).
%C Number of ways to write n as the difference of two octagonal numbers.
%C a(n) = 2 if n = 133, 175, 176, 217, 224, 259, 272, 280, 301, 320, 343, 368, 385, 400, ... a(n) = 3 if n = 560, 637, 896, 935, ... a(n) = 4 if n = 1729, 2240, 2275, ... - _R. J. Mathar_, Oct 08 2020 [modified by _Ilya Gutkovskiy_, Oct 09 2020]
%F G.f.: Sum_{i>=0} Sum_{j>=i} Product_{k=i..j} x^(6*k + 1).
%e a(1729) = 4 with representations 1729 = 1825-96 = 2465-736 = 5985-4256 = 249985-248256. - _R. J. Mathar_, Oct 08 2020
%p A333818 := proc(n)
%p local a,hi,hiO,lo,loO;
%p a := 0 ;
%p for hi from 1 do
%p hiO := A000567(hi) ;
%p for lo from hi-1 to 1 by -1 do
%p loO := A000567(lo) ;
%p if lo = hi-1 and hiO-loO > n then
%p return a;
%p end if;
%p if hiO-loO = n then
%p a := a+1 ;
%p elif hiO-loO > n then
%p break;
%p end if ;
%p end do:
%p end do:
%p end proc:
%p seq( A333818(n),n=1..300) ; # _R. J. Mathar_, Oct 08 2020
%t nmax = 95; CoefficientList[Series[Sum[x^(k (3 k - 2))/(1 - x^(6 k)), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
%Y Cf. A000567, A001227, A034178, A333815, A333816, A333817, A334037.
%K nonn
%O 1
%A _Ilya Gutkovskiy_, Apr 06 2020
|