cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-20 of 22 results. Next

A208982 Numbers n such that the next larger number with mutual Hamming distance 1 is prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 16, 17, 18, 19, 21, 22, 23, 27, 28, 29, 30, 36, 39, 40, 41, 42, 43, 45, 46, 52, 57, 58, 60, 63, 65, 66, 67, 69, 70, 71, 72, 75, 77, 78, 81, 82, 88, 95, 96, 99, 100, 101, 102, 105, 106, 108, 111, 112, 119, 123, 125, 126, 129, 130, 136, 137, 138, 147, 148, 149, 150
Offset: 1

Views

Author

Vladimir Shevelev, Mar 04 2012

Keywords

Comments

If p is prime, then p-1 is in the sequence.
Using the prime number theorem in arithmetic progressions k*n+b with gcd(k,b)=1 and its uniformity over k<=exp(c*sqrt(log(x))), one can prove that the counting function of a(n)<=x is equivalent to 2*x/log(x), as x tends to infinity.

Crossrefs

Programs

  • PARI
    isok(n) = my(nextn = n+1); while (hammingweight(bitxor(n, nextn)) != 1, nextn++); isprime(nextn); \\ Michel Marcus, Jul 01 2014

A209544 Primes not expressed in form n<+>2, where operation <+> defined in A206853.

Original entry on oeis.org

3, 17, 41, 73, 89, 97, 113, 137, 193, 233, 241, 257, 281, 313, 337, 353, 401, 409, 433, 449, 457, 521, 569, 577, 593, 601, 617, 641, 673, 761, 769, 809, 857, 881, 929, 937, 953, 977, 1009, 1033, 1049, 1097, 1129, 1153, 1193, 1201, 1217, 1249, 1289, 1297, 1321
Offset: 1

Views

Author

Keywords

Comments

Trivially every odd prime is expressed in form n<+>1 (cf. A208982).
Are these related to A141174, A045390 or A007519? - R. J. Mathar, Mar 13 2012

Crossrefs

Formula

For n>=2, a(n) = A007519(n-1). - Vladimir Shevelev, Apr 18 2012

A182336 a(n) is the least m>=n, such that the Hamming distance D(n,m)=4.

Original entry on oeis.org

15, 14, 13, 12, 11, 10, 9, 8, 19, 18, 17, 16, 17, 16, 16, 17, 31, 30, 29, 28, 27, 26, 25, 24, 33, 32, 32, 33, 32, 33, 34, 35, 47, 46, 45, 44, 43, 42, 41, 40, 51, 50, 49, 48, 49, 48, 48, 49, 63, 62, 61, 60, 59, 58, 57, 56, 64, 65, 66, 67, 68, 69, 70, 71, 79, 78, 77, 76, 75, 74
Offset: 0

Views

Author

Vladimir Shevelev, Apr 25 2012

Keywords

Comments

Or (see comment in A206853) a(n)=n<+>4.
Conjecture: for n > 96, n + 1 <= a(n) <= 9n/8 + 1. - Charles R Greathouse IV, Apr 25 2012

Crossrefs

Programs

  • PARI
    hamming(n)=my(v=binary(n));sum(i=1,#v,v[i])
    a(n)=my(k=n);while(hamming(bitxor(n,k++))!=4,);k \\ Charles R Greathouse IV, Apr 25 2012

Extensions

Terms corrected by Charles R Greathouse IV, Apr 25 2012

A345985 Hamming distance between prime(n) and prime(n+1) in base 10.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 3, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 3, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 3, 1, 1, 2, 1, 1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jul 09 2021

Keywords

Examples

			Prime(4) = 7, prime(5) = 11, the words 7 and 11  are at Hamming distance 2 apart, so a(4) = 2.
		

Crossrefs

Cf. A205510.

Programs

  • PARI
    \\ abs Hamming distance in decimal digits
    dhd(j,k)={my(dj=digits(j),dk=digits(k),s=0);s=abs(#dj-#dk);for(i=1,min(#dj,#dk),s+=(dj[i]!=dk[i]));s};
    a345985(limit)={my(pp=2);forprime(p=3,limit,print1(dhd(p,pp),", ");pp=p)};
    a345985(prime(85)) \\ Hugo Pfoertner, Jul 09 2021

A374178 a(n) is the least prime p such that p and the next prime > p have exactly n common 1's in their binary expansion.

Original entry on oeis.org

2, 5, 19, 29, 181, 359, 379, 983, 3821, 3581, 8179, 16111, 81901, 98297, 131059, 131063, 524269, 917471, 3145679, 4128763, 16744423, 16776187, 58720223, 117440381, 266330047, 468713467, 536870879, 1073741309, 2147483629, 4294967231, 8589410287, 33285865469
Offset: 1

Views

Author

Hugo Pfoertner, Jul 08 2024

Keywords

Comments

1

Examples

			  a(n): 2       5         19           29              181
   np   3       7         23           31              191
      [1 0]  [1 0 1]  [1 0 0 1 1]  [1 1 1 0 1]  [1 0 1 1 0 1 0 1]
      [1 1]  [1 1 1]  [1 0 1 1 1]  [1 1 1 1 1]  [1 0 1 1 1 1 1 1]
       ^      ^   ^    ^     ^ ^    ^ ^ ^   ^    ^   ^ ^   ^   ^
  n:   1        2          3            4               5
		

Crossrefs

Programs

  • Python
    from sympy import nextprime
    def A374178(n):
        p = 2
        while (q:=nextprime(p)):
            if (p&q).bit_count() == n:
                return p
            p = q # Chai Wah Wu, Jul 08 2024

A207460 Let a(1) = 4. For n > 1, a(n) is the least number greater than a(n-1) such that the Hamming distance D(a(n-1),a(n)) = 4.

Original entry on oeis.org

4, 11, 16, 31, 35, 44, 49, 62, 70, 73, 82, 93, 97, 110, 112, 127, 143, 145, 158, 162, 173, 176, 191, 199, 200, 211, 220, 224, 239, 241, 254, 286, 290, 301, 304, 319, 327, 328, 339, 348, 352, 367, 369, 382, 398, 400, 415, 419
Offset: 1

Views

Author

Vladimir Shevelev, Feb 18 2012

Keywords

Comments

All terms are odious (A000069).

Crossrefs

Programs

  • Mathematica
    nxt[n_]:=Module[{k=n+1},While[HammingDistance[PadLeft[IntegerDigits[ n,2],IntegerLength[ k,2]],IntegerDigits[k,2]]!=4,k++];k]; NestList[ nxt,4,50] (* Harvey P. Dale, Nov 07 2020 *)

A207472 Let a(1) = 5. For n > 1, a(n) is the least number greater than a(n-1) such that the Hamming distance D(a(n-1),a(n)) = 5.

Original entry on oeis.org

5, 26, 33, 62, 66, 93, 96, 127, 135, 152, 163, 188, 192, 223, 225, 254, 270, 273, 294, 313, 320, 351, 353, 382, 390, 409, 418, 445, 449, 478, 480, 511, 543, 545, 574, 578, 605, 608, 639, 647, 664, 675, 700, 704, 735, 737, 766, 782, 785, 806, 825, 832, 863, 865
Offset: 1

Views

Author

Vladimir Shevelev, Feb 18 2012

Keywords

Comments

Odious and evil terms are alternating (cf. A000069, A001969).

Crossrefs

Programs

  • Mathematica
    a[1] = 5; a[n_] := a[n] = Module[{k = a[n - 1], m = a[n-1] + 1}, While[DigitCount[BitXor[k, m], 2, 1] != 5, m++]; m]; Array[a, 100] (* Amiram Eldar, Aug 06 2023 *)

A209332 a(n) is the minimal positive number k such that n<+>k is prime or 0 if no such number exists (operation <+> defined in A206853).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 3, 5, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 0, 3, 1, 1, 1, 1, 2, 4, 0, 3, 2, 1, 0, 4, 1, 1, 1, 1, 1, 2, 1, 1, 0, 5, 0, 3, 2, 1, 0, 7, 2, 2, 1, 1, 2, 1, 0, 8, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 0, 7, 1, 2, 1, 1, 3, 2, 1, 1, 0, 3, 0, 4, 3
Offset: 1

Views

Author

Vladimir Shevelev, Mar 06 2012

Keywords

Comments

Numbers n for which a(n) = 1 form sequence A208982.
a(n) = 0 for n = 25, 33, 37, 47,... (A209333).
A simple sufficient condition for a(n) = 0 (which is proved by induction) is that n<+>k is not prime up to the moment that n<+>k is even and n<+>(k+1)-n<+>k = 2^t, where t >= m+1 and m defined by the condition 2^m <= n < 2^(m+1).
Conjecture: for even n, a(n) > 0.

Crossrefs

A210566 Primes not expressed in form n<+>4, where operation <+> defined in A206853.

Original entry on oeis.org

2, 3, 5, 7, 23, 37, 53, 101, 103, 131, 149, 151, 167, 181, 229, 257, 263, 277, 293, 311, 359, 373, 389, 421, 439, 487, 503, 599, 613, 631, 641, 643, 647, 661, 677, 727, 743, 757, 769, 773, 821, 823, 853, 887, 919, 983, 997, 1013, 1031, 1061, 1063
Offset: 1

Views

Author

Keywords

Comments

Or primes p such that, for any nonnegative integer n

Programs

  • Mathematica
    hammingDistance[a_, b_] := Count[IntegerDigits[BitXor[a, b], 2], 1]; (* binary Hamming distance *) vS[a_,b_] := NestWhile[#+1&, a, hammingDistance[a,#] =!= b&]; (* vS[a_,b_] is the least c>=a,such that the binary Hamming distance D(a,c)=b. vS[a,b] is Vladimir's a<+>b *) A210566 = Map[Prime[#]&, Complement[Range[Max[#]], #]&[Map[PrimePi[#]&, Union[Map[#[[2]]&, Cases[Map[{PrimeQ[#],#}&[vS[#,4]]&, Range[7000]],{True,}]]]]]] (* _Peter J. C. Moses, Apr 02 2012 *)

A293424 Hamming distance between two consecutive semiprimes.

Original entry on oeis.org

1, 4, 2, 1, 1, 3, 2, 4, 2, 5, 2, 1, 2, 1, 2, 5, 1, 1, 3, 2, 1, 7, 1, 4, 3, 5, 3, 2, 1, 2, 2, 2, 1, 4, 2, 3, 2, 1, 3, 2, 1, 6, 1, 2, 3, 2, 1, 4, 2, 2, 2, 1, 5, 3, 4, 2, 2, 2, 3, 1, 5, 3, 2, 1, 2, 2, 5, 1, 2, 1, 3, 2, 1, 2, 6, 2, 2, 3, 3, 1, 2, 8, 2, 4, 1, 3, 1, 2, 5, 1, 1, 3, 1, 2, 2, 1, 4, 1, 4, 2, 6, 1, 2, 1, 3
Offset: 1

Author

Robert G. Wilson v, Oct 08 2017

Keywords

Comments

The least semiprime whose Hamming distance between it and its successor semiprime is k: 4, 9, 15, 6, 26, 123, 62, 254, 511, 3071, 2047, 8189, 32765, 16382, 98303, 65531, 393215, 262142, 1572863, 2621438, 1048574, 16777207, 8388607, 50331647, 33554429, 134217721, 268435451, etc.
Not surprisingly, the above are often the largest semiprime < 2^j.

Examples

			a(1) = 1 because the semiprimes 4 & 6, 100_2 & 110_2 have a Hamming distance of 1;
a(2) = 4 because the semiprimes 6 & 9, 110_2 & 1001_2 have a Hamming distance of 4;
a(3) = 2 because the semiprimes 9 & 10, 1001_2 & 1010_2 have a Hamming distance of 2; etc.
		

Crossrefs

Cf. A001358 (semiprimes), A205510 (between consecutive primes).

Programs

  • Maple
    semiprimes:= select(t -> numtheory:-bigomega(t)=2, [$4..1023]):
    L:=map(t -> convert(t+1024,base,2), semiprimes):
    map(t -> 11 - numboccur(0,t), L[2..-1]-L[1..-2]); # Robert Israel, Oct 08 2017
    # alternative
    read("transforms") :
    A293424 := proc(n)
        local s1,s2 ;
        s1 := A001358(n) ;
        s2 := A001358(n+1) ;
        XORnos(s1,s2) ;
        wt(%) ;
    end proc: # R. J. Mathar, Jan 06 2018
  • Mathematica
    Count[ IntegerDigits[ BitXor[ #[[1]], #[[2]]], 2], 1] & /@ Partition[ Select[ Range@330, PrimeOmega@# == 2 &], 2, 1]
  • PARI
    lista(nn) = my(v = select(x->bigomega(x)==2, vector(nn, k, k))); vector(#v-1, k, norml2(binary(bitxor(v[k], v[k+1])))); \\ Michel Marcus, Oct 11 2017
Previous Showing 11-20 of 22 results. Next