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.
%I A329795 #11 Dec 08 2019 07:39:01 %S A329795 2,1,2,3,1,2,3,4,5,3,1,2,3,1,2,3,4,5,1,2,3,4,1,2,3,4,5,1,2,1,2,1,2,3, %T A329795 4,5,1,2,3,5,1,2,3,4,5,1,2,3,4,4,5,6,7,8,1,2,3,4,5,3,4,5,6,1,2,3,4,5, %U A329795 6,2,3,4,1,2,3,4,5,6,7,1,2,1,2,3,4,5,6 %N A329795 a(n) = smallest positive k such that scan_diff(k,n) is a square, where scan_diff is defined in the Comments. %C A329795 Write i, j in base 10 aligned to right, say %C A329795 i = bcd...ef %C A329795 j = .gh...pq %C A329795 Then scan_diff(i,j) = |b-0| + |c-g| + |d-h| + ... + |e-p| + |f-q|. %C A329795 Example: scan_diff(12345,909) = 1+2+6+4+4 = 17. %C A329795 Suggested by the definition of "box" in A329794. %H A329795 Rémy Sigrist, <a href="/A329795/b329795.txt">Table of n, a(n) for n = 1..25000</a> %e A329795 For n = 1 the smallest k producing a square is 2 (as scan_diff(1,2) = 1); %e A329795 For n = 2 the smallest k producing a square is 1 (as scan_diff(2,1) = 1); %e A329795 For n = 3 the smallest k producing a square is 2 (as scan_diff(3,2) = 1); %e A329795 For n = 5 the smallest k producing a square is 1 (as scan_diff(5,1) = 4); %e A329795 For n = 16 the smallest k producing a square is 3 (as scan_diff(16,3) = 1+3 = 4). %o A329795 (PARI) scan_diff(n,k) = if (n*k, scan_diff(n\10,k\10)+abs((n%10)-(k%10)), n+k) %o A329795 a(n) = for (k=1, oo, my (t=scan_diff(n,k)); if (t && issquare(t), return (k))) \\ _Rémy Sigrist_, Dec 08 2019 %Y A329795 Cf. A329794. %K A329795 nonn,base %O A329795 1,1 %A A329795 _N. J. A. Sloane_, Dec 07 2019 %E A329795 More terms from _Rémy Sigrist_, Dec 08 2019