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.

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