Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
School themes from USSR and EurAsia
#12
Fibonacci Formula from Russia & EurAsia

[Image: FiboFormula.png]
can everyone see? image 8 KB

Code: (Select All)
Open "FiboFormula.txt" For Output As #1 ' optional
For i = 1 To 36 ' Russian FiboFormula.bas
    f = (1/Sqr(5))*(((1+Sqr(5))/2)^i-((1-Sqr(5))/2)^i)
    Print i, f
    Print #1, i, f ' optional
Next: End

Fibonacci Sequence Infinity

Code: (Select All)
DIM F(80) AS DOUBLE 'FibRus.bas
F(1) = 1: F(2) = 1
OPEN "FibRus.txt" FOR OUTPUT AS #2 ' optional
FOR i = 3 TO 80
    F(i) = F(i-1)+F(i-2)
NEXT i

FOR i = 1 TO 80
    f$ = STR$(F(i)): LF = 22 - LEN(f$)
    n$ = ""
    FOR j = 1 TO LF: n$ = " " + n$: NEXT
    f$ = n$ + f$
    PRINT i, f$: PRINT #2, i, f$ ' optional
NEXT i

Code: (Select All)
1                                 1
2                                 1
3                                 2
4                                 3
5                                 5
6                                 8
7                                13
...
24                            46368
25                            75025
26                           121393
...
76                 3416454622906707
77                 5527939700884757
78                 8944394323791464
79            1.447233402467622D+16

qb64 qbasic quickbasic
= (1/sqr(5))*(((1+sqr(5))/2)^N-((1-sqr(5))/2)^N)

excel & Python
= (1/Sqrt(5))*(((1+Sqrt(5))/2)^N-((1-Sqrt(5))/2)^N)
= (1/КОРЕНЬ(5))*(((1+КОРЕНЬ(5))/2)^B3-((1-КОРЕНЬ(5))/2)^B3)

C C+ C++ C# C@#$%&
= (1/Math.Sqrt(5))*(((1+Math.Sqrt(5))/2)^N-((1-Math.Sqrt(5))/2)^N)

[Image: Fibo-Formula.png]
image 8 KB
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic

Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Reply


Messages In This Thread
School themes from USSR and EurAsia - by DANILIN - 05-02-2022, 12:31 PM
RE: School themes from USSR and EurAsia - by Pete - 11-07-2022, 10:48 PM
RE: School themes from USSR and EurAsia - by DANILIN - 09-02-2022, 06:09 PM
RE: School themes from USSR and EurAsia - by Jack - 11-08-2022, 03:07 AM
RE: School themes from USSR and EurAsia - by Jack - 11-08-2022, 03:19 PM
RE: School themes from USSR and EurAsia - by Pete - 11-08-2022, 04:39 PM
RE: School themes from USSR and EurAsia - by Pete - 11-08-2022, 03:34 PM



Users browsing this thread: 3 Guest(s)