cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A365199 a(n) is the index of the n-th occurrence of 1 in A365203.

This page as a plain text file.
%I A365199 #35 Jan 01 2024 11:55:28
%S A365199 1,14,53,109,221,445,893,1789,3581,7165,14333,28669,84530,295033,
%T A365199 830369,1660741,4755764,10372048,28287409,56574821,153253317,
%U A365199 323636916,848150626,2217511139,6534867338,20173498129,40346996261,120496984345
%N A365199 a(n) is the index of the n-th occurrence of 1 in A365203.
%H A365199 Chai Wah Wu, <a href="/A365199/b365199.txt">Table of n, a(n) for n = 1..31</a>
%e A365199 a(1) =   1 since A365203(1)   = 1 (1st occurrence of 1).
%e A365199 a(2) =  14 since A365203(14)  = 1 (2nd occurrence of 1).
%e A365199 a(3) =  53 since A365203(53)  = 1 (3rd occurrence of 1).
%e A365199 a(4) = 109 since A365203(109) = 1 (4th occurrence of 1).
%p A365199 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;
%p A365199 A365199 := proc(n) if A365203(n) = 1 then n; end if; end proc;
%p A365199 seq(A365199(n), n = 1 .. 200000000);
%o A365199 (Python)
%o A365199 from itertools import count,islice
%o A365199 def A365199_gen(): # generator of terms
%o A365199     yield (a:=1)
%o A365199     for n in count(2):
%o A365199         if a<n:
%o A365199             a += n
%o A365199         elif a==n:
%o A365199             a = n**2
%o A365199         elif a%n:
%o A365199             a -= n
%o A365199         else:
%o A365199             a //= n
%o A365199         if a == 1:
%o A365199             yield n
%o A365199 A365199_list = list(islice(A365199_gen(),10)) # _Chai Wah Wu_, Sep 23 2023
%Y A365199 Cf. A365203.
%K A365199 nonn,hard
%O A365199 1,2
%A A365199 _Felix Huber_, Aug 26 2023
%E A365199 a(22)-a(23) from _Michel Marcus_, Aug 28 2023
%E A365199 a(24)-a(28) from _Chai Wah Wu_, Sep 23 2023