https://projecteuler.net/problem=2
https://progeigo.org/learning/essential-words-600-plus/ Words starting with B
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#This program has no bugs and bitbyte calculations (it seems so)
# This program doesn't have bug and bit byte calc.
#I haven't tried it in a browser
# I dindn't try this on browser.
#Number of bases
based_numgber = 1
#Number of branches (Fibonacci branches at the second number, maybe)
branch_number = 2
#Number of blanks (in the middle)
blank_number = 0
#Back up the total
backup_numgber = branch_number
#Number to block the calculation
block_numger = 4000000
#Boolean flag (I don't understand the meaning)
boolean_flag = True
while boolean_flag :
blank_number = based_numgber + branch_number
based_numgber = branch_number
branch_number = blank_number
if blank_number >= block_numger :
break
if blank_number % 2 == 0 :
backup_numgber += blank_number
print(backup_numgber)
# python3 test.py
4613732
I'll get angry if such a variable name is written
Recommended Posts