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.
%I A350654 #25 Jan 14 2022 07:41:58 %S A350654 2,3,8,15,63,120,440,945,2079,4095,21735,98175,133056,395199,338625, %T A350654 1890945,3501576,8390304,35820225,126775935,149848335,879207616, %U A350654 302464800 %N A350654 Smallest k such that A349949(k) = n, or -1 if no such k exists. %C A350654 a(25) = 879207615. - _Chai Wah Wu_, Jan 13 2022 %o A350654 (PARI) f(n) = my(sd=setunion(divisors(n-1), divisors(n+1))); sumdiv(n, d, (vecsearch(sd, d-1)>0) || (vecsearch(sd, d+1)>0)); \\ A349949 %o A350654 a(n) = my(k=2); while (f(k) != n, k++); k; \\ _Michel Marcus_, Jan 10 2022 %o A350654 (Python) %o A350654 from itertools import count %o A350654 from sympy import divisors %o A350654 def A350654(n): %o A350654 for m in count(2): %o A350654 c = 0 %o A350654 for d in divisors(m,generator=True): %o A350654 if not (((m-1) % (d-1) if d > 1 else True) and (m-1) % (d+1) and ((m+1) % (d-1) if d > 1 else True) and (m+1) % (d+1)): %o A350654 c += 1 %o A350654 if c > n: %o A350654 break %o A350654 if c == n: %o A350654 return m # _Chai Wah Wu_, Jan 12 2022 %Y A350654 Cf, A000005, A349949. %K A350654 nonn,more %O A350654 1,1 %A A350654 _Tejo Vrush_, Jan 09 2022 %E A350654 a(11)-a(19) from _Jinyuan Wang_, Jan 10 2022 %E A350654 Escape clause value changed to -1 by _N. J. A. Sloane_, Jan 12 2022 %E A350654 a(20)-a(21) from _Chai Wah Wu_, Jan 12 2022 %E A350654 a(22)-a(23) from _Chai Wah Wu_, Jan 13 2022