OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 2*A161388(n) + 1.
EXAMPLE
67 in binary is 1000011. All binary digits but the rightmost 1 form a palindrome (100001), so therefore (67-1)/2 = 33 is a palindrome. Since 67 is a prime, it is in this sequence.
MATHEMATICA
Select[Prime@Range[2, 1500], (id=IntegerDigits[(#-1)/2, 2])==Reverse[id]&] (* Ray Chandler, Jun 09 2009 *)
fQ[n_] := Block[{id = IntegerDigits[(n - 1)/2, 2]}, id == Reverse@id]; Select[ Prime@ Range[2, 1100], fQ@# &] (* Robert G. Wilson v, Jun 09 2009 *)
PROG
(Magma) [ p: p in PrimesInInterval(3, 8200) | s eq Reverse(s) where s is Intseq((p-1) div 2, 2) ]; // Klaus Brockhaus, Jun 09 2009
(PARI) forprime(p=3, 100000, t=binary((p-1)/2); if(t==vector(#t, x, t[ #t+1-x]), print1(p, ", "))) \\ Hagen von Eitzen, Jun 10 2009
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jun 08 2009
EXTENSIONS
STATUS
approved