跳转到主要内容
Calcton

Happy Numbers Calculator

Free online happy numbers calculator. Enter your values and get instant results with the formula, step-by-step working, a worked example and FAQs — everything runs locally in your browser on Calcton, no signup required.

中文版:快乐数迭代链计算器

Happy Numbers Calculator
正整数 n

原理

快乐数:反复把数替换为其各位数字的平方和,最终到达 1(随后恒在 1)。到不了 1 的数必落入唯一的循环 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4——「 unhappy」的判定等价于是否撞进这个 8 元环。这是十进制下的动力学系统,与数位和 类似但更 chaotic。

任何数位平方和都迅速缩小(d 位数最多映射到 81d),因此迭代必然终止:要么到 1、要么入环。1 到 100 共 20 个快乐数;密度随范围缓慢变化(10^6 内约 14.3%)。

使用步骤

① 输入正整数;② 得到判定、步数与完整迭代序列;③ 序列末尾出现 4 即不快乐、出现 1 即快乐。

计算示例

7 → 49 → 97 → 130 → 10 → 1(5 步,快乐);19 → 82 → 68 → 100 → 1(4 步);4 直接进入循环(不快乐);100 以内快乐数恰好 20 个:1、7、10、13、19、23、28、31、32、44、49、68、70、79、82、86、91、94、97、100。

注意事项

快乐性依赖于进制:十进制下的快乐数在二进制里完全不同(二进制每位平方和即位数,全部数都快乐)。1 本身步数为 0;重复数字如 11 → 2 → 4 不快乐。

常见问题

Q:为什么不快乐数总进同一个环?A:映射把大数压到 243 以内(999…9 → 81×位数),243 以内的像可穷举,所有不归 1 的轨道都被 8 元环捕获。

Q:有「最高兴」的数吗?A:步数最长的记录随位数增长——7 需 5 步、78999 需 20 步左右;用平方和代替立方和( happy 的推广)环结构会完全改变。

参考值区(同源数值校验)

7 的迭代 7 → 49 → 97 → 130 → 10 → 1(5 步);1–20 内快乐数 5 个(1、7、10、13、19);1–100 内 20 个。

How to use the Happy Numbers Calculator

  1. Fill in the inputs with your own numbers — every field shows what it expects.
  2. The result updates instantly as you type; no "Calculate" click needed.
  3. Read the result card for the main figure, the step-by-step formula, and practical notes.

Frequently asked questions

Is the Happy Numbers Calculator free?

Yes — all math calculators on Calcton are free, with no sign-up required. Your inputs are processed in your browser and never sent to a server.

Is there a Chinese version of this tool?

Yes. Use the Chinese version link above — it is the same calculator with the interface in Simplified Chinese.

References

Formulas and benchmarks used by this calculator follow these published sources.

  1. dlmf.nist.gov
  2. mathworld.wolfram.com
Kevin's profile

KevinContent LeadCalcton Editorial Team · Last updated 2026-09-30

Kevin maintains Calcton's formula verification and content: every calculator cites the standard it implements, worked examples are recomputed programmatically, and health benchmarks follow WHO and international guidelines.

Related calculators

More in this category: Math calculators

About math calculators

Free online math calculators for algebra, statistics, number theory and everyday arithmetic — from quadratic equations and matrices to percentages, fractions and prime factorization, each with step-by-step formulas.

搜索计算器

搜索全站计算器、分类与页面,回车直达