login
Reversible pandigital square numbers.
2

%I #20 Jan 23 2023 13:13:09

%S 1234549876609,9066789454321,123452587690084,123454387666009,

%T 123454987660900,123456987654400,123458987664100,123478988652100,

%U 125688987432100,146678985432100,445678965432100,480096785254321,900666783454321,906678945432100,10223418547690084

%N Reversible pandigital square numbers.

%C These are perfect squares containing each digit from 0 to 9 at least once and still remain square numbers (not necessarily of the same length) when reversing the digits.

%C In 1905, inspired by a question about all pandigital square numbers containing each digit from 0 to 9 exactly once (cf. A036745, A156977), the British mathematician Allan Cunningham (1842-1928) asked for reversible and palindromic pandigital square numbers. In his answer, he gives possible solutions, but actually not the least possible numbers he was asking for in his question.

%H Martin Renner, <a href="/A359346/b359346.txt">Table of n, a(n) for n = 1..458</a>

%H Allan Cunningham, <a href="https://archive.org/details/educationaltimes58educ/page/273/mode/1up?view=theater">Question 15789</a>, The Educational Times, and Journal of the College of Preceptors 58 (1905), nr. 530 (June 1), p. 273; <a href="https://archive.org/details/educationaltimes59educ/page/39/mode/1up?view=theater">Solution 15789</a>, Ibid., 59 (1906), nr. 537 (Jan. 1), p. 39.

%e Sequence starts with 1111103^2 = 1234549876609 <~> 9066789454321 = 3011111^2, which is the smallest possible such number.

%o (Python)

%o from math import isqrt

%o from itertools import count, islice

%o def c(n): return len(set(s:=str(n)))==10 and isqrt(r:=int(s[::-1]))**2==r

%o def agen(): yield from (k*k for k in count(10**6) if c(k*k))

%o print(list(islice(agen(), 15))) # _Michael S. Branicky_, Dec 27 2022

%o (PARI) isok(k) = if (issquare(k), my(d=digits(k)); (#Set(d) == 10) && issquare(fromdigits(Vecrev(d)));); \\ _Michel Marcus_, Dec 31 2022

%Y Cf. A036745, A061457, A156977, A225218, A359347.

%K nonn,base

%O 1,1

%A _Martin Renner_, Dec 27 2022