login
A350654
Smallest k such that A349949(k) = n, or -1 if no such k exists.
1
2, 3, 8, 15, 63, 120, 440, 945, 2079, 4095, 21735, 98175, 133056, 395199, 338625, 1890945, 3501576, 8390304, 35820225, 126775935, 149848335, 879207616, 302464800
OFFSET
1,1
COMMENTS
a(25) = 879207615. - Chai Wah Wu, Jan 13 2022
PROG
(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
a(n) = my(k=2); while (f(k) != n, k++); k; \\ Michel Marcus, Jan 10 2022
(Python)
from itertools import count
from sympy import divisors
def A350654(n):
for m in count(2):
c = 0
for d in divisors(m, generator=True):
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)):
c += 1
if c > n:
break
if c == n:
return m # Chai Wah Wu, Jan 12 2022
CROSSREFS
Sequence in context: A148013 A133983 A005162 * A129108 A230284 A264235
KEYWORD
nonn,more
AUTHOR
Tejo Vrush, Jan 09 2022
EXTENSIONS
a(11)-a(19) from Jinyuan Wang, Jan 10 2022
Escape clause value changed to -1 by N. J. A. Sloane, Jan 12 2022
a(20)-a(21) from Chai Wah Wu, Jan 12 2022
a(22)-a(23) from Chai Wah Wu, Jan 13 2022
STATUS
approved