OFFSET
1,5
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG sequence, arXiv:math/0204011 [math.NT], 2002.
J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG Sequence, Exper. Math. 11 (2002), 437-446.
EXAMPLE
The initial terms of A280864 are 1,2,4,3,6,8,... The smallest missing multiple of 3 in [1,2,4,3,6] is 9, so a(6) = 9/3 = 3.
MAPLE
mex := proc(L)
local k;
for k from 1 do
if not k in L then
return k;
end if;
end do:
end proc:
read b280864;
k:=3; a:=[1, 1]; ML:=[]; B:=1;
for n from 2 to 120 do
t:=b280864[n];
if (t mod k) = 0 then
ML:=[op(ML), t/k];
B:=mex(ML);
a:=[op(a), B];
else
a:=[op(a), B];
fi;
od:
a;
MATHEMATICA
terms = 85; rad[n_] := Times @@ FactorInteger[n][[All, 1]]; A280864 = Reap[present = 0; p = 1; pp = 1; Do[forbidden = GCD[p, pp]; mandatory = p/forbidden; a = mandatory; While[BitGet[present, a] > 0 || GCD[forbidden, a] > 1, a += mandatory]; Sow[a]; present += 2^a; pp = p; p = rad[a], terms]][[2, 1]];
Clear[a]; a[1] = 1; a[n_] := a[n] = For[b = 3 a[n - 1], True, b += 3, If[FreeQ[A280864[[1 ;; n - 1]], b], Return[b/3]]];
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 06 2017
STATUS
approved