The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A161387 Primes p such that (p-1)/2 is an (odd) binary palindrome. 3
3, 7, 11, 19, 31, 43, 67, 103, 127, 131, 199, 239, 307, 331, 379, 439, 463, 547, 683, 887, 911, 991, 1123, 1171, 1291, 1531, 1543, 1783, 1951, 2731, 2843, 3067, 3079, 3511, 3823, 4099, 5107, 5323, 5419, 5659, 5851, 6151, 6343, 6679, 6871, 6967, 7159, 8191 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
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
Cf. A161388.
Terms include A000668. - Robert G. Wilson v, Jun 09 2009
Sequence in context: A202301 A339974 A123080 * A229086 A354902 A022406
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jun 08 2009
EXTENSIONS
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 May 19 09:05 EDT 2024. Contains 372673 sequences. (Running on oeis4.)