Jump to content

Search the Community

Showing results for tags 'fibonacci'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Talk
    • Everything Else
    • Gaming
    • Questions
    • Business and Enterprise IT
    • Security
    • Hacks & Mods
    • Applications & Coding
    • Trading Post
  • Hak5 Gear
    • Hak5 Cloud C²
    • WiFi Pineapple Mark VII
    • USB Rubber Ducky
    • Bash Bunny
    • Key Croc
    • Packet Squirrel
    • Shark Jack
    • Signal Owl
    • LAN Turtle
    • Screen Crab
    • Plunder Bug
  • O.MG (Mischief Gadgets)
    • O.MG Cable
    • O.MG DemonSeed EDU
  • WiFi Pineapple (previous generations)
    • WiFi Pineapple TETRA
    • WiFi Pineapple NANO
    • WiFi Pineapple Mark V
    • WiFi Pineapple Mark IV
    • Pineapple Modules
    • WiFi Pineapples Mark I, II, III
  • Hak5 Shows
  • Community
    • Forums and Wiki
    • #Hak5
  • Projects
    • SDR - Software Defined Radio
    • Community Projects
    • Interceptor
    • USB Hacks
    • USB Multipass
    • Pandora Timeshifting

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Enter a five letter word.

Found 1 result

  1. I was kinda curious how other people would do this. So you take a regular Fibonacci sequence like this: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 But I'm changing it up a bit so I get a different sequence like this one: 1, 2, 4, 7, 11, 20, 33, 54, etc The math looks something like this and I can do it on paper. 1+1+2+3+5+8+13+21+34+45+79 1+1+2+3+5+ 8+13+21+34+45 1+1+2+3+ 5+ 8+13+21+34 1+1+2+ 3+ 5+ 8+13+21 1+1+ 2+ 3+ 5+ 8+13 1+ 1+ 2+ 3+ 5+ 8 1+ 1+ 2+ 3+ 5 1+ 1+ 2+ 3 1+ 1+ 2 1+ 1 1 So in a regular fibonacci sequence it's something like this: #include<iostream> using namespace std; int main() { int fib1 = 0, fib2 = 1, fib3 = 1; cout << "The Fibonacci Series is : " << endl << fib1 << " " << fib2 << " "; while (fib1 + fib2 < 1000000) { fib3 = fib1 + fib2; fib1 = fib2; fib2 = fib3; cout << fib3 << " "; } cout << endl; return 0; } Not sure if the best way to to do this is write all of the possible fibonacci numbers to an array then loop through the array to add up the numbers for the sequence or if I should use the final fib values and count backward from the final two fib values just doing a backwards subtaction pattern. These are hypothetical questions. Question: Can you create a dynamic multi-dimensional array without knowing how many dimensions the array will have. I understand the part about creating a dynamic array where you can load in any number of variables. I suppose I could just load all of those values into an array then use nested for loops for each iteration. So int a =x; int b =x-1; int c= x-2; etc. Peronally I like array idea because it is easy but that's not the most optimal way to do it. I'm sure someone a little more savvy could make this happen using less memory and faster. Using Fibonacci's sequence to describe timeline forks. So say you have computer virus that spread from one machine to the next in a given amount of time. The first machine will continue to also infect machine until there are no more machines to infect. But that's not the only application for this.
×
×
  • Create New...