login
A177952
a(n) = number of n-digit squares in base 10 such that there is at least one permutation that is also a square in base 10. Initial zeros are not allowed for any square.
0
0, 0, 7, 13, 86, 293, 1212, 4699, 17380, 60623, 203799, 664953, 2135649, 6800449, 21572602, 68311990, 216144075, 683666674
OFFSET
1,3
COMMENTS
The ratio of a(n) to the n-th entry of sequence A049415 goes to 1. Bilisoly (2008), listed below, has a proof of this. Squares of this type are called "anasquares" in this reference (short for "anagram of squares").
LINKS
R. Bilisoly, 92.45 Anasquares: Square anagrams of squares, The Mathematical Gazette, 92(2008), 58-63.
EXAMPLE
For instance, a(3) = 7 because (1) 144, 441 are both squares and permutations of each other as is 256, 625 and 169, 196, 961 and (2) there are no other 3 digit squares that can be permuted to another square (because initial zeros are forbidden, 100 and 001, etc., do not count).
MATHEMATICA
nAnasquares[ndigits_] := Module[{nsquares = 0, nkeys = 0, nanapat = 0, upper, lower, square, key, dictionary}, lower = Sqrt[10^(ndigits - 1)] // Ceiling; upper = Sqrt[10^ndigits - 1] // Floor; Do[ ++nsquares; square = i^2; key = ToString[FromDigits[Sort[IntegerDigits[square]]]]; If[StringQ[ dictionary[ key]] && (Length[StringPosition[dictionary[key], ", "]] == 0), ++nanapat, Null] If[StringQ[dictionary[key]], dictionary[key] = dictionary[key] <> ", " <> ToString[square], dictionary[key] = ToString[square]; ++nkeys], {i, lower, upper}]; Return[nsquares - nkeys + nanapat] ] Table[nAnasquares[n], {n, 1, 10}]
CROSSREFS
a(n) converges to A049415 in the sense that the ratio of the two sequences goes to 1 as n goes to infinity.
Sequence in context: A362246 A073220 A110455 * A320461 A132373 A110293
KEYWORD
base,more,nonn
AUTHOR
Roger Bilisoly (bilisolyr(AT)ccsu.edu), May 15 2010
EXTENSIONS
a(16)-a(18) from Donovan Johnson, Jun 10 2010
STATUS
approved