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!)
A091093 In ternary representation: minimal number of editing steps (delete, insert or substitute) to transform n into n^2. 3
0, 0, 2, 1, 1, 2, 3, 2, 3, 2, 2, 4, 2, 4, 3, 3, 4, 4, 4, 4, 5, 3, 4, 3, 4, 3, 4, 3, 3, 4, 3, 3, 3, 5, 3, 5, 3, 3, 5, 5, 5, 6, 4, 3, 4, 4, 4, 5, 5, 4, 4, 5, 5, 5, 5, 5, 6, 5, 5, 5, 6, 4, 5, 4, 4, 5, 5, 4, 5, 4, 5, 5, 5, 4, 6, 4, 5, 4, 5, 4, 5, 4, 4, 5, 4, 4, 4, 5, 5, 5, 4, 4, 6, 4, 5, 4, 4, 5, 5, 5, 5, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
Michael Gilleland, Levenshtein Distance [It has been suggested that this algorithm gives incorrect results sometimes. - N. J. A. Sloane]
Eric Weisstein's World of Mathematics, Square Number
Eric Weisstein's World of Mathematics, Ternary
FORMULA
a(n) = LevenshteinDistance(A007089(n), A001738(n)).
EXAMPLE
a(12)=2: 12->'110', insert a 2 between the 1's and insert a 0 at the end: '12100'->144=12^2.
MAPLE
A091093:= proc(x) local L1, L2;
L1:= convert(map(`+`, ListTools:-Reverse(convert(x, base, 3)), 48), bytes);
L2:= convert(map(`+`, ListTools:-Reverse(convert(x^2, base, 3)), 48), bytes);
StringTools:-Levenshtein(L1, L2)
end proc:
seq(A091093(i), i=0..1000); # Robert Israel, May 06 2014
CROSSREFS
Sequence in context: A035438 A029260 A205725 * A049615 A114919 A087917
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Dec 18 2003
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 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)