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.

A357166 If n appears in A357082, then a(n) is the unique k such that A357082(k) = n; otherwise a(n) = -1.

This page as a plain text file.
%I A357166 #12 Sep 16 2022 07:42:21
%S A357166 0,1,2,3,4,5,7,9,23,8,6,16,11,13,49,18,14,10,15,19,12,17,47,20,24,41,
%T A357166 22,26,34,38,28,29,31,30,27,37,33,25,21,40,32,36,46,39,35,82,51,42,78,
%U A357166 45,48,44,74,43,52,65,67,69,50,62,60,58,53,55,87,54,56,57
%N A357166 If n appears in A357082, then a(n) is the unique k such that A357082(k) = n; otherwise a(n) = -1.
%H A357166 Rémy Sigrist, <a href="/A357166/b357166.txt">Table of n, a(n) for n = 0..10000</a>
%H A357166 Rémy Sigrist, <a href="/A357166/a357166.gp.txt">PARI program</a>
%H A357166 Rémy Sigrist, <a href="/A357166/a357166.pl.txt">Perl program</a>
%e A357166 A357082(42) = 47, hence a(47) = 42.
%o A357166 (PARI) See Links section.
%o A357166 (Perl) See Links section.
%o A357166 (Python)
%o A357166 from itertools import islice
%o A357166 def agen():
%o A357166     aset, appearsat, astr, an, mink, nn = {0}, {0: 0}, "0", 0, 1, 0
%o A357166     for n in count(1):
%o A357166         k = mink
%o A357166         while k in aset or bin(an+k)[2:] in astr: k += 1
%o A357166         while mink in aset: mink += 1
%o A357166         an = k; aset.add(an); astr += bin(an)[2:]; appearsat[an] = n
%o A357166         while nn in appearsat: yield appearsat[nn]; nn += 1
%o A357166 print(list(islice(agen(), 68))) # _Michael S. Branicky_, Sep 16 2022
%Y A357166 Cf. A357082.
%K A357166 nonn,look,base
%O A357166 0,3
%A A357166 _Rémy Sigrist_, Sep 16 2022