%I #57 Feb 17 2022 01:11:17
%S 1,2,4,6,9,11,15,17,21,24,28,30,36,38,42,46,51,53,59,61,67,71,75,77,
%T 85,88,92,96,102,104,112,114,120,124,128,132,141,143,147,151,159,161,
%U 169,171,177,183,187,189,199,202,208,212,218,220,228,232,240,244,248
%N Number of increasing arithmetic progressions of nonnegative integers ending in n, including those of length 1 or 2.
%C a(0)=1, a(n) = a(n-1) + sigma_0(n) (A000005). - _Ctibor O. Zizka_, Nov 08 2008
%C a(n) is the index of the n-th term of A027750 whose value is 1. - _Michel Marcus_, Oct 15 2015
%C From _Gus Wiseman_, Jun 07 2019: (Start)
%C Also the number of subsets of {1..n} that are closed under taking the difference of two strictly decreasing terms. For example, the a(0) = 1 through a(6) = 15 subsets are:
%C {} {} {} {} {} {} {}
%C {1} {1} {1} {1} {1} {1}
%C {2} {2} {2} {2} {2}
%C {1,2} {3} {3} {3} {3}
%C {1,2} {4} {4} {4}
%C {1,2,3} {1,2} {5} {5}
%C {2,4} {1,2} {6}
%C {1,2,3} {2,4} {1,2}
%C {1,2,3,4} {1,2,3} {2,4}
%C {1,2,3,4} {3,6}
%C {1,2,3,4,5} {1,2,3}
%C {2,4,6}
%C {1,2,3,4}
%C {1,2,3,4,5}
%C {1,2,3,4,5,6}
%C (End)
%H Marius A. Burtea, <a href="/A054519/b054519.txt">Table of n, a(n) for n = 0..10000</a> (term 0..1000 from T. D. Noe).
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Arithmetic_progression">Arithmetic progression</a>
%F a(n) = A051336(n+1) - A051336(n) = a(n-1) + A000005(n) = A006218(n)+1.
%F G.f.: (1-x)^(-1) * (1 + Sum_{j>=1} x^j/(1-x^j)). - _Robert Israel_, Oct 15 2015
%F a(n) = Sum_{i=1..n+1} ceiling((n+1)/(i+1)). - _Wesley Ivan Hurt_, Sep 15 2017
%e a(3)=6 because the six increasing progressions (3), (2,3), (1,2,3), (0,1,2,3), (1,3) and (0,3) all end in 3.
%p IBI:= {{}}: a[0]:= 1: for n from 1 to 45 do IBI:= IBI union map(t -> t union {n}, select(t -> (t minus map(q -> n-q, t)={}), IBI)); a[n]:= nops(IBI) od: seq(a[n], n=0..45); # _Zerinvary Lajos_, Mar 18 2007
%p with(numtheory):a[1]:=2: for n from 2 to 59 do a[n]:=a[n-1]+tau(n) od: seq(a[n], n=0..45); # _Zerinvary Lajos_, Mar 21 2009
%p map(`+`, ListTools:-PartialSums(map(numtheory:-tau, [$0..1000])),1); # _Robert Israel_, Oct 15 2015
%t a[0]=1; a[n_] := a[n] = a[n-1] + DivisorSigma[0, n]; Table[a[n], {n, 0, 45}] (* _Jean-François Alcover_, Oct 05 2012, after _Ctibor O. Zizka_ *)
%t nxt[{n_,a_}]:={n+1,a+DivisorSigma[0,n+1]}; Transpose[NestList[nxt,{0,1},50]][[2]] (* _Harvey P. Dale_, Oct 15 2012 *)
%t Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Subtract@@@Reverse/@Subsets[#,{2}]]&]],{n,0,10}] (* _Gus Wiseman_, Jun 07 2019 *)
%o (PARI) vector(100, n, n--; sum(k=1, n, n\k) + 1) \\ _Altug Alkan_, Oct 15 2015
%o (Magma) [1] cat [&+[Ceiling((k+1)/(i+1)): i in [1..k+1]]: k in [1..60]]; // _Marius A. Burtea_, Jun 10 2019
%Y Cf. A000005, A006218, A027750, A051336. Left edge of A056535.
%Y Cf. A007862, A049988, A175342, A238423, A295370, A325849.
%K easy,nonn,nice
%O 0,2
%A _Henry Bottomley_, Apr 07 2000
|