OFFSET
1,1
COMMENTS
The sequence consists of all square numbers which when represented in some base b contain all the b digits in that base exactly once.
A225218 has all the squares in base 10 that are pandigital. This sequence is the union of all such sequences in any integer base b >= 2.
LINKS
David Schilling, Table of n, a(n) for n = 1..5508
EXAMPLE
15^2 in base 4 (225 is 3201 in base 4) contains the digits 0-3.
195^2 in base 6 (38025 is 452013 in base 6) contains the digits 0-5.
The next three terms contain all the digits in base 7.
The following four entries are pandigital in base 8, the next 26 in base 9, and so on.
PROG
(JAI)
#import "Basic";
dstr := "0123456789abcdef";
main :: () {
digits : [16] int;
for j:2..3_000_000 {
for b:3..16 {
for d : 0..15
digits[d] = 0;
k := j*j;
s := tprint( "%", formatInt( k, b ) );
if s.count > b
continue;
for d : 0..s.count-1 {
for c : 0..dstr.count-1 {
if s[d] == dstr[c] {
digits[c] += 1;
continue d;
}
}
}
for d : 0..b-1 {
if digits[d] != 1
continue b;
}
print( "%, ", k );
}
}
}
(PARI) \\ here ispandig(n) returns base if n is pandigital, otherwise 0.
ispandig(n)={for(b=2, oo, my(r=logint(n, b)+1); if(r<b, break); if(r==b && #Set(digits(n, b))==b, return(b))); 0}
for(n=1, 10^5, if(ispandig(n^2), print1(n^2, ", "))) \\ Andrew Howroyd, Dec 20 2020
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
David Schilling, Dec 13 2020
STATUS
approved