OFFSET
0,1
COMMENTS
a(n) = n<+>3 (see comment in A206853).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
FORMULA
If n==i mod 8, then a(n) = n-2*i+7, i=0,1,2,3; if n==4 mod 16, then a(n) = n+5; if n==12 mod 16, then a(n) = n+2^(A007814(n+4)-2); if n==5 mod 16, then a(n) = n+3; if n==13 mod 16, then a(n) = n+2^(A007814(n+3)-2); if n==6 mod 8, then a(n) = n+2^(A007814(n+2)-2); if n==7 mod 8, then a(n) = n+2^(A007814(n+1)-2).
Using this formula, we can prove conjecture formulated in comment in A209554 in case k=3. Moreover, one can prove that N could be represented in form n<+>2 or n<+>3 iff N is not a number of the forms 32*t, 32*t+1. - Vladimir Shevelev, Apr 25 2012
MAPLE
HD:= (i, j)-> add(h, h=Bits[Split](Bits[Xor](i, j))):
a:= proc(n) local c;
for c from n do if HD(n, c)=3 then return c fi od
end:
seq(a(n), n=0..100); # Alois P. Heinz, Apr 18 2012
PROG
(Python)
def d(n, m): return bin(n^m).count('1')
def a(n):
m = n+1
while d(n, m) != 3: m += 1
return m
print([a(n) for n in range(67)]) # Michael S. Branicky, Jul 06 2021
(PARI) a(n) = bitxor(n, if(bitand(n, 14)==4, 13, 7<<valuation(n>>2+1, 2))); \\ Kevin Ryde, Jul 10 2021
CROSSREFS
Cf. A209554 (primes which are not terms nor n<+>2 terms).
KEYWORD
nonn,base,easy
AUTHOR
Vladimir Shevelev, Apr 18 2012
STATUS
approved