佩兰数列计算器

输入一个数字,判断其是否在佩兰数列上,或输入N计算第N项佩兰数列值与总和。

佩兰数列计算

什么是佩兰数列?

佩兰数列是一个整数数列,其定义如下:

  • 初始条件:\( P(0) = 3, P(1) = 0, P(2) = 2 \)
  • 递推关系:对于 \( n \geq 3 \),\( P(n) = P(n-2) + P(n-3) \)

佩兰数列的递归关系和巴都万数列一模一样,只是起始值不同。

如何判断一个数是否在佩兰数列上?

  1. 生成佩兰数列:通过定义生成足够多的佩兰数列项,直到达到或超过指定的数字。
  2. 比较:检查指定的数字是否在生成的数列中。
  3. 结果:如果存在,则该数字属于佩兰数列;否则不属于。

示例

例子 1:判断 5 是否在佩兰数列上

解答:

生成佩兰数列:

\( P(0) = 3 \)

\( P(1) = 0 \)

\( P(2) = 2 \)

\( P(3) = P(1) + P(0) = 0 + 3 = 3 \)

\( P(4) = P(2) + P(1) = 2 + 0 = 2 \)

\( P(5) = P(3) + P(2) = 3 + 2 = 5 \)

结果:

\( P(5) =5 \),所以,5 属于佩兰数列。

例子 2:判断 119 是否在佩兰数列上

解答:

生成佩兰数列:

\( P(0) = 3 \)

\( P(1) = 0 \)

\( P(2) = 2 \)

\( P(3) = P(1) + P(0) = 0 + 3 = 3 \)

\( P(4) = P(2) + P(1) = 2 + 0 = 2 \)

\( P(5) = P(3) + P(2) = 3 + 2 = 5 \)

\( P(15) = P(13) + P(12) = 39 + 29 = 68 \)

\( P(16) = P(14) + P(13) = 51 + 39 = 90 \)

\( P(17) = P(15) + P(14) = 68 + 51 = 119 \)

结果:

\( P(17) =119 \),所以,119 属于佩兰数列。

例子 3:判断 2025 是否在佩兰数列上

解答:

生成佩兰数列:

\( P(0) = 3 \)

\( P(1) = 0 \)

\( P(2) = 2 \)

\( P(3) = P(1) + P(0) = 0 + 3 = 3 \)

\( P(4) = P(2) + P(1) = 2 + 0 = 2 \)

\( P(5) = P(3) + P(2) = 3 + 2 = 5 \)

\( P(26) = P(24) + P(23) = 853 + 644 = 1497 \)

\( P(27) = P(25) + P(24) = 1130 + 853 = 1983 \)

\( P(28) = P(26) + P(25) = 1497 + 1130 = 2627 \)

结果:

\( P(28) = 2627 > 2025 \),所以,2025 不属于佩兰数列。

佩兰数列的前 100 项

  • P(0) = 3
  • P(1) = 0
  • P(2) = 2
  • P(3) = 3
  • P(4) = 2
  • P(5) = 5
  • P(6) = 5
  • P(7) = 7
  • P(8) = 10
  • P(9) = 12
  • P(10) = 17
  • P(11) = 22
  • P(12) = 29
  • P(13) = 39
  • P(14) = 51
  • P(15) = 68
  • P(16) = 90
  • P(17) = 119
  • P(18) = 158
  • P(19) = 209
  • P(20) = 277
  • P(21) = 367
  • P(22) = 486
  • P(23) = 644
  • P(24) = 853
  • P(25) = 1130
  • P(26) = 1497
  • P(27) = 1983
  • P(28) = 2627
  • P(29) = 3480
  • P(30) = 4610
  • P(31) = 6107
  • P(32) = 8090
  • P(33) = 10717
  • P(34) = 14197
  • P(35) = 18807
  • P(36) = 24914
  • P(37) = 33004
  • P(38) = 43721
  • P(39) = 57918
  • P(40) = 76725
  • P(41) = 101639
  • P(42) = 134643
  • P(43) = 178364
  • P(44) = 236282
  • P(45) = 313007
  • P(46) = 414646
  • P(47) = 549289
  • P(48) = 727653
  • P(49) = 963935
  • P(50) = 1276942
  • P(51) = 1691588
  • P(52) = 2240877
  • P(53) = 2968530
  • P(54) = 3932465
  • P(55) = 5209407
  • P(56) = 6900995
  • P(57) = 9141872
  • P(58) = 12110402
  • P(59) = 16042867
  • P(60) = 21252274
  • P(61) = 28153269
  • P(62) = 37295141
  • P(63) = 49405543
  • P(64) = 65448410
  • P(65) = 86700684
  • P(66) = 114853953
  • P(67) = 152149094
  • P(68) = 201554637
  • P(69) = 267003047
  • P(70) = 353703731
  • P(71) = 468557684
  • P(72) = 620706778
  • P(73) = 822261415
  • P(74) = 1089264462
  • P(75) = 1442968193
  • P(76) = 1911525877
  • P(77) = 2532232655
  • P(78) = 3354494070
  • P(79) = 4443758532
  • P(80) = 5886726725
  • P(81) = 7798252602
  • P(82) = 10330485257
  • P(83) = 13684979327
  • P(84) = 18128737859
  • P(85) = 24015464584
  • P(86) = 31813717186
  • P(87) = 42144202443
  • P(88) = 55829181770
  • P(89) = 73957919629
  • P(90) = 97973384213
  • P(91) = 129787101399
  • P(92) = 171931303842
  • P(93) = 227760485612
  • P(94) = 301718405241
  • P(95) = 399691789454
  • P(96) = 529478890853
  • P(97) = 701410194695
  • P(98) = 929170680307
  • P(99) = 1230889085548
  • P(100) = 1630580875002