cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A162400 a(n) = the largest square that when represented in binary is a substring within the binary representation of n.

Original entry on oeis.org

1, 1, 1, 4, 1, 1, 1, 4, 9, 1, 1, 4, 1, 1, 1, 16, 4, 9, 9, 4, 1, 1, 1, 4, 25, 1, 1, 4, 1, 1, 1, 16, 16, 4, 4, 36, 9, 9, 9, 4, 9, 1, 1, 4, 1, 1, 1, 16, 49, 25, 25, 4, 1, 1, 1, 4, 25, 1, 1, 4, 1, 1, 1, 64, 16, 16, 16, 4, 4, 4, 4, 36, 36, 9, 9, 9, 9, 9, 9, 16, 81, 9, 9, 4, 1, 1, 1, 4, 25, 1, 1, 4, 1, 1, 1, 16, 16, 49, 49, 100, 25
Offset: 1

Views

Author

Leroy Quet, Jul 02 2009

Keywords

Comments

a(n) = A162401(n)^2.

Examples

			a(8) = 4 since 8 = binary "1000" and the largest square less than or equal to 8, that of 4 = binary "100" appears as the first three bits of "1000". - _Michael De Vlieger_, Nov 04 2017
		

Crossrefs

Cf. A162401.

Programs

  • Mathematica
    Table[Block[{k = n, s}, While[SequenceCount[#, IntegerDigits[Set[s, k^2], 2]] == 0, k--]; s] &@ IntegerDigits[n, 2], {n, 101}] (* Michael De Vlieger, Nov 04 2017 *)

Formula

From David A. Corneth, Nov 04 2017: (Start)
a(n^2) = n^2
a(4*n) = 4*a(n)
a(4*n + 2) = a(2*n + 1). (End)

Extensions

Corrected and extended by Sean A. Irvine, Dec 05 2010