login
a(0)=1. a(n) = a(n-1) + (smallest integer that is >= n and occurs among the earlier terms of the sequence).
5

%I #27 Sep 19 2017 21:41:12

%S 1,2,4,8,12,20,28,36,44,56,68,80,92,112,132,152,172,192,212,232,252,

%T 280,308,336,364,392,420,448,476,512,548,584,620,656,692,728,764,808,

%U 852,896,940,984,1028,1072,1116,1172,1228,1284,1340,1396,1452,1508,1564

%N a(0)=1. a(n) = a(n-1) + (smallest integer that is >= n and occurs among the earlier terms of the sequence).

%C Let b_j(n) = 2*n*(n/2)^(2^(-j))/(1+2^(-j)). For any positive integers r and n, we have (n^2+n)/2 < a(n) < b_r(n) + Sum_{j=1..r} b_j(n). - _Colin Defant_, Sep 15 2015

%H Michael De Vlieger, <a href="/A118029/b118029.txt">Table of n, a(n) for n = 0..1000</a>

%t a = {1}; Do[k = 1; While[Nand[MemberQ[a, k], k >= i], k++]; AppendTo[a, a[[i]] + k], {i, 52}]; a (* _Michael De Vlieger_, Sep 19 2017 *)

%o (PARI) lista(nn) = {va = vector(nn); va[1] = 1; for (k=2, nn, vs = select(x->(x >= k-1), va, 1); va[k] = va[k-1] + va[vs[1]];); va;} \\ _Michel Marcus_, Oct 09 2015

%Y Cf. A118026, A118027, A118028, A118030, A094589.

%K easy,nonn

%O 0,2

%A _Leroy Quet_, Apr 10 2006

%E More terms from Adam Panagos (adam.panagos(AT)gmail.com), May 10 2006

%E More terms from _Joshua Zucker_, Jul 27 2006