OFFSET
1,2
LINKS
Lars Blomberg, Table of n, a(n) for n = 1..10000
Andrew Weimholt, Middle digit in square numbers, Seqfan Mailing list, Dec 12 2016.
MATHEMATICA
a[n_]:=Part[IntegerDigits[n, 2], (Length[IntegerDigits[n, 2]]+1)/2];
Select[Range[0, 164], OddQ[Length[IntegerDigits[#^2, 2]]] && a[#^2]==0 &] (* Indranil Ghosh, Mar 06 2017 *)
k2oQ[n_]:=Module[{idn=IntegerDigits[n^2, 2], len}, len=Length[idn]; OddQ[ len] && idn[[(len+1)/2]]==0]; Select[Range[0, 200], k2oQ] (* Harvey P. Dale, Jan 29 2020 *)
PROG
(PARI) isok(k) = my(d=digits(k^2, 2)); (#d%2 == 1) && (d[#d\2 +1] == 0);
for(k=0, 164, if(k==0 || isok(k)==1, print1(k, ", "))); \\ Indranil Ghosh, Mar 06 2017
(Python)
i=0
j=1
while i<=164:
n=str(bin(i**2)[2:])
l=len(n)
if l%2 and n[(l-1)//2]=="0":
print(str(i), end=", ")
j+=1
i+=1 # Indranil Ghosh, Mar 06 2017
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Lars Blomberg, Jan 07 2017
STATUS
approved