Giter Club home page Giter Club logo

pascaltrianglemonster's Introduction

Pascal Triangle Monster : binaryPlot

Pascal Triangle monsters. I am plotting the rows of Pascal triangle as 32 digit binary numbers in column across the screen. The binary numbers are arranged from bottom to top. So a single square at the bottom indicates a 1, a single square one place above the bottom indicate a 2, and two squares one in the bottom and one directly above indicates a 3, and so on.

The images it creates are symmetrical as the numbers in the triangle are. The central numbers get big pretty quickly.

This is inspired by wolfram math visualizations.

just in time for Halloween

A binary plot visualizer made in p5.js to plot number sequences, inspired by some plots plots in Wolfram's Mathworld.

It can be adjusted to plot 8 and 16 bit numbers (and others as well) I am plotting in binary the natural numbers from 0 to 255. These are 8 bit numbers the leftmost slice is zero and right most is 255. I start counting from the bottom up.

I have plotted the first 255 squares, cubes and triangular numbers too.

squares and triangular numbers are 16bit and cubes need to be 24 bit so the largest number 16581375 doesn't overflow

A need python hack is to use bit_length

>>> a = 16581375
>>> a.bit_length()
24

I was also inspired by a talk by Douglas Hofstadter on intertwined patterns of integers and patterns of thought.

#p5js #binary #creativecoding #numbersequences #math #python

added Collatz

I have added to plots of the Collatz conjecture, 3n+1

For all numbers 1 to 255 (starts at one for the collatz plots)

I have plotted the path length:

for example:

  • from 1 to 1 takes 0 steps so a length of 0
  • from 2 to 1 one takes 1 steps so a length of 1
  • from 3 to 1 takes 7 steps [3, 10, 5, 16, 8, 4, 2, 1] so a length of 7
  • the largest number of steps to one for numbers up to 255 is 127 so I am using 8 bit numbers

I have also plotted sum of the path (including 1)

for example the sum for 3 will be 49

[3, 10, 5, 16, 8, 4, 2, 1] = 49

live at: https://greggelong.github.io/binaryPlot/

pascaltrianglemonster's People

Contributors

greggelong avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.