A079411 a(1)=1, a(n) = n - a(a(ceiling(n/2))).
1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 25, 26, 26, 27, 27, 28, 29, 30, 30, 31, 31, 32, 33, 34, 34, 35, 35, 36, 36, 37, 38, 39, 39, 40, 40, 41, 42, 43, 43, 44, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 53, 54
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A076895.
Programs
-
Magma
[n eq 1 select 1 else n-Self(Self(Ceiling(n/2))): n in [1..80]]; // Vincenzo Librandi, Oct 25 2017
-
Maple
f:= proc(n) option remember; n - procname(procname(ceil(n/2))) end proc: f(1):= 1: seq(f(n),n=1..100); # Robert Israel, Oct 24 2017
-
Mathematica
Fold[Append[#1, #2 - #1[[#1[[Ceiling[#2/2] ]] ]] ] &, {1}, Range[2, 74]] (* Michael De Vlieger, Oct 24 2017 *)
-
PARI
a(n)=if(n<2,1,n-a(a(ceil(n/2))))
Formula
a(n) is asymptotic to n*(sqrt(3)-1); conjecture: (a(n)-n*(sqrt(3)-1))/log(n) is bounded.