login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A006995 Numbers whose binary expansion is palindromic.
(Formerly M2403)
78
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; refs; listen; history; internal format)
OFFSET

1,3

COMMENTS

A178225(a(n)) = 1; union of A048700 and A048701. [Reinhard Zumkeller, Oct 21 2011]

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, Dec 31 2008 and Jan 10 2012 (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^4) = 24183069,

a(10^5) = 2258634081,

a(10^6) = 249410097687,

a(10^7) = 24350854001805,

a(10^8) = 2229543293296319,

a(10^9) = 248640535848971067,

a(10^10)= 24502928886295666773.

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.

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

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

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

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

Recursion formula for n>2: a(n)=2^(2k-q)+1+2^p*a(m),

where k:=floor(log_2(n-1)), and p, q and m are determined as follows:

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

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

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

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

(End)

MATHEMATICA

palQ[n_Integer, base_Integer] := Module[{idn=IntegerDigits[n, base]}, idn==Reverse[idn]]; Select[Range[1000], palQ[ #, 2]&]

PROG

(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, Dec 17 2007

(MAGMA) [n: n in [0..850] | Intseq(n, 2) eq Reverse(Intseq(n, 2))];  // Bruno Berselli, Aug 29 2011

(Haskell)

a006995 n = a006995_list !! (n-1)

a006995_list = 0 : filter ((== 1) . a178225) a005408_list

-- Reinhard Zumkeller, Oct 21 2011

CROSSREFS

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

See A057148 for the binary representations.

Cf. A178225, A005408.

Sequence in context: A145388 A121820 A180204 * A163410 A064896 A076188

Adjacent sequences:  A006992 A006993 A006994 * A006996 A006997 A006998

KEYWORD

nonn,base,easy,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, Jun 18 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 13 05:39 EST 2012. Contains 205436 sequences.