OFFSET
0,8
COMMENTS
A030101(m) is the decimal value of {m written in binary and then the digits reversed}.
EXAMPLE
23 in binary is 10111. Looking at the distinct values of substrings: 0, 0 in decimal, is not a prime. 1, 1 in decimal, is not a prime. 10 = 2 in decimal, is a prime, but its reversal is 1, which is not a prime. 11 is 3 in decimal, which is prime; and its reversal, 11, is prime in decimal too. 101 is 5 in decimal, a prime; and its reversal, 101, is prime in decimal too. 111 is 7 in decimal, a prime, and its reversal is 7, which is also a prime. 1011 is 11 in decimal, which is prime, and its reversal, 1101, is 13, which is also a prime. And 10111 itself is 23 in decimal, a prime, and its reversal is 11101, which is 29 in decimal, also a prime. There are therefore 5 values of substrings that are prime and their binary digit reversals are prime, so a(23) = 5.
10010 is 18 in decimal. Note that "010" is a substring with a decimal value of 2, and the reversal of this substring is also 2. However, this substring does not count towards the substrings being enumerated because we first take the value k of the substring, then take A030101(k) to see if both are prime. And A030101(2) = 1, not 2.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Dec 02 2009
EXTENSIONS
Extended by Ray Chandler, Dec 18 2009
STATUS
approved