login
A365199
a(n) is the index of the n-th occurrence of 1 in A365203.
1
1, 14, 53, 109, 221, 445, 893, 1789, 3581, 7165, 14333, 28669, 84530, 295033, 830369, 1660741, 4755764, 10372048, 28287409, 56574821, 153253317, 323636916, 848150626, 2217511139, 6534867338, 20173498129, 40346996261, 120496984345
OFFSET
1,2
LINKS
EXAMPLE
a(1) = 1 since A365203(1) = 1 (1st occurrence of 1).
a(2) = 14 since A365203(14) = 1 (2nd occurrence of 1).
a(3) = 53 since A365203(53) = 1 (3rd occurrence of 1).
a(4) = 109 since A365203(109) = 1 (4th occurrence of 1).
MAPLE
A365203 := proc(n) option remember; if n = 1 then 1; elif procname(n - 1) < n then procname(n - 1) + n; elif n = procname(n - 1) then n*n; elif irem(procname(n - 1), n) = 0 then procname(n - 1)/n; else procname(n - 1) - n; end if; end proc;
A365199 := proc(n) if A365203(n) = 1 then n; end if; end proc;
seq(A365199(n), n = 1 .. 200000000);
PROG
(Python)
from itertools import count, islice
def A365199_gen(): # generator of terms
yield (a:=1)
for n in count(2):
if a<n:
a += n
elif a==n:
a = n**2
elif a%n:
a -= n
else:
a //= n
if a == 1:
yield n
A365199_list = list(islice(A365199_gen(), 10)) # Chai Wah Wu, Sep 23 2023
CROSSREFS
Cf. A365203.
Sequence in context: A332594 A338165 A217077 * A214659 A241354 A240811
KEYWORD
nonn,hard
AUTHOR
Felix Huber, Aug 26 2023
EXTENSIONS
a(22)-a(23) from Michel Marcus, Aug 28 2023
a(24)-a(28) from Chai Wah Wu, Sep 23 2023
STATUS
approved