login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A272680
Smallest square that begins with n (in binary).
3
0, 1, 4, 25, 4, 81, 25, 121, 16, 9, 81, 361, 25, 441, 225, 121, 16, 1089, 36, 625, 81, 169, 361, 1521, 49, 25, 841, 441, 225, 3721, 121, 2025, 64, 529, 1089, 4489, 36, 2401, 1225, 625, 81, 5329, 169, 2809, 11449, 361, 5929, 1521, 6241, 49, 100, 6561, 841, 6889
OFFSET
0,3
REFERENCES
Allan C. Wechsler, posting to math-fun mailing list May 22 2016.
EXAMPLE
a(10)=81, because 81 = 9^2 = 1010001_2 begins with 1010 = 10_2.
PROG
(Python)
from gmpy2 import isqrt
def A272680(n):
if n == 0:
return 0
else:
d, nd = 1, n
while True:
x = (isqrt(nd-1)+1)**2
if x < nd+d:
return int(x)
d *= 2
nd *= 2 # Chai Wah Wu, May 22 2016
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, May 22 2016
EXTENSIONS
More terms from Chai Wah Wu, May 22 2016
STATUS
approved