login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A157604
a(0)=1. a(n) = the largest integer coprime to a(n-1) and less than the n-th prime.
3
1, 1, 2, 3, 5, 9, 11, 16, 17, 22, 27, 29, 36, 37, 42, 43, 52, 57, 59, 66, 67, 72, 77, 82, 87, 95, 99, 101, 106, 107, 112, 125, 129, 136, 137, 148, 149, 156, 161, 166, 171, 178, 179, 190, 191, 196, 197, 210, 221, 226, 227, 232, 237, 239, 250, 253, 262, 267, 269, 276
OFFSET
0,3
LINKS
MATHEMATICA
a[n_] := a[n] = Block[{k = Prime@n - 1}, While[ GCD[k, a[n - 1]] > 1, k-- ]; k]; a[1] = a[2] = 1; Table[ a[n], {n, 0, 60}] (* Robert G. Wilson v, May 04 2009 *)
nxt[{n_, a_}]:=Module[{k=Prime[n+1]-1}, {n+1, While[!CoprimeQ[k, a], k--]; k}]; NestList[nxt, {0, 1}, 60][[All, 2]] (* Harvey P. Dale, Sep 09 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 02 2009
EXTENSIONS
More terms from Robert G. Wilson v, May 04 2009
STATUS
approved