login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A279430 Numbers k such that k^2 has an odd number of digits in base 2 and the middle digit is 0. 14
0, 2, 4, 5, 8, 9, 10, 16, 17, 18, 19, 22, 32, 33, 34, 35, 36, 37, 40, 41, 44, 64, 65, 66, 67, 68, 69, 70, 71, 76, 77, 80, 81, 84, 85, 87, 90, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 144, 145, 146, 147, 151, 152, 153, 156, 157, 160, 161, 164 (list; graph; refs; listen; history; text; internal format)
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

Cf. A279431.

See A279420-A279429 for a base-10 version.

Sequence in context: A005658 A166021 A339906 * A003714 A340956 A010402

Adjacent sequences:  A279427 A279428 A279429 * A279431 A279432 A279433

KEYWORD

nonn,base,easy

AUTHOR

Lars Blomberg, Jan 07 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 18 05:10 EDT 2021. Contains 343994 sequences. (Running on oeis4.)