login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A157604 a(0)=1. a(n) = the largest integer coprime to a(n-1) and less than the n-th prime. 3

%I #11 Sep 09 2016 15:13:21

%S 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,

%T 95,99,101,106,107,112,125,129,136,137,148,149,156,161,166,171,178,

%U 179,190,191,196,197,210,221,226,227,232,237,239,250,253,262,267,269,276

%N a(0)=1. a(n) = the largest integer coprime to a(n-1) and less than the n-th prime.

%H Harvey P. Dale, <a href="/A157604/b157604.txt">Table of n, a(n) for n = 0..1000</a>

%t 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 *)

%t 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 *)

%Y Cf. A157419, A157605, A157606.

%K nonn

%O 0,3

%A _Leroy Quet_, Mar 02 2009

%E More terms from _Robert G. Wilson v_, May 04 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)