A007770: Happy numbers

HappyR Documentation

Happy numbers

Description

Under OEIS A007770, a Happy number is defined by the process that starts from arbitrary positive integer and replaces the number by the sum of the squares of each digit until the number is 1. First 6 Happy numbers are 1, 7, 10, 13, 19, 23.

Usage

Happy(n, gmp = TRUE)

Arguments

n

the number of first n entries from the sequence.

gmp

a logical; TRUE to use large number representation, FALSE otherwise.

Value

a vector of length n containing first entries from the sequence.

Examples

## generate first 30 happy numbers
print(Happy(30))


kisungyou/Zseq documentation built on Sept. 13, 2022, 5:12 a.m.