OFFSET
1,1
EXAMPLE
a(1) = 2 because 2 = 10_2 and 3 = 11_2 are two consecutive primes that, when written in base 2, both have 2 digits and agree at exactly 1 digit position (each has a 1 in its first digit position), and no earlier pair of consecutive primes has this property.
a(3) = 23 = 10111_2; the next prime is
29 = 11101_2 (same number of binary digits),
^ ^ ^ and the digits agree at 3 digit positions,
and no earlier pair of consecutive primes has this property.
PROG
(PARI) card(p)=my(u=binary(p), v=binary(nextprime(p+1))); if(#u!=#v, return(0)); sum(i=1, #u, u[i]==v[i])
a(n)=forprime(p=2^n, oo, if(card(p)==n, return(p)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jean-Marc Rebert, Jul 07 2024
STATUS
approved