Tribonacci Calculator
맞춤 시작 값으로 Tribonacci 수열 및 일반화된 변형을 생성합니다.
트리보나치 상수
1.8392867552
비율 (T20/T19)
1.8392873975
수열
| n | 트리보나치 |
|---|---|
| 0 | 0 |
| 1 | 0 |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 4 |
| 6 | 7 |
| 7 | 13 |
| 8 | 24 |
| 9 | 44 |
| 10 | 81 |
| 11 | 149 |
| 12 | 274 |
| 13 | 504 |
| 14 | 927 |
| 15 | 1705 |
| 16 | 3136 |
| 17 | 5768 |
| 18 | 10609 |
| 19 | 19513 |
트리보나치 소개
Each term is the sum of the three preceding terms. The ratio of consecutive terms converges to the Tribonacci constant ~1.8392867552141612.
이 도구 소개
트리보나치 수열은 유명한 피보나치 수열의 일반화로, 두 개의 앞선 수가 아닌 세 개의 앞선 수를 더해 다음 수를 만듭니다. 자연계, 수학, 알고리즘 분석에서 나타나기 때문에 재귀적 패턴과 수학적 성장을 연구하는 데 귀중한 도구입니다. 이 계산기를 사용하면 손으로 계산하거나 코드를 작성하지 않고도 트리보나치 수열을 빠르게 탐색할 수 있습니다.
계산기를 사용하려면 원하는 수열의 길이를 입력하고 필요에 따라 처음 세 개의 값을 커스터마이즈합니다(기본값은 0, 0, 1). 생성을 클릭하면 수 초 내에 완전한 수열이 표시됩니다. 결과를 클립보드에 복사하여 스프레드시트, 문서 또는 프로그래밍 프로젝트에 사용할 수 있습니다. 이는 특히 재귀 수열을 배우는 학생, 알고리즘 과제를 구현하는 개발자, 또는 수학적 패턴 탐색에 관심 있는 사람들에게 유용합니다.
자주 묻는 질문
코드 구현
from decimal import Decimal
def tribonacci(n: int, a: int = 0, b: int = 0, c: int = 1) -> list[int]:
"""Generate the first n terms of the Tribonacci sequence."""
if n <= 0:
return []
seq = [a, b, c]
while len(seq) < n:
seq.append(seq[-1] + seq[-2] + seq[-3])
return seq[:n]
# Standard Tribonacci sequence
seq = tribonacci(20)
print("Tribonacci sequence (first 20 terms):")
print(seq)
# Show ratios converging to Tribonacci constant (~1.8392867552141612)
print("\nRatios (approaching Tribonacci constant):")
for i in range(5, 20):
ratio = seq[i] / seq[i-1] if seq[i-1] != 0 else 0
print(f"T({i})/T({i-1}) = {seq[i]}/{seq[i-1]} ≈ {ratio:.10f}")
# Custom starting values
custom = tribonacci(15, a=1, b=1, c=2)
print("\nCustom (1,1,2):", custom)Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.