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.

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

This page as a plain text file.
%I A031177 #22 Feb 16 2025 08:32:35
%S A031177 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,
%T A031177 35,36,37,38,39,40,41,42,43,45,46,47,48,50,51,52,53,54,55,56,57,58,59,
%U A031177 60,61,62,63,64,65,66,67,69,71,72,73,74,75,76,77,78,80,81,83
%N A031177 Unhappy numbers: numbers having period-8 2-digitized sequences.
%H A031177 Reinhard Zumkeller, <a href="/A031177/b031177.txt">Table of n, a(n) for n = 1..10000</a>
%H A031177 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Digitaddition.html">Digitaddition</a>
%H A031177 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/UnhappyNumber.html">Unhappy Number</a>
%o A031177 (Haskell)
%o A031177 a031177 n = a031177_list !! (n-1)
%o A031177 a031177_list = filter ((/= 1) . a103369) [1..]
%o A031177 -- _Reinhard Zumkeller_, Aug 24 2011
%o A031177 (Python)
%o A031177 from itertools import count, islice
%o A031177 def A031177_gen(startvalue=1): # generator of terms >= startvalue
%o A031177     for n in count(max(startvalue,1)):
%o A031177         m = n
%o A031177         while m not in {1,37,58,89,145,42,20,4,16}:
%o A031177             m = sum((0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[ord(d)-48] for d in str(m))
%o A031177         if m > 1:
%o A031177             yield n
%o A031177 A031177_list = list(islice(A031177_gen(),20)) # _Chai Wah Wu_, Aug 02 2023
%Y A031177 Complement of happy numbers A007770. Cf. A056527.
%Y A031177 Cf. A003132, A103369.
%K A031177 nonn,base
%O A031177 1,1
%A A031177 _Eric W. Weisstein_