login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A182209 a(n) is the least m >= n, such that the Hamming distance D(n,m) = 3. 4
7, 6, 5, 4, 9, 8, 8, 9, 15, 14, 13, 12, 16, 17, 18, 19, 23, 22, 21, 20, 25, 24, 24, 25, 31, 30, 29, 28, 36, 37, 38, 39, 39, 38, 37, 36, 41, 40, 40, 41, 47, 46, 45, 44, 48, 49, 50, 51, 55, 54, 53, 52, 57, 56, 56, 57, 63, 62, 61, 60, 76, 77, 78, 79, 71, 70, 69 (list; graph; refs; listen; history; text; internal format)
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. A086799 ((n-1)<+>1), A182187 (n<+>2), A182336 (n<+>4).

Cf. A209554 (primes which are not terms nor n<+>2 terms).

Cf. A205509, A205510, A205511, A205302, A205649, A205533, A122565, A206852, A206960, A007814.

Sequence in context: A132671 A340258 A074921 * A120634 A178753 A104178

Adjacent sequences: A182206 A182207 A182208 * A182210 A182211 A182212

KEYWORD

nonn,base,easy

AUTHOR

Vladimir Shevelev, Apr 18 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 28 18:12 EST 2023. Contains 359895 sequences. (Running on oeis4.)