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!)
A280651 Numbers k such that k^3 has an odd number of digits in base 2 and the middle digit is 1. 2

%I #13 Jan 02 2023 12:30:52

%S 1,5,7,11,18,19,20,26,27,28,41,42,45,47,49,66,67,69,70,71,72,73,74,75,

%T 76,77,103,106,110,111,113,115,119,120,122,123,124,125,126,162,164,

%U 165,166,168,171,177,178,180,181,182,184,185,190,194,197,199,201,259

%N Numbers k such that k^3 has an odd number of digits in base 2 and the middle digit is 1.

%H Lars Blomberg, <a href="/A280651/b280651.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="http://list.seqfan.eu/oldermail/seqfan/2016-December/017140.html">Mail by Andrew Weimholt to the Seqfan Mailing list Dec 12 2016</a>

%e 5^3 = 111(1)101_2, 28^3 = 1010101(1)1000000_2, 111^3 = 1010011011(1)1001001111_2.

%t a[n_]:=Part[IntegerDigits[n,2],(Length[IntegerDigits[n,2]]+1)/2];

%t Select[Range[0, 259], OddQ[Length[IntegerDigits[#^3, 2]]] && a[#^3]==1 &] (* _Indranil Ghosh_, Mar 06 2017 *)

%t ond2Q[n_]:=Module[{idn=IntegerDigits[n^3,2],len},len=Length[idn];OddQ[ len] && idn[[(len+1)/2]]==1]; Select[Range[300],ond2Q] (* _Harvey P. Dale_, Jul 21 2021 *)

%o (PARI)

%o isok(k) = my(d=digits(k^3, 2)); (#d%2 == 1) && (d[#d\2 +1] == 1);

%o for(k=0, 259, if(isok(k)==1, print1(k,", "))); \\ _Indranil Ghosh_, Mar 06 2017

%o (Python)

%o i=0

%o j=1

%o while i<=259:

%o ....n=str(bin(i**3)[2:])

%o ....l=len(n)

%o ....if l%2==1 and n[(l-1)/2]=="1":

%o ........print (str(i))+",",

%o ........j+=1

%o ....i+=1 # _Indranil Ghosh_, Mar 06 2017

%Y Cf. A280650.

%Y See A279430-A279431 for a k^2 version.

%Y See A280640-A280649 for a base-10 version.

%Y See A279420-A279429 for a k^2, base-10 version.

%K nonn,base,easy

%O 1,2

%A _Lars Blomberg_, Jan 12 2017

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 April 23 07:42 EDT 2024. Contains 371905 sequences. (Running on oeis4.)