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!)
A018827 Numbers n such that n is a substring of its square in base 3 (written in base 10). 8

%I #19 Apr 05 2024 08:20:15

%S 0,1,3,7,9,27,32,43,81,131,243,287,706,729,1330,1390,1679,1832,2187,

%T 2899,3848,4170,5234,6436,6561,11544,12510,14261,19308,19683,30433,

%U 33181,34135,35203,35323,37530,38669,42783,59049,72070,79583,93539,99543

%N Numbers n such that n is a substring of its square in base 3 (written in base 10).

%t Select[Range[0, 10^5], StringContainsQ[IntegerString[#^2, 3], IntegerString[#, 3]] &] (* _Paolo Xausa_, Apr 05 2024 *)

%o (Python)

%o from sympy.ntheory import digits

%o def s(n, base=3): return "".join(map(str, digits(n, base)[1:]))

%o def ok(n): return s(n) in s(n**2)

%o print([k for k in range(10**5) if ok(k)]) # _Michael S. Branicky_, Apr 04 2024

%Y Cf. A018826 (base 2), A018828 (base 4), A018829 (base 5), A018830 (base 6), A018831 (base 7), A018832 (base 8), A018833 (base 9), A018834 (base 10).

%K nonn,base

%O 1,3

%A _David W. Wilson_

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 29 18:23 EDT 2024. Contains 373855 sequences. (Running on oeis4.)