mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Miscellaneous Math (https://www.mersenneforum.org/forumdisplay.php?f=56)
-   -   is this a demonstrable formula?: (Extension of the independent variable) (https://www.mersenneforum.org/showthread.php?t=24011)

Godzilla 2019-01-18 09:20

is this a demonstrable formula?: (Extension of the independent variable)
 
Good morning,

is this a demonstrable formula?: (Extension of the independent variable)
this formula has found prime numbers of different value

A=((n*n)*99)/2
B=sqrt(A)
C=sqrt(A)-1

In The Code .Py
"B=Func"
"C=Func-1"
"N= n+1"

[B]For n = 1 to 10000[/B]
N=1229 prime numbers
Func=997 prime numbers
Func-1=982 prime numbers
TOTAL PRIME NUMBERS OF DIFFERENT VALUE = 3208-N=1979

[B]For n = 1 to 100000[/B]
N=9592 prime numbers
Func=8052 prime numbers
Func-1=8131prime numbers
TOTAL PRIME NUMBERS OF DIFFERENT VALUE = 25775-N=16183

etc...

[CODE]
aa=1
ii=1
i2=0
GG=0
FF=0
VV =0
e = 0
AA=0
c = 1
a =3
bb=0
dd=0
I=1
II=1
III=1
i=1
i1=0
b=0
p=1
equTwo=0
equTwoo=0
equTwooo=0
mod=0
equ=0
moda=0
modaa=0
print('Helloword \n\n');
bb=input('Inserire numero: ')

while p<=bb:

equTwo= ((p*p)*99)//2
equTwoo=((equTwo**(1/2.0))//1)
equTwooo=equTwoo-1




print(' N= ---->' , p)
print(' FUNC= ---->' , equTwoo)
print(' Func-1=---->', equTwooo)



while I<=p:


I=I*1
I=I+1
if p==I :

print(' P is prime -----', p)
AA=AA+1
break

if p%I==0 :
break

while II<=equTwoo:


II=II*1
II=II+1
if equTwoo==II :

print(' Func is prime -----', equTwoo)
modaa=modaa+1
break

if equTwoo%II==0 :
break

while III<=equTwooo:


III=III*1
III=III+1
if equTwooo==III :

print(' FUNC-1 is prime -----', equTwooo)
moda=moda+1
break

if equTwooo%III==0 :
break



p=p+1
aa=aa+1
I=1
II=1
III=1




print('\n\n\nTOTALE NUMERI P TROVATI : ' , AA)
print('\n\n\nTOTALE NUMERI Func TROVATI : ',modaa)
print('\n\n\nTOTALE NUMERI FUNC-1 TROVATI : ',moda)

[/CODE]

Batalov 2019-01-18 15:46

[QUOTE=Godzilla;506310]Good morning,

is this a demonstrable formula?
A=((n*n)*99)/2
B=sqrt(A)
C=sqrt(A)-1
[/QUOTE]
Yes, this is demonstrable formula.

And so is this --
A=((n*n)*98)/2
B=sqrt(A)
[B]Can you take a wild guess what B equals to?[/B]

We are trying to understand how much do you know (if anything at all)? :nick:

Godzilla 2019-01-18 16:20

[QUOTE=Batalov;506337]Yes, this is demonstrable formula.

And so is this --
A=((n*n)*98)/2
B=sqrt(A)
[B]Can you take a wild guess what B equals to?[/B]

We are trying to understand how much do you know (if anything at all)? :nick:[/QUOTE]

With number 98 B= n*7 ?

[B]--EDIT--[/B]

n=88

>>> ((88*88)*99)//2
383328
>>> ((383328**(1/2.0))//1)
619.0
>>>
619 is prime


and..I do not understand ...

CRGreathouse 2019-01-18 18:24

[QUOTE=Batalov;506337]Yes, this is demonstrable formula.

And so is this --
A=((n*n)*98)/2
B=sqrt(A)
[B]Can you take a wild guess what B equals to?[/B]

We are trying to understand how much do you know (if anything at all)? :nick:[/QUOTE]

[QUOTE=Godzilla;506340]With number 98 B= n*7 ?

[B]--EDIT--[/B]

n=88

>>> ((88*88)*99)//2
383328
>>> ((383328**(1/2.0))//1)
619.0
>>>
619 is prime


and..I do not understand ...[/QUOTE]

99 isn't 98.

retina 2019-01-18 18:46

[QUOTE=Godzilla;506310][CODE]
aa=1
ii=1
i2=0
GG=0
FF=0
VV =0
e = 0
AA=0
c = 1
a =3
bb=0
dd=0
I=1
II=1
III=1
i=1
i1=0
b=0
p=1
equTwo=0
equTwoo=0
equTwooo=0
mod=0
equ=0
moda=0
modaa=0
print('Helloword \n\n');
bb=input('Inserire numero: ')

while p<=bb:

equTwo= ((p*p)*99)//2
equTwoo=((equTwo**(1/2.0))//1)
equTwooo=equTwoo-1




print(' N= ---->' , p)
print(' FUNC= ---->' , equTwoo)
print(' Func-1=---->', equTwooo)



while I<=p:


I=I*1
I=I+1
if p==I :

print(' P is prime -----', p)
AA=AA+1
break

if p%I==0 :
break

while II<=equTwoo:


II=II*1
II=II+1
if equTwoo==II :

print(' Func is prime -----', equTwoo)
modaa=modaa+1
break

if equTwoo%II==0 :
break

while III<=equTwooo:


III=III*1
III=III+1
if equTwooo==III :

print(' FUNC-1 is prime -----', equTwooo)
moda=moda+1
break

if equTwooo%III==0 :
break



p=p+1
aa=aa+1
I=1
II=1
III=1




print('\n\n\nTOTALE NUMERI P TROVATI : ' , AA)
print('\n\n\nTOTALE NUMERI Func TROVATI : ',modaa)
print('\n\n\nTOTALE NUMERI FUNC-1 TROVATI : ',moda)

[/CODE][/QUOTE]This code is totally awesome :tu:

Such beautiful variable naming :tu:
Such consistent spacing and alignment :tu:
Such excellent and useful comments :tu:
Clearly so much effort expended to make it concise and easy to understand :tu:
The work of a code god :tu:
:bow:

/sarc :no:

Couldn't you at least try to make it [b]readable[/b]. Or even tell us what interpreter/language it is?

Godzilla 2019-01-18 19:21

@GRGreathouse could it be a new alghorithm?
@retina language is Python language, copy the code to a text file and save it with filename.py, open python and run it.

Batalov 2019-01-18 19:22

[QUOTE=Godzilla;506340]With number 98 B= n*7 ?

and..I do not understand ...[/QUOTE]
Ok, so you do understand some things. That is: squaring something and then taking a sqrt is a waste of time. But you [B]prefer [/B]to waste time (yours and others').

What is so difficult, then, in taking sqrt(99/2) ? It is a constant, if you take it with enough digits of precision you will be set for doing simply:
[C]B = floor(n * 7.03562363973514433184)
C = B - 1 [/C]
Your function is a line through numbers. Granted, its slope is ugly, but so what.
What makes you think that it will be better than most other functions to "generate primes"?

For comparsion:
[C]B = 2310*n+1
C = 2310*n-1[/C]
will generate more primes than "A=sqrt(((n*n)*99)/2)".
How do you arrive at your "wild and never before seen" "functions"?
Do you just randomly press some buttons?

Godzilla 2019-01-18 19:34

[QUOTE=Batalov;506357]Ok, so you do understand some things. That is: squaring something and then taking a sqrt is a waste of time. But you [B]prefer [/B]to waste time (yours and others').

What is so difficult, then, in taking sqrt(99/2) ? It is a constant, if you take it with enough digits of precision you will be set for doing simply:
[C]B = floor(n * 7.03562363973514433184)
C = B - 1 [/C]
Your function is a line through numbers. Granted, its slope is ugly, but so what.
What makes you think that it will be better than most other functions to "generate primes"?

For comparsion:
[C]B = 2310*n+1
C = 2310*n-1[/C]
will generate more primes than "A=sqrt(((n*n)*99)/2)".
How do you arrive at your "wild and never before seen" "functions"?
Do you just randomly press some buttons?[/QUOTE]

I try with small tests with the electronic calculator and pen and paper, and later with the computer, if I do not understand I ask.

retina 2019-01-18 19:47

[QUOTE=Godzilla;506356]@retina ... copy the code to a text file and save it with filename.py, open python and run it.[/QUOTE]With names like [u]equTwooo[/u] that ain't gonna happen. :no:

Mysticial 2019-01-18 22:04

1 Attachment(s)
[QUOTE=retina;506353]This code is totally awesome :tu:

Such beautiful variable naming :tu:
Such consistent spacing and alignment :tu:
Such excellent and useful comments :tu:
Clearly so much effort expended to make it concise and easy to understand :tu:
The work of a code god :tu:
:bow:

/sarc :no:

Couldn't you at least try to make it [b]readable[/b]. Or even tell us what interpreter/language it is?[/QUOTE]

Obligatory:

jrsousa2 2019-02-06 15:10

what a strange math forum this is. People are always bickering. and when you ask something serious, no response, but BS always get answers.


All times are UTC. The time now is 01:37.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.