The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A328780 Nonnegative integers k such that k and k^2 have the same number of nonzero digits. 4

%I #40 Sep 08 2022 08:46:24

%S 0,1,2,3,10,20,30,100,200,245,247,249,251,253,283,300,448,548,949,

%T 1000,1249,1253,1416,1747,1749,1751,1753,1755,2000,2245,2247,2249,

%U 2251,2253,2429,2450,2451,2470,2490,2498,2510,2530,2647,2830,3000,3747,3751,4480,4899

%N Nonnegative integers k such that k and k^2 have the same number of nonzero digits.

%C The idea of this sequence comes from the 1st problem of the 28th British Mathematical Olympiad in 1992 (see the link).

%C This sequence is infinite because the family of integers {10^k, k >= 0} (A011557) belongs to this sequence.

%C 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

%D A. Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Pb 1 pp. 57 and 109 (1992)

%H Giovanni Resta, <a href="/A328780/b328780.txt">Table of n, a(n) for n = 1..10000</a>.

%H British Mathematical Olympiad, <a href="https://bmos.ukmt.org.uk/home/bmo1-1992.pdf">1992 - Problem 1</a>.

%H <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>.

%e 247^2 = 61009, hence 247 and 61009 both have 3 nonzero digits, 247 is a term.

%p q:= n->(f->f(n)=f(n^2))(t->nops(subs(0=[][], convert(t, base, 10)))):

%p select(q, [$0..5000])[]; # _Alois P. Heinz_, Oct 27 2019

%t Select[Range[0, 5000], Equal @@ Total /@ Sign@ IntegerDigits[{#, #^2}] &] (* _Giovanni Resta_, Feb 27 2020 *)

%o (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

%o (PARI) isok(k) = hammingweight(digits(k)) == hammingweight(digits(k^2)); \\ _Michel Marcus_, Dec 22 2020

%Y Subsequences: A011557, A093136, A093138.

%Y Cf. A052040, A104315, A134844.

%Y Cf. A328781, A328782, A328783.

%K nonn,base

%O 1,3

%A _Bernard Schott_, Oct 27 2019

%E More terms from _Alois P. Heinz_, Oct 27 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 3 00:27 EDT 2024. Contains 373054 sequences. (Running on oeis4.)