Happy numbers: Difference between revisions
Content deleted Content added
→{{header|J}}: add alternative formulation |
|||
Line 526:
past = []
while True:
total = sum(
if total == 1 or total in past:
n = total
past.append(total)
>>> [x for x in range(1,500) if happy(x)][:8]
</lang>
|