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.

A366913 a(n) is the least k such that A366912(k) = n.

This page as a plain text file.
%I A366913 #19 Oct 28 2023 23:53:10
%S A366913 1,2,3,4,9,10,23,28,29,84,170,353,805,850,2171,4860,11815,28025,31539,
%T A366913 131252,318231,406904,1612758,2461032,9917597,11551434,36824781,
%U A366913 80492173,206009383,505512671,1361256869,2467754261
%N A366913 a(n) is the least k such that A366912(k) = n.
%C A366913 a(n) corresponds to the index of the first term of A364054 with height n.
%H A366913 Rémy Sigrist, <a href="/A366913/a366913.gp.txt">PARI program</a>
%H A366913 Rémy Sigrist, <a href="/A366913/a366913.txt">C++ program</a>
%o A366913 (PARI) See Links section.
%o A366913 (C++) See Links section.
%o A366913 (Python)
%o A366913 from itertools import count
%o A366913 from sympy import nextprime
%o A366913 def A366913(n):
%o A366913     a, aset, p, c = 1, {0,1}, 2, 0
%o A366913     for i in count(1):
%o A366913         if c == n:
%o A366913             return i
%o A366913         k, b = divmod(a,p)
%o A366913         for j in count(-k):
%o A366913             if b not in aset:
%o A366913                 aset.add(b)
%o A366913                 a, p = b, nextprime(p)
%o A366913                 c += j
%o A366913                 break
%o A366913             b += p # _Chai Wah Wu_, Oct 27 2023
%Y A366913 Cf. A064290, A364054, A366912.
%K A366913 nonn,more
%O A366913 0,2
%A A366913 _Rémy Sigrist_, Oct 27 2023
%E A366913 a(29) from _Chai Wah Wu_, Oct 27 2023
%E A366913 a(30)-a(31) from _Chai Wah Wu_, Oct 28 2023