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!)
A345877 a(1) = 1, a(n) = a(n-1)/2 if a(n-1) is even, otherwise a(n) = n - a(n-1). 2
1, 1, 2, 1, 4, 2, 1, 7, 2, 1, 10, 5, 8, 4, 2, 1, 16, 8, 4, 2, 1, 21, 2, 1, 24, 12, 6, 3, 26, 13, 18, 9, 24, 12, 6, 3, 34, 17, 22, 11, 30, 15, 28, 14, 7, 39, 8, 4, 2, 1, 50, 25, 28, 14, 7, 49, 8, 4, 2, 1, 60, 30, 15, 49, 16, 8, 4, 2, 1, 69, 2, 1, 72, 36, 18, 9, 68, 34, 17, 63, 18, 9, 74, 37, 48, 24, 12, 6, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Let a_i(1) = 1 and a_i(n) = a_i(n-1)/(i+1) if a_i(n-1) is divisible by i+1, otherwise a_i(n) = n - a_i(n-1). This sequence is a_1(n) and A345886 is a_2(n).
Conjecture: a_i(n) hits every positive integers infinitely many times for all i >= 1.
LINKS
MATHEMATICA
a[1] = 1; a[n_] := a[n] = If[EvenQ[a[n - 1]], a[n - 1]/2, n - a[n - 1]]; Array[a, 100] (* Amiram Eldar, Jun 29 2021 *)
nxt[{n_, a_}]:={n+1, If[EvenQ[a], a/2, n+1-a]}; NestList[nxt, {1, 1}, 90][[;; , 2]] (* Harvey P. Dale, Aug 31 2023 *)
PROG
(PARI) q=vector(100); q[1]=1; for(n=2, #q, q[n] = if(q[n-1]%2, n-q[n-1], q[n-1]/2)); q
CROSSREFS
Sequence in context: A035607 A059370 A084534 * A165899 A316354 A104582
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Jun 28 2021
STATUS
approved

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 July 6 19:53 EDT 2024. Contains 374058 sequences. (Running on oeis4.)