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!)
A279431 Numbers k such that k^2 has an odd number of digits in base 2 and the middle digit is 1. 14
1, 11, 20, 21, 38, 39, 42, 43, 45, 72, 73, 74, 75, 78, 79, 82, 83, 86, 88, 89, 140, 141, 142, 143, 148, 149, 150, 154, 155, 158, 159, 162, 163, 166, 167, 169, 170, 172, 173, 175, 178, 180, 181, 272, 273, 274, 275, 276, 277, 278, 284, 285, 286, 287, 292, 293 (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.

EXAMPLE

1^2 = (1), 72^2 = 101000(1)000000, 158^2 = 1100001(1)0000100

MATHEMATICA

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

Select[Range[0, 293], OddQ[Length[IntegerDigits[#^2, 2]]] && a[#^2]==1 &] (* Indranil Ghosh, Mar 06 2017 *)

PROG

(PARI)

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

for(k=0, 293, if(isok(k)==1, print1(k, ", "))); \\ Indranil Ghosh, Mar 06 2017

(Python)

i=0

j=1

while i<=293:

    n=str(bin(i**2)[2:])

    l=len(n)

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

        print(str(i), end=", ")

        j+=1

    i+=1 # Indranil Ghosh, Mar 06 2017

CROSSREFS

Cf. A279430.

See A279420-A279429 for a base 10 version.

Sequence in context: A105958 A124250 A124251 * A230541 A053715 A250203

Adjacent sequences:  A279428 A279429 A279430 * A279432 A279433 A279434

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 March 8 20:52 EST 2021. Contains 341953 sequences. (Running on oeis4.)