A280651 Numbers k such that k^3 has an odd number of digits in base 2 and the middle digit is 1.
1, 5, 7, 11, 18, 19, 20, 26, 27, 28, 41, 42, 45, 47, 49, 66, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 103, 106, 110, 111, 113, 115, 119, 120, 122, 123, 124, 125, 126, 162, 164, 165, 166, 168, 171, 177, 178, 180, 181, 182, 184, 185, 190, 194, 197, 199, 201, 259
Offset: 1
Examples
5^3 = 111(1)101_2, 28^3 = 1010101(1)1000000_2, 111^3 = 1010011011(1)1001001111_2.
Links
Crossrefs
Programs
-
Mathematica
a[n_]:=Part[IntegerDigits[n,2],(Length[IntegerDigits[n,2]]+1)/2]; Select[Range[0, 259], OddQ[Length[IntegerDigits[#^3, 2]]] && a[#^3]==1 &] (* Indranil Ghosh, Mar 06 2017 *) 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 *)
-
PARI
isok(k) = my(d=digits(k^3, 2)); (#d%2 == 1) && (d[#d\2 +1] == 1); for(k=0, 259, if(isok(k)==1, print1(k,", "))); \\ Indranil Ghosh, Mar 06 2017
-
Python
i=0 j=1 while i<=259: n=str(bin(i**3)[2:]) l=len(n) if l%2==1 and n[(l-1)/2]=="1": print (str(i))+",", j+=1 i+=1 # Indranil Ghosh, Mar 06 2017