cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A240849 Quinary happy numbers.

Original entry on oeis.org

1, 5, 7, 11, 19, 23, 25, 27, 33, 35, 41, 43, 49, 51, 55, 79, 81, 83, 91, 93, 95, 99, 103, 109, 115, 119, 121, 123, 125, 127, 133, 135, 141, 143, 149, 153, 157, 159, 161, 165, 169, 171, 173, 175, 181, 189, 193, 197, 201, 203, 205, 209, 213, 215, 217, 219, 221, 223, 229, 231, 233, 237, 241, 243, 245, 249
Offset: 1

Views

Author

Jiri Klepl, Apr 13 2014

Keywords

Comments

Numbers for which the repeated application of the operation "Sum the squares of the digits of the base-5 representation" is trapped by (ends at) the fixed point 1.

Examples

			19 is a quinary happy number because 19=34_5 -> 3^2 + 4^2 = 25 = 100_5 -> 1+0+0 = 1.
		

Crossrefs

Programs

  • Maple
    isA240849 := proc(n)
        t := SqrdB5(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 := A276191(t) ;
        end do:
    end proc:
    for n from 1 to 300 do
        if isA240849(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Aug 24 2016
  • Mathematica
    happyQ[n_, b_] := NestWhile[Plus @@ (IntegerDigits[#, b]^2) &, n, UnsameQ, All] == 1; Select[Range[250], happyQ[#, 5] &] (* Amiram Eldar, May 28 2020 *)