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.

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

Views

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