|
|
A036567
|
|
Basic numbers used in Sedgewick-Incerpi upper bound for shell sort.
|
|
3
|
|
|
1, 3, 7, 16, 41, 101, 247, 613, 1529, 3821, 9539, 23843, 59611, 149015, 372539, 931327, 2328307, 5820767, 14551919, 36379789, 90949471, 227373677, 568434193, 1421085473, 3552713687, 8881784201, 22204460497, 55511151233, 138777878081, 346944695197, 867361737989
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
REFERENCES
|
D. E. Knuth, The Art of Computer Programming, Vol. 3, Sorting and Searching, 2nd ed, section 5.2.1, p. 91.
|
|
LINKS
|
|
|
FORMULA
|
a(n) is the smallest number >= 2.5^n that is relatively prime to all previous terms in the sequence.
|
|
EXAMPLE
|
2.5^4 = 39.0625, and 41 is the next integer that is relatively prime to 1, 3, 7 and 16.
|
|
MAPLE
|
a:= proc(n) option remember; local l, m;
l:= [seq(a(i), i=1..n-1)];
for m from ceil((5/2)^n) while ormap(x-> igcd(m, x)>1, l) do od; m
end:
|
|
MATHEMATICA
|
With[{prev = A036567 /@ Range[q - 1]},
Block[{n = Ceiling[(5/2)^q]},
While[Nand @@ ((# == 1 &) /@ GCD[prev, n]), n++];
|
|
PROG
|
(PARI) a036567(m)={my(v=vector(m)); for(n=1, m, my(b=ceil((5/2)^n)); for(j=b, oo, my(g=1); for(k=1, n-1, if(gcd(j, v[k])>1, g=0; break)); if(g, v[n]=j; break))); v};
|
|
CROSSREFS
|
Cf. A003462, A033622, A036561, A036562, A036564, A036566, A036567, A036569, A055875, A055876, A102549, A108870, A112262, A112263, A154393, A204772, A205669, A205670, A361506, A361507.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Better description and more terms from Jud McCranie, Jan 05 2001
|
|
STATUS
|
approved
|
|
|
|