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.

A372052 Where n appears in A370952, or -1 if n never appears there.

This page as a plain text file.
%I A372052 #22 Apr 20 2024 03:02:41
%S A372052 1,4,49,2,8,24,47,22,3,20,5,18,44,16,175,14,42,12,173,10,40,6,171,88,
%T A372052 38,335,169,86,36,333,167,84,34,331,7,82,32,329,9,80,11,327,13,78,15,
%U A372052 325,17,76,19,323,21,74,23,321,25,72,160,319,7468,70,158,317,25099
%N A372052 Where n appears in A370952, or -1 if n never appears there.
%H A372052 Chai Wah Wu, <a href="/A372052/b372052.txt">Table of n, a(n) for n = 1..10000</a>
%o A372052 (Python)
%o A372052 from itertools import count
%o A372052 def A372052(n):
%o A372052     a, aset = 1, {0,1}
%o A372052     for p in count(3,2):
%o A372052         if a == n:
%o A372052             return p>>1
%o A372052         for b in count(a%p,p):
%o A372052             if b not in aset:
%o A372052                 aset.add(b)
%o A372052                 a = b
%o A372052                 break # _Chai Wah Wu_, Apr 17 2024
%o A372052 (Python) # faster for initial segment of sequence
%o A372052 def A372052_gen(): # uses A370952_gen/imports from _Chai Wah Wu_ in A370952
%o A372052     adict, n = dict(), 1
%o A372052     for i, v in enumerate(A370952_gen(), 1):
%o A372052         if v >= n and v not in adict:
%o A372052             adict[v] = i
%o A372052             while n in adict:
%o A372052                 yield adict[n]; del adict[n]; n += 1
%o A372052 print(list(islice(A372052_gen(), 63))) # _Michael S. Branicky_, Apr 18 2024
%Y A372052 Cf. A370952, A370975.
%K A372052 nonn
%O A372052 1,2
%A A372052 _N. J. A. Sloane_, Apr 17 2024
%E A372052 More terms from _Chai Wah Wu_, Apr 17 2024