# [seqfan] Re: A1: In binary representation, a(n)^2 is the smallest square with n^2 as substring.

Richard Mathar mathar at strw.leidenuniv.nl
Tue Aug 18 18:10:08 CEST 2009

```as a comment on http://list.seqfan.eu/pipermail/seqfan/2009-August/002126.html

dw> From seqfan-bounces at list.seqfan.eu Tue Aug 18 17:11:09 2009
dw> Date: Tue, 18 Aug 2009 10:38:44 -0400
dw> From: David Wilson <dwilson at gambitcomm.com>
dw> To: Sequence Fanatics Discussion list <seqfan at list.seqfan.eu>
dw> Subject: [seqfan] Re: A1: In binary representation, a(n)^2  is the smallest square with n^2 as substring.
dw> ...
dw> The only nontrivial part is solving k^2 = 2n^2+1. To do this, start with
dw>
dw> 	(n, k) = (0, 1)
dw>
dw> and repeatedly apply the map
dw>
dw> 	(n, k) => (3n+2k, 4n+3k)
dw>
dw> This produces the pairs
dw>
dw> 	(0, 1) => (2, 3) => (12, 17) => (70, 99) => ...
dw>
dw> so that
dw>
dw> 	f(0) = 1; f(2) = 3; f(12) = 17; f(70) = 99; etc.

the lazy OEIS user might observe that this generates A001542 for n and A001541 for k.

RJM

```