Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A006995
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A006995 Numbers whose binary expansion is palindromic.
(Formerly M2403)
+0
63
0, 1, 3, 5, 7, 9, 15, 17, 21, 27, 31, 33, 45, 51, 63, 65, 73, 85, 93, 99, 107, 119, 127, 129, 153, 165, 189, 195, 219, 231, 255, 257, 273, 297, 313, 325, 341, 365, 381, 387, 403, 427, 443, 455, 471, 495, 511, 513, 561, 585, 633, 645, 693, 717, 765, 771, 819, 843 (list; graph; listen)
OFFSET

1,3

REFERENCES

N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

LINKS

T. D. Noe, Table of n, a(n) for n=1..1000

Index entries for sequences related to binary expansion of n

FORMULA

Comments from Hieronymus Fischer (Hieronymus.Fischer(AT)gmx.de), Dec 31 2008 (Start): Written as a decimal, a(10^n) has 2*n digits. For n>1, the decimal expansion of a(10^n) starts with 22..., 23... or 24...

a(1000)=249903, a(10^10)=24502928886295666773.

An inequality valid for n>1: (2/9)*n^2<a(n)<(1/4)*(n+1)^2.

lim sup a(n)/n^2=1/4 for n-->oo.

lim inf a(n)/n^2=2/9 for n-->oo.

Set k:=k(n):=floor(log_2(n)), i:=i(n):=n-2^k+1, j:=j(n):=i-2^(k-1). Then

a(n)=2^(2k-q)+1+2^p*a(m), where p, q and m are determined as follows:

Case 1: If n+1=2^k, then set p=0, q=2, m=0;

Case 2: If 2^k<n+1<2^k+2^(k-1), then set p=k- floor(log_2(i)), q=2, m=2^floor(log_2(i))+i-1;

Case 3: If n+1=2^k+2^(k-1), then set p=0, q=1, m=0;

Case 4: If 2^k+2^(k-1)<n+1<2^(k+1), then set p=k- floor(log_2(j))-1, q=1, m=2^floor(log_2(i))+i-1;

a(2^n)=2^(2n-2)+2^(n-1)+1; a(2^n-2)=2^(2n-2)-1; a(2^n-1)=2^(2n-2)+1; (End)

A030101(n) = n. - David Wilson, Jun 09 2009

MATHEMATICA

palQ[n_Integer, base_Integer] := Module[{idn=IntegerDigits[n, base]}, idn==Reverse[idn]]; then to generate any base b sequence: Select[Range[1000], palQ[ #, b]&]

PROGRAM

(PARI) for(n=1, 1000, l=length(binary(n)); b=binary(n); if(sum(i=1, l, abs(component(b, i)-component(b, l+1-i)))==0, print1(n, ", ")))

(PARI) for(i=0, 999, if(vecextract(t=binary(i), "-1..1")==t, print1(i", "))) - M. F. Hasler (Maximilian.Hasler(AT)gmail.com), Dec 17 2007

CROSSREFS

Palindromes in bases 2 through 10: A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955, A002113.

Sequence in context: A029608 A145388 A121820 this_sequence A163410 A064896 A076188

Adjacent sequences: A006992 A006993 A006994 this_sequence A006996 A006997 A006998

KEYWORD

base,easy,nonn,nice

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com), Robert G. Wilson v (rgwv(AT)rgwv.com), Mira Bernstein, L. J. Upton

EXTENSIONS

A-number in formula corrected by R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Jun 18 2009

page 1

Search completed in 0.003 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research