Giter Site home page Giter Site logo

djdarcy / prime-square-sum Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 357 KB

A python script that squares primes and sums them together to determine if the base number of elements (r) in a triangular number (b): sum_(x=1)^r t(b, r, x); is equal to a series of squared primes.

License: Other

Python 5.87% Mathematica 94.13%

prime-square-sum's Introduction

Prime-Square-Sum

There is a brief notebook that outlines the concept available in the "paper and notes" folder: Triangular Numbers and Squared Primes.nb.

To view the notebook you will need a full version of Mathematica or the CDF Player.

The python program squares primes and sums them together to determine if:

stf(b) = sum_(z=1)^qg(b) tf(b,z);

is equal to the series of squared primes.

b = triangular number (also the number base);              //equal to: (r^2+r)/2 
r = qg(b) = size of the base row of the triangular number; //qg(b) = 1/2(-1+sqrt(1+8b)
z = row in the triangular number;  //ex. tf(10,4)=0123; tf(10,3)=456; tf(10,2)=78, etc.)

Where tf() is defined to be:

tf(b,z) = (-2 + 2b - 2b^2 + z - bz - z^2 + bz^2 + b^z(2 + 2b^2 + z + z^2 - b(2 + z + z^2))) / (2(-1 + b)^2)

There is an interesting relationship when {b=10, r=4} where the sum of the rows in base-10, 0123 + 456 + 78 + 9, happens to work out to be the sum of the first seven squared primes.

stf(10) = 2² + 3² + 5² + 7² + 11² + 13² + 17² = 666

What I find fascinating about this relationship is the resultant value 666 is a triangular number itself. So the question then is if we were able to sum the rows of a 666 element triangle with 36 rows in base-666 would the result also be the sum of squared or cubed primes?

This program attempts to provide an answer. The base-10 number from stf(666) is massively large unfortunately at 98 digits:

37005443752611483714216385166550857181329086284892731078593232926279977894581784762614450464857290

So I'll probably have to adapt it at some point to work with CUDA or OpenCL to see if I can speed up the computations. I have a large series of primes precomputed for people to speed up the operation.

Prime numbers in text format

Prime numbers in dat format

prime-square-sum's People

Contributors

djdarcy avatar xtraeme-xt avatar

Watchers

 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.