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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A239320 Ternary happy numbers. 3
1, 3, 9, 13, 17, 23, 25, 27, 31, 35, 37, 39, 47, 51, 53, 59, 61, 65, 69, 71, 73, 75, 77, 79, 81, 85, 89, 91, 93, 101, 105, 107, 109, 111, 117, 137, 141, 143, 153, 155, 159, 161, 167, 169, 173, 177, 179, 181, 183, 185, 187, 191, 195, 197, 207, 209, 213 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Numbers where the trajectory of iterated application of A006287 ends at the fixed point 1.

LINKS

Amiram Eldar, Table of n, a(n) for n = 1..10000

H. G. Grundmann, Semihappy Numbers, J. Int. Seq. 13 (2010), 10.4.8.

EXAMPLE

13 is a ternary happy number because 13=111_3 -> 1 + 1 + 1 = 3 = 10_3 -> 1 + 0 = 1.

MAPLE

isA239320 := proc(n)

    t := A006287(n) ;

    tloo := {} ;

    for i from 1 do

        if t = 1 then

            return true;

        end if;

        if t in tloo then

            return false;

        end if;

        tloo := tloo union {t} ;

        t := A006287(t) ;

    end do:

end proc:

for n from 1 to 300 do

    if isA239320(n) then

        printf("%d, ", n) ;

    end if;

end do: # R. J. Mathar, Jun 13 2014

MATHEMATICA

happyQ[n_, b_] := NestWhile[Plus @@ (IntegerDigits[#, b]^2) &, n, UnsameQ, All] == 1; Select[Range[213], happyQ[#, 3] &] (* Amiram Eldar, May 28 2020 *)

CROSSREFS

Cf. A007770, A240849.

Sequence in context: A063791 A077791 A176393 * A243656 A240108 A163595

Adjacent sequences:  A239317 A239318 A239319 * A239321 A239322 A239323

KEYWORD

nonn,base,easy

AUTHOR

Jiri Klepl, Apr 13 2014

STATUS

approved

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 09:12 EDT 2021. Contains 343110 sequences. (Running on oeis4.)