A109852 a(1)=1; a(2) = 2; for n >= 1 and 1 <= k < 2^n, a(2^n+k) is the least multiple of a(2^n-k) not included earlier and a(2^n) is the least number not included earlier.
1, 2, 3, 4, 6, 8, 5, 7, 10, 16, 12, 20, 9, 14, 11, 13, 22, 28, 18, 40, 24, 32, 30, 21, 15, 48, 36, 44, 27, 26, 17, 19, 34, 52, 54, 88, 72, 96, 45, 42, 60, 64, 120, 80, 90, 56, 66, 39, 33, 70, 63, 100, 84, 112, 50, 35, 25, 104, 78, 68, 51, 38, 23, 29, 46, 76, 102, 136, 156, 208
Offset: 1
Examples
a(8) = 7 as the least number not included earlier. a(9) = 2*a(8) = 2*5=10, a(10) = 2*a(6) = 16, a(11) = 2*a(5) = 12, a(12)= 5*a(4) = 20 as 8, 12 and 16 have already been included.
Links
Programs
-
Maple
did := [1]; lef := []; for n from 2 to 1000 do lef := [op(lef),n]; od : tak2n := proc(n2n) local i; global lef; i := op(1,lef); lef := subsop(1=NULL,lef); RETURN(i); end : tak := proc(n2n) local noffs,need,lefi,nindx,aa,mul; global lef,did; for noffs from -1 to -n2n+1 by -1 do nindx := n2n+noffs; aa := did[nindx]; for mul from 2 to 10000 do need := aa*mul; if member(need,lef,'lefi') = true then break; fi; od : lef := subsop(lefi=NULL,lef); printf("%d,",need); did := [op(did),need]; od : RETURN(ret); end : printf("1,"); for bas from 1 to 5 do nstrt := 2^bas; a := tak2n(nstrt); printf("%d,",a); did := [op(did),a]; tak(nstrt); od : # R. J. Mathar, Mar 27 2006 # second Maple program: ina:= proc(n) evalb(n<3) end: a:= proc(n) option remember; local k, i, t; if n<3 then n else a(n-1); k:= n-2^ilog2(n); t:= `if`(k=0, 1, a(n-2*k)); for i from 2*t by t while ina(i) do od; ina(i):= true; i fi end: seq(a(n), n=1..70); # Alois P. Heinz, Feb 07 2011
-
Mathematica
f[s_] := Block[{k = 2, len = Length@s}, exp = Ceiling[Log[2, len]]; m = s[[2^exp - len + 1]]; While[MemberQ[s, k*m], k++ ]; Append[s, k*m]]; Rest@Nest[f, {1, 1}, 70] (* the programming trick is to set a(0)=1 *) (* Robert G. Wilson v *)
Extensions
More terms from R. J. Mathar, Mar 27 2006
Edited and extended by Robert G. Wilson v, Jun 14 2006
Comments