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!)
A337296 Number whose sum and product of ternary representation digits are equal. 1
0, 1, 2, 8, 134, 152, 158, 160, 206, 212, 214, 230, 232, 238, 265760, 265814, 265832, 265838, 265840, 265976, 265994, 266000, 266002, 266048, 266054, 266056, 266072, 266074, 266080, 266462, 266480, 266486, 266488, 266534, 266540, 266542, 266558, 266560, 266566 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
In ternary representation all the terms except 0 are zeroless (A032924).
If k is the number of digits 2 of a term, then the number of digits 1 is 2^k - 2*k, and the total number of digits is thus 2^k - k (A000325).
The total number of terms with k digits 2, for k = 1, 2, ..., is binomial(2^k-k,k) = 1, 1, 10, 495, 80730, 40475358, ...
LINKS
EXAMPLE
8 is a term since in base 3 the representation of 8 is 22 and 2 + 2 = 2 * 2.
MATHEMATICA
Select[Range[0, 266566], Times @@ (d = IntegerDigits[#, 3]) == Plus @@ d &]
(* or *)
f[k_] := FromDigits[#, 3] & /@ Permutations[Join[Table[1, {2^k - 2*k}], Table[2, k]]]; Flatten@ Join[{0}, Table[f[k], {k, 0, 4}]] (* Amiram Eldar, Oct 16 2023 *)
PROG
(PARI) isok(m) = my(d=digits(m, 3)); vecsum(d) == vecprod(d); \\ Michel Marcus, Aug 22 2020
CROSSREFS
The ternary version of A034710.
Sequence in context: A184945 A058343 A267407 * A111827 A045330 A193203
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Aug 21 2020
STATUS
approved

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 May 17 19:01 EDT 2024. Contains 372603 sequences. (Running on oeis4.)