cp's OEIS Frontend

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.

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.

Original entry on oeis.org

0, 0, 7, 13, 86, 293, 1212, 4699, 17380, 60623, 203799, 664953, 2135649, 6800449, 21572602, 68311990, 216144075, 683666674
Offset: 1

Views

Author

Roger Bilisoly (bilisolyr(AT)ccsu.edu), May 15 2010

Keywords

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").

Examples

			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).
		

Crossrefs

a(n) converges to A049415 in the sense that the ratio of the two sequences goes to 1 as n goes to infinity.

Programs

  • 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}]

Extensions

a(16)-a(18) from Donovan Johnson, Jun 10 2010