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!)
A068627 a(0) = 0, a(n) = a(n-1) + n if n does not divide a(n-1). a(n) = a(n-1) - n if n divides a(n-1). a(n) = n if a(n-1) = 0. 4

%I #10 Jun 29 2021 11:48:33

%S 0,1,3,0,4,9,15,22,30,39,49,60,48,61,75,60,76,93,111,130,150,171,193,

%T 216,192,217,243,216,244,273,303,334,366,399,433,468,432,469,507,468,

%U 508,549,591,634,678,723,769,816,768,817,867,816,868,921,975,1030,1086

%N a(0) = 0, a(n) = a(n-1) + n if n does not divide a(n-1). a(n) = a(n-1) - n if n divides a(n-1). a(n) = n if a(n-1) = 0.

%C The sequence is not monotonically increasing but has an increasing trend with some nodes i.e. numbers occurring twice in the sequence like 60 etc. Are there infinitely many nodes in the sequence.?

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

%e Since 12 divides a(11)=60, a(12) = 60 - 12 = 48.

%e Since 13 does not divide a(12)=48, a(13) = 48 + 13 = 61.

%t nxt[{n_,a_}]:={n+1,Which[a==0,n+1,Divisible[a,n+1],a-(n+1),True,a+n+1]}; NestList[nxt,{0,0},60][[All,2]] (* _Harvey P. Dale_, Jun 29 2021 *)

%o (PARI) lista(nn) = {preca = 0; for (n=1, nn, print1(preca, ", "); if (preca == 0, nexta = n, if (preca % n, nexta = preca + n, nexta = preca - n);); preca = nexta;);} \\ _Michel Marcus_, Jan 23 2014

%Y Cf. A068626.

%K easy,nonn

%O 0,3

%A _Amarnath Murthy_, Feb 26 2002

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 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)