OFFSET
0,1
COMMENTS
Does a(n) exist for every n?
PROG
(PARI) a305445(n) = my(b, L, N, s, v); if(n < 2, , if(isprime(n), 0, b = binary(n); L = #b; for(j = 1, L, v = vector(j, Y, [1, L]); forvec(X = v, N = n + sum(k = 1, j, if(b[X[k]], s = -1, s = 1); s*2^(L - X[k])); if(isprime(N), return(j)), 2)))) \\ after Rick L. Shepherd in A305445
a(n) = for(k=2, oo, if(a305445(k)==n, return(k)))
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Felix Fröhlich, Dec 20 2018
EXTENSIONS
a(4) from Giovanni Resta, Jan 03 2019
STATUS
approved