Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #32 Apr 09 2016 13:57:51
%S 2,3,5,7,10,17,22,25,50,72,89,161,322,411,483,533,558,580,597,607,614,
%T 619,622,624,629,1253,1875,2494,3108,3715,4312,4892,5450,5983,6466,
%U 6877,13343,19326,24776,29668,33980,37695,40803,43297,86594,127397,165092,199072,228740,253516
%N a(1) = 2, a(2) = 3; thereafter a(n) = a(n-1) + a(|n-a(T)|), where a(T) is the largest term in the sequence before a(n) such that 0 < |n-a(T)| < n.
%C When a(1) = 1, the formula generates the natural numbers.
%H Cody M. Haderlie, <a href="/A271063/b271063.txt">Table of n, a(n) for n = 1..1982</a>
%e a(11) = 89
%e a(T) = a(7) = 22
%e |12-22| = 10
%e a(10) = 72
%e 89 + 72 = 161
%e a(12) = 161
%t a = {2, 3}; Do[AppendTo[a, a[[n - 1]] + Part[a, #] &@ SelectFirst[ Reverse@ Abs[a - n], 0 < # < n &]], {n, 3, 50}]; a (* _Michael De Vlieger_, Apr 08 2016 *)
%o (PARI) lista(nn) = {va = vector(nn); print1(va[1] = 2, ", "); print1(va[2] = 3, ", "); for (n=3, nn, T = 0; forstep(k = n-1, 1, -1, vabs = abs(n - va[k]); if ((vabs < n) && (vabs > 0), T = k; break);); va[n] = va[n-1] + va[abs(n-va[T])]; print1(va[n], ", "););} \\ _Michel Marcus_, Apr 08 2016
%K nonn
%O 1,1
%A _Cody M. Haderlie_, Apr 05 2016