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.

Showing 1-3 of 3 results.

A031177 Unhappy numbers: numbers having period-8 2-digitized sequences.

Original entry on oeis.org

2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22, 24, 25, 26, 27, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 83
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of happy numbers A007770. Cf. A056527.

Programs

  • Haskell
    a031177 n = a031177_list !! (n-1)
    a031177_list = filter ((/= 1) . a103369) [1..]
    -- Reinhard Zumkeller, Aug 24 2011
    
  • Python
    from itertools import count, islice
    def A031177_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            m = n
            while m not in {1,37,58,89,145,42,20,4,16}:
                m = sum((0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[ord(d)-48] for d in str(m))
            if m > 1:
                yield n
    A031177_list = list(islice(A031177_gen(),20)) # Chai Wah Wu, Aug 02 2023

A056528 Sum of digits of square of sum of digits of square.

Original entry on oeis.org

1, 7, 9, 13, 13, 9, 16, 1, 9, 1, 7, 9, 13, 13, 9, 16, 10, 9, 1, 7, 9, 13, 13, 9, 16, 10, 9, 10, 16, 9, 13, 13, 9, 16, 1, 9, 10, 16, 9, 13, 13, 9, 16, 10, 9, 1, 16, 9, 13, 13, 9, 16, 10, 9, 1, 16, 9, 13, 13, 9, 16, 10, 18, 10, 16, 9, 13, 13, 9, 16, 1, 9, 10, 16, 9, 13, 13, 9, 16, 1, 9
Offset: 1

Views

Author

Henry Bottomley, Jun 19 2000

Keywords

Examples

			a(2)=7 because sum of digits of square of 2 is 4 and sum of digits of square of 4 is 1+6=7
		

Crossrefs

Cf. A004159 for sum of digits of square, A056020 where iteration settles to 1, A056020 where iteration settles to 9, A056527 where iteration settles to 13 and 16. See also A056529.

Programs

  • Mathematica
    Array[Total[IntegerDigits[(Total[IntegerDigits[#^2]])^2]]&,90] (* Harvey P. Dale, Jan 17 2012 *)
    Table[Nest[Total[IntegerDigits[#^2]]&,n,2],{n,90}] (* Harvey P. Dale, Mar 07 2018 *)

Formula

a(n)=A004159(A004159(n))

A056529 Number of iterations of sum of digits of square to reach 1, 9, 13 or 16.

Original entry on oeis.org

0, 3, 1, 2, 2, 1, 1, 2, 0, 1, 3, 1, 0, 1, 1, 0, 3, 1, 2, 3, 1, 1, 1, 2, 1, 3, 2, 3, 1, 1, 1, 2, 2, 1, 2, 2, 3, 1, 1, 2, 1, 2, 2, 3, 1, 2, 1, 1, 2, 2, 1, 1, 3, 2, 2, 1, 2, 1, 1, 1, 1, 3, 3, 3, 1, 2, 2, 1, 2, 1, 2, 2, 3, 2, 2, 2, 2, 2, 1, 2, 2, 3, 2, 2, 1, 2, 3, 2, 3, 1, 3, 2, 3, 2, 1, 2, 2, 3, 2, 1, 3, 1, 1, 1, 1
Offset: 1

Views

Author

Henry Bottomley, Jun 19 2000

Keywords

Examples

			a(2)=3 because successive iterations give 2 -> 4 -> 7 -> 13 -> 16 -> 13 etc.
		

Crossrefs

Cf. A004159 for sum of digits of square, A056528 for two iterations, A056020 where iteration settles to 1, A056020 where iteration settles to 9, A056527 where iteration settles to 13 and 16.
Showing 1-3 of 3 results.