A109732 a(1) = 1; for n > 1, a(n) is the smallest number not already present which is entailed by the rules (i) k present => 2k+1 present; (ii) 3k present => k present.
1, 3, 7, 15, 5, 11, 23, 31, 47, 63, 21, 43, 87, 29, 59, 95, 119, 127, 175, 191, 239, 255, 85, 171, 57, 19, 39, 13, 27, 9, 55, 79, 111, 37, 75, 25, 51, 17, 35, 71, 103, 115, 143, 151, 159, 53, 107, 207, 69, 139, 215, 223, 231, 77, 155, 279, 93, 187, 287, 303, 101, 203
Offset: 1
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..20000 (first 1000 terms from T. D. Noe)
- T. D. Noe, Graph of first 1000 terms.
Crossrefs
Programs
-
Maple
with(LinearAlgebra); hit:=Array(1..200000); a:=[1,3,7]; hit[1]:=1; hit[3]:=1; hit[7]:=1; S:={15}; L:=7; for n from 4 to 20000 do if (L mod 3 = 0) and hit[L/3]=0 then L:=L/3; a:=[op(a),L]; hit[L]:=1; S:= S minus {L}; if hit[2*L+1]=0 then S:=S union {2*L+1}; fi; else L:=min(S); a:=[op(a),L]; hit[L]:=1; S:=S minus {L}; if hit[2*L+1]=0 then S:=S union {2*L+1}; fi; fi; od: a; # N. J. A. Sloane, Aug 25 2015
-
Mathematica
maxVal=1000; f[n_]:=Module[{lst={}, x=n}, While[x=2x+1; x
0, next=First[pending]; pending=Rest[pending]; If[ !MemberQ[M, next], AppendTo[M, next]; While[Mod[next, 3]==0 && !MemberQ[M, next/3], next=next/3; AppendTo[M, next]; pending=Union[pending, f[next]]]]]; M (Noe)
Extensions
More terms from T. D. Noe, Aug 10 2005
Comments