|
|
A345985
|
|
Hamming distance between prime(n) and prime(n+1) in base 10.
|
|
3
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
EXAMPLE
|
Prime(4) = 7, prime(5) = 11, the words 7 and 11 are at Hamming distance 2 apart, so a(4) = 2.
|
|
PROG
|
(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)};
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|