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.

A151413 Index at which n occurs in A160256, or -1 if n never occurs.

This page as a plain text file.
%I A151413 #15 Mar 09 2025 18:53:43
%S A151413 1,2,3,4,14,5,20,6,7,12,32,11,301,22,16,8,1065,9
%N A151413 Index at which n occurs in A160256, or -1 if n never occurs.
%C A151413 After a(19) which exceeds 10^7 but is still unknown, the sequence continues 18,24,34,a(23)=?,10,215,303,... - _M. F. Hasler_, May 16 2009
%F A151413 A160218(n) = a(A000040(n)), conjectured. - _M. F. Hasler_, May 16 2009
%o A151413 (Python)
%o A151413 from sympy import gcd
%o A151413 def A151413(n):
%o A151413     if n <= 2:
%o A151413         return n
%o A151413     else:
%o A151413         l1, l2, m, b = 2, 1, 1, {1, 2}
%o A151413         for j in range(3, 10**9):
%o A151413             i = m
%o A151413             while True:
%o A151413                 if not i in b:
%o A151413                     if i == n:
%o A151413                         return j
%o A151413                     l1, l2, m = i, l1, l1//gcd(l1, i)
%o A151413                     b.add(i)
%o A151413                     break
%o A151413                 i += m
%o A151413         return "search limit reached." # _Chai Wah Wu_, Dec 09 2014
%Y A151413 Cf. A160256, A160218.
%K A151413 nonn,more
%O A151413 1,2
%A A151413 _N. J. A. Sloane_, May 16 2009
%E A151413 a(13)-a(18) from _Robert Gerbicz_ and _M. F. Hasler_, May 16 2009