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
Harvey P. Dale, Table of n, a(n) for n = 1..1000
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
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Jun 28 2021
STATUS
approved