OFFSET
0,1
COMMENTS
a(n) = 0 if n + 1 is not squarefree.
a(n) <= 2 if n is even.
a(n) <= 6 if n is not divisible by 3.
a(n) <= 20 if n is not divisible by 5.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
EXAMPLE
a(4) = 2 because 2^2 + 4 = 8 = 2^3 is not squarefree, while 2^0 + 4 = 5 and 2^1 + 4 = 6 are squarefree.
MAPLE
f:= proc(k) local j;
for j from 0 to 300 do if not numtheory:-issqrfree(2^j+k) then return j fi
od;
FAIL
end proc:
map(f, [$0..100]);
PROG
(PARI) a(n) = my(k=0); while (issquarefree(2^k+n), k++); k; \\ Michel Marcus, Aug 27 2023
(Python)
from itertools import count
from sympy import factorint
def A365196(n): return next(k for k in count(0) if max(factorint((1<<k)+n).values(), default=0)>1) # Chai Wah Wu, Aug 28 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Aug 25 2023
STATUS
approved