The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A336797 Numbers, not divisible by 3, whose squares have exactly 4 nonzero digits in base 3. 0

%I

%S 7,14,16,17,26,35,47,68,350,3788

%N Numbers, not divisible by 3, whose squares have exactly 4 nonzero digits in base 3.

%C Is this sequence infinite?

%C Next term, if it exists, is > 3^500. - _James Rayman_, Feb 05 2021

%H Alessio Moscariello, <a href="https://arxiv.org/abs/2101.10415">On sparse perfect powers</a>, arXiv:2101.10415 [math.NT], 2021. See Question 11 p. 9.

%e 7^2=49 in base 3 is 1211, so 7 is a term.

%e 14^2=196 in base 3 is 21021, so 14 is a term.

%t Select[Range[4000], Mod[#, 3] > 0 && Length @ Select[IntegerDigits[#^2, 3], #1 > 0 &] == 4 &] (* _Amiram Eldar_, Jan 27 2021 *)

%o (PARI) isok(n) = (n%3) && #select(x->x, digits(n^2, 3)) == 4;

%o (Python)

%o from gmpy2 import isqrt, is_square

%o import itertools

%o N = 1000

%o powers = [1]

%o a_list = []

%o while len(powers) < N: powers.append(3 * powers[-1])

%o def attempt(n):

%o if is_square(n): a_list.append(int(isqrt(n)))

%o for A, B, C in itertools.combinations(powers[1:], 3):

%o for a, b, c in itertools.product([1, 2], repeat=3):

%o attempt(a*A + b*B + c*C + 1)

%o print(sorted(a_list)) # _James Rayman_, Feb 05 2021

%Y Cf. A007089 (numbers in base 3), A160385.

%K nonn,base,more

%O 1,1

%A _Michel Marcus_, Jan 27 2021

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

Last modified April 14 01:49 EDT 2021. Contains 342941 sequences. (Running on oeis4.)