A328780 Nonnegative integers k such that k and k^2 have the same number of nonzero digits.
0, 1, 2, 3, 10, 20, 30, 100, 200, 245, 247, 249, 251, 253, 283, 300, 448, 548, 949, 1000, 1249, 1253, 1416, 1747, 1749, 1751, 1753, 1755, 2000, 2245, 2247, 2249, 2251, 2253, 2429, 2450, 2451, 2470, 2490, 2498, 2510, 2530, 2647, 2830, 3000, 3747, 3751, 4480, 4899
Offset: 1
Examples
247^2 = 61009, hence 247 and 61009 both have 3 nonzero digits, 247 is a term.
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.
- Index to sequences related to Olympiads.
Crossrefs
Programs
-
Magma
nz:=func
; [k:k in [0..5000] | nz(k) eq nz(k^2)]; // Marius A. Burtea, Dec 21 2020 -
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 *)
-
PARI
isok(k) = hammingweight(digits(k)) == hammingweight(digits(k^2)); \\ Michel Marcus, Dec 22 2020
Extensions
More terms from Alois P. Heinz, Oct 27 2019
Comments