%I #11 Jan 04 2019 03:26:19
%S 2,4,8,84,45812984490
%N Smallest k such that A305445(k) = n, i.e., smallest k > 1 such that the minimum number of bit inversions required to convert k into a prime equals n.
%C Does a(n) exist for every n?
%o (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
%o a(n) = for(k=2, oo, if(a305445(k)==n, return(k)))
%Y Cf. A305445.
%K nonn,base,more
%O 0,1
%A _Felix Fröhlich_, Dec 20 2018
%E a(4) from _Giovanni Resta_, Jan 03 2019