OFFSET
1,3
COMMENTS
The idea of this sequence comes from the 1st problem of the 28th British Mathematical Olympiad in 1992 (see the link).
This sequence is infinite because the family of integers {10^k, k >= 0} (A011557) belongs to this sequence.
The numbers m, m + 1, m + 2 where m = 49*10^k - 3, or m = 99*10^k - 3, k >= 3 are terms with all nonzero digits. - Marius A. Burtea, Dec 21 2020
REFERENCES
A. Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Pb 1 pp. 57 and 109 (1992)
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000.
British Mathematical Olympiad, 1992 - Problem 1.
EXAMPLE
247^2 = 61009, hence 247 and 61009 both have 3 nonzero digits, 247 is a term.
MAPLE
q:= n->(f->f(n)=f(n^2))(t->nops(subs(0=[][], convert(t, base, 10)))):
select(q, [$0..5000])[]; # Alois P. Heinz, Oct 27 2019
MATHEMATICA
Select[Range[0, 5000], Equal @@ Total /@ Sign@ IntegerDigits[{#, #^2}] &] (* Giovanni Resta, Feb 27 2020 *)
PROG
(Magma) nz:=func<n|#Intseq(n)-Multiplicity(Intseq(n), 0)>; [k:k in [0..5000] | nz(k) eq nz(k^2)]; // Marius A. Burtea, Dec 21 2020
(PARI) isok(k) = hammingweight(digits(k)) == hammingweight(digits(k^2)); \\ Michel Marcus, Dec 22 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Oct 27 2019
EXTENSIONS
More terms from Alois P. Heinz, Oct 27 2019
STATUS
approved