login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A237501 Number of binary strings of length 2n which contain the reversals of each of their two halves. 3
4, 12, 42, 106, 300, 654, 1664, 3300, 7940, 15018, 34948, 64396, 147130, 267404, 604722, 1090998, 2453492, 4409000, 9886266, 17729222 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
Michael S. Branicky, Python program
EXAMPLE
The two halves of 01111011 are 0111 and 1011. Their reversals are 1110 and 1101, and both are substrings of 01111011. Since there are 105 other strings of length 2*4 with this property, a(4) = 106.
MATHEMATICA
sQ[L_, {s__}] := MatchQ[L, {___, s, ___}]; a[n_] := Length@ Select[ Tuples[{0, 1}, 2*n], sQ[#, Reverse[Take[#, n]]] && sQ[#, Reverse[Take[#, -n ]]] &]; Array[a, 8]
PROG
(Python) # see link for faster version
from itertools import product as prod
def ok(s): return s[:len(s)//2][::-1] in s and s[len(s)//2:][::-1] in s
def a(n): return 2*sum(ok("0"+"".join(p)) for p in prod("01", repeat=2*n-1))
print([a(n) for n in range(1, 12)]) # Michael S. Branicky, Feb 06 2021
CROSSREFS
Sequence in context: A242470 A242471 A239800 * A300124 A343517 A308371
KEYWORD
nonn,more
AUTHOR
Giovanni Resta, Feb 08 2014
EXTENSIONS
a(17)-a(20) from Michael S. Branicky, Feb 06 2021
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 03:51 EDT 2024. Contains 371264 sequences. (Running on oeis4.)