login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A329795 a(n) = smallest positive k such that scan_diff(k,n) is a square, where scan_diff is defined in the Comments. 2
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, 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, 6, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 1, 2, 1, 2, 3, 4, 5, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Write i, j in base 10 aligned to right, say
i = bcd...ef
j = .gh...pq
Then scan_diff(i,j) = |b-0| + |c-g| + |d-h| + ... + |e-p| + |f-q|.
Example: scan_diff(12345,909) = 1+2+6+4+4 = 17.
Suggested by the definition of "box" in A329794.
LINKS
EXAMPLE
For n = 1 the smallest k producing a square is 2 (as scan_diff(1,2) = 1);
For n = 2 the smallest k producing a square is 1 (as scan_diff(2,1) = 1);
For n = 3 the smallest k producing a square is 2 (as scan_diff(3,2) = 1);
For n = 5 the smallest k producing a square is 1 (as scan_diff(5,1) = 4);
For n = 16 the smallest k producing a square is 3 (as scan_diff(16,3) = 1+3 = 4).
PROG
(PARI) scan_diff(n, k) = if (n*k, scan_diff(n\10, k\10)+abs((n%10)-(k%10)), n+k)
a(n) = for (k=1, oo, my (t=scan_diff(n, k)); if (t && issquare(t), return (k))) \\ Rémy Sigrist, Dec 08 2019
CROSSREFS
Cf. A329794.
Sequence in context: A194029 A194055 A162192 * A329794 A238954 A238967
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Dec 07 2019
EXTENSIONS
More terms from Rémy Sigrist, Dec 08 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)