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!)
A140524 a(1)=2. For n >=2, a(n) = the least integer >= n that is non-coprime to both n and a(n-1). 1

%I #14 Mar 08 2018 16:43:14

%S 2,2,6,4,10,6,14,8,12,10,22,12,26,14,18,16,34,18,38,20,24,22,46,24,30,

%T 26,30,28,58,30,62,32,36,34,40,36,74,38,42,40,82,42,86,44,48,46,94,48,

%U 56,50,54,52,106,54,60,56,60,58,118,60,122,62,66,64,70,66,134,68,72,70

%N a(1)=2. For n >=2, a(n) = the least integer >= n that is non-coprime to both n and a(n-1).

%H Robert Israel, <a href="/A140524/b140524.txt">Table of n, a(n) for n = 1..10000</a>

%p f:= proc(n) option remember; local k,v;

%p v:= procname(n-1);

%p for k from n do if igcd(k,n) > 1 and igcd(k,v) > 1 then return k fi

%p od:

%p end proc:

%p f(1):= 2:

%p map(f, [$1..100]); # _Robert Israel_, Mar 07 2018

%t a = {2}; Do[ i = n; While[ Min[ GCD[ a[ [ -1 ] ], i ], GCD[ n, i ] ] == 1, i++ ]; AppendTo[ a, i ], {n, 2, 60} ]; a (* _Stefan Steinerberger_, Aug 04 2008 *)

%K nonn

%O 1,1

%A _Leroy Quet_, Jul 02 2008

%E More terms from _Stefan Steinerberger_, Aug 04 2008

%E a(61)-a(70) from _Ray Chandler_, Jun 25 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 07:16 EDT 2024. Contains 371905 sequences. (Running on oeis4.)