login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A145653 a(n) = the length of the longest substring of digits that occurs both in the binary representation of the n-th prime and in the binary representation of the (n+1)th prime. 1
1, 1, 1, 2, 3, 2, 3, 3, 3, 3, 1, 4, 4, 4, 3, 4, 5, 2, 5, 3, 4, 5, 4, 4, 4, 5, 3, 4, 3, 3, 2, 4, 6, 5, 6, 4, 4, 5, 4, 5, 5, 4, 2, 5, 6, 4, 4, 3, 5, 4, 5, 4, 5, 2, 6, 6, 7, 4, 5, 7, 3, 4, 6, 5, 6, 4, 5, 5, 6, 4, 6, 5, 5, 5, 6, 3, 5, 5, 5, 4, 6, 5, 4, 6, 6, 4, 5, 6, 7, 5, 5, 4, 5, 5, 6, 7, 2, 8, 5, 5, 6, 5, 6, 8, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..1000

EXAMPLE

The 12th prime is 37, which is 100101 in binary. The 13th prime is 41, which is 101001 in binary. The largest string of digits occurring in both binary representations is 1001, which occurs like so: (1001)01 and 10(1001). a(12) therefore equals 4 because 1001 contains 4 digits.

MATHEMATICA

lsub[n_]:=Module[{p1=IntegerDigits[Prime[n], 2], p2=IntegerDigits[ Prime[ n+1], 2]}, Flatten[ Table[ Partition[p1, k, 1], {k, Length[p1]}], 1]]; Table[ Max[ Length/@Intersection[lsub[x], lsub[x+1]]], {x, 120}] (* Harvey P. Dale, Dec 09 2017 *)

CROSSREFS

Sequence in context: A164886 A091935 A086063 * A266119 A026263 A080098

Adjacent sequences:  A145650 A145651 A145652 * A145654 A145655 A145656

KEYWORD

base,nonn

AUTHOR

Leroy Quet, Oct 15 2008

EXTENSIONS

Extended by Ray Chandler, Oct 27 2008

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 19 19:11 EDT 2019. Contains 324222 sequences. (Running on oeis4.)