Start up time program auto build long prime list from 2 to 5000011.
Build primeA6n[] list and build primeGap[] . Wait about 20 sec.
Prime number calculator a507291915 update 2016-10-08
Goldbach conjecture. integer to prime summation
Other prime web pages usage p[1]=2, p[2]=3, p[3]=5, p[4]=7 ...
freeman2.com/prime_e2.htm p[0]=2, p[1]=3, p[2]=5, p[3]=7 ...
because prime_e2.htm follow javascript index start from 0.
2016-08-29-07-29 record
prime_e2.htm index
program , Arndt , jsprime2.htm DocA , first upload 2016-08-06
XYGraph v2.3 - web page graph   ☜☞   donate   get code
Prime Counting Function Graph tute0058.htm#primeCountDraw click [A1]
Prime Counting >> Square Counting ; ∑(1/Sq.)=π*π/6 , ∑(1/prime)→∞
see proof at http://freeman2.com/tute0058.htm#docA403 to docA454
The Cauchy-Schwarz Master Class   J. Michael Steele   ★★★★★
Please use MSIE browser to read this file.
Program environment Acer computer Aspire 5750Z-4830.
MSIE 9.0 Version:9.0.8112.16421
This file is personal home work. No one
proofread. Cannot promise correctness.
If you suspect any view point wrong,
please ask a math expert near by.
Freeman 2009-06-19-10-46

Liu,Hsinhan is not a professional programmer and
not a mathematics major graduate. This page may
contain error or low efficiency code.

Liu,Hsinhan 劉鑫漢 2016-08-12-19-18



<a name=index>
Prime number calculator prime_e2.htm index
All document are in help click button or output top/bottom.

✚✚ Prime Gap Rules , Six n harmony rule = avoid_Prime3_cut rule
   Prime5 cut rule , include 7,11,13,17,19
✚✚ Consecutive Prime Gaps 20,14 allowed? or not allowed?
   input box and click button [Allowed?] , [prime5cut()]

✚✚ Bulk Harmony Rule checker allow gap sequence cross several lines.
    yellow input, BoxPGR output, [Allowed?] read one line gap sequence.
✚✚ Click RUN14 four buttons first, click RUN5 Build html table
   for prime gap mod(6)=0,2,4 and consecutive n count.
✚✚ [Build prime list] prime definition read user prime table
   define fake prime table see why squares cannot replace prime?

✚✚ output prime table, gap sequence, gap up/down sequence
   6*n+1 prime or 6*n-1 prime

✚✚ integer's prime multiplication factorization
   change 2200 to 2^3 * 5^2 * 11^1 or to 2*2*2*5*5*11
✚✚ set gap number, example gap=8, first pair is 89, 97
   list squeezed composite 90,91,92,93,94,95,96
✚✚ set gap number, example gap=8, first pair is 89, 97
   list squeezed middle 93,363,393,405,453,483,495,687, ...
✚✚ set gap number, example gap=12, first pair is 199,211
   list double prime pair 199,211; 211,223; 467,479; 509,521 ...
✚✚ set gap number, example gap=12, first pair is 199,211
   list double pair middle number 205,217,473,515,625 ...
✚✚ set gap number, example gap=8, first pair is 89, 97
   list squeezed composite + prime pair + outer two neighbor
✚✚ set Upper/Lower bound, output prime number and middle
   gap size is not considered. all prime in U/L bound listed

✚✚ gap sequence finder, input gap sequence 6,6,2 output all match primes
gap up/down finder, gap always >=2, gap up/down can be positive or negative

✚✚ [prime difference] that is prime gap. list in Box12
   [gap difference] that is gap up/down list. same list also in Box02
✚✚ Goldbach conjecture. integer's prime summation factorization change
   22 to 11+11=17+5=19+3 Box14 random input, U/L bounds sequence input

Goldbach conjecture all even>=6 = primeA+primeB
See http://freeman2.com/tute0068.htm#docA003
6n-1 type prime short as 0, 6n+1 as 1, prime 3 mark 3.
Even 42 has 4 6n+1 type, total 8 primes, other 4 be 6n-1
List those primes not enter Goldbach even decomposition
List Goldbach dropped primes in consecutive pieces
Each even list all primes and mark Goldbach_ok or no
given begin even,prime and end even, code find end prime
User set begin even, end even at U/L bounds set begin prime at green
box right to "Pave road auto " above example use prime 89 for begin (x,y)=(206,89)
Pave road auto ask user input even and prime; Pave road force ask user input nID,pID.
http://freeman2.com/gevmpri0.jpg and gevmpri1.jpg use only nID and pID.
Pave road auto answer not match gevmpri1.jpg end pID ; Pave Road Force ask user guide.
Above all goto Box14 under Box14 click green one line box to select.
and goto Box15 below Box15 click [Pave Road Force]
All document are in help click button or output top/bottom. 2016-10-08-10-08 here
✚✚ prime gap summary within primeArr[] defined range, gap=2 has 32463 count
   gap=4 has 32307 count ... gap=116, no match found ; gap=154, has 1 count
✚✚ Display Box17 primes are 6*n+1 prime or 6*n-1 prime. Output to Box18
   example [exV] , click [prime6n±1] Box18 output. See [prime6n±1 help]
✚✚ [6*n+1-1] integer Bgn/End, 6*n is integer. 6*n±1 is prime , If n has both 6*n±1
be prime, mark A. only 6*n+1=prime, mark B. only 6*n-1=prime, mark C. No prime D.
✚✚ Prime Modular N . Input integer/prime 11,12,13,14,15,16,17,18,19,20
   assign Modular=7, output 11 , 4 for 11%7=4 up to 20 , 6 for 20%7=6
✚✚ click [BPrCPr] build Six n Prime Table, drop even number
and drop multiple of three. Output html code to Box20. If short, display below Box20.

✚✚ prime counting function π(n) or pcf(n), standard mathematics term
   prime focus function pff('1000,2')=997,991 ; pff() used in prime_e2.htm
✚✚ illPrimeGap() read one prime between 5 and 19, output prime gap sequence
   which MUST be void by input prime. Create sample for testing [prime5cut()]
✚✚ Test function inIdUL() change input box string data to numbers
   Test function toComma() change from " 2 ; -4 ;; 2 ; " to "2,-4,2"
✚✚ Test function boundPrime(n) use fast code to search prime p just > n
   boundPrime(n) long jump to proper range and search prime, save time.
✚✚ [sumToBox] Goldbach conjecture 20=17+3 , 20=13+7 incremental summary
   work. Box75 has over all summary which is Box74 output last line result
✚✚ [mulToBox] do Integer prime multiplication factorization, 20=2^2 * 5^1
   prime incremental count (output Box74) and prime total count (output Box75).

✚✚ test function stringList_to_arrayList() Click [exW] fill example string to
   Box76, then click [str2arr] button, change string data to array data. Box77 output.
✚✚ show prime list in Box78
   show gap list in Box78
✚✚ [pr^HiPow] number or prime to higher power, 23^3 , fall in what kind
   neighborhood? any specialty? click [pr^HiPow] and think.
✚✚ sin(), cos(), exp() regular calculator. real number only, no complex. Auto change
   from 102=89+13 to 102-89-13 and evaluate to 0. Confirm 102=89+13 is OK.

✚✚ Prime Modular N , integer Modular N ,
   input sequential primes or input random order integers
✚✚ BPrime is 6*n+1 type prime, CPrime is 6*n-1 type prime
   [B:C] find B to C ratio; [0:2:4] find gap%6=0,2,4 ratio


<a name="program0">
Prime number calculator

Prime Gap Rules six n harmony rule visualization
Six n harmony rule = avoid_Prime3_cut rule.
6*n-1 prime cross n line, 6*n+1 prime cross n line in turn.
Prime has 6*n-1 and 6*n+1 two groups. Consecutive prime difference is prime gap.
Let p(k+1)-p(k)=g(k) Except prime 2 and 3, prime gap is always even number.
primeGap%6 has 0, 2, 4 three possible values.
primeGap%6=0 say p(k+1) and p(k) both be 6*n-1 or both be 6*n+1.
primeGap%6=2 say p(k) is 6*n-1 and p(k+1) is 6*n+1 . Example 17+2=19
17=6*3-1 , 19=6*3+1 . Gap 2,8,14,20 etc. must be from 6*n-1 to 6*n+1
primeGap%6=4 say p(k) is 6*n+1 and p(k+1) is 6*m-1 . Example 19+4=23
19=6*3+1 , 23=6*4-1 . Gap 4,10,16,22 etc. must be from 6*n+1 to 6*m-1
primeGap%6=2 gap follow primeGap%6=2 is forbidden.
primeGap%6=4 gap follow primeGap%6=4 is forbidden.
primeGap%6=2 gap follow primeGap%6=4 is allowed.
primeGap%6=4 gap follow primeGap%6=2 is allowed.
Gap 2,2 is not allowed, ONLY initial prime 3,5,7 has gap sequence 2,2 .
Gap 20,12,14 is not allowed, 12%6=0 is transparent, 20%6=2,14%6=2 forbidden.
Prime5 cut rule , include 7,11,13,17,19
Allowed gap sequence may be cut off by composite contain 5,7 etc.
Gap sequence 6,6,6,6 void by multiple of five, 6,6,6,6 never show up.
Gap 6,4,2,4,2,4 void by multiple of seven. 6,4,2,4,2,4 never show up.
Input your prime sequence in yellow box below.
Click [Allowed?] to test Six n harmony rule.
Click [prime5cut()] to test Prime5 cut rule.
Liu,Hsinhan 劉鑫漢 2016-08-16-23-25
p(k) is k-th prime. k in p(k) and n in 6*n-1 are independent. a508170626
oeis.org "p p+2 p+6 p+8 : A007530" is 2,4,2 in prime_e2.htm a508241428
Six n harmony rule is in fact avoid_Prime3_cut rule. 2016-08-24-16-02

<a name="bxPGR"> 2016-08-17-10-16 in prime_e2.htm use BoxPGR
Consecutive Prime Gaps 10,10 allowed? or not allowed? Please input and test.
Next yellow box INPUT Prime Consecutive Gaps , click Example buttons.
Example ,,,, ; ,,,, ; [,,,] six n harmony rule
yellow input, BoxPGR output        
Above six n harmony rule exam, below prime 5,7,11 cut exam are independent.
prime 5,7,11 cut RUN ☞ yellow box, blue box input, BoxPGR output
exam prime from prime 5 to prime expect a small prime for [prime5cut()]
BoxPGR  

yellowbox example , , , , ;  prime 5 to prime  
RUN ☞ yellow and pink box input, BoxPGR output
output long or short ? output short few 1
PGR=Prime Gap Rules ; QEboxcPGR.value='' ;

modsix024, short024, group024, ascend024 main goal is direction study. Prime has 6*n-1
and 6*n+1 two groups. Gap%6=2 must be from 6*n-1 to 6*n+1. Gap%6=4 must be
from 6*n+1 to 6*n-1. Gap%6=0 must be from 6*n-1 to 6*n-1 or from 6*n+1 to 6*n+1.
primeArr[] is 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ...
primeGap[] is 1,2,2,4,2,4,2,4,6,2,6,4,2,4,6,6,2,6,4,2,6,4,6,8,4,2,4,2,4 ...
modsix024[]=gap%6 . Mod(6) remainder has 0,2,4 three values. 0,2,4 are direction.
short024 change from modsix024[]=2,4,2,4,2,4,0,2,0,4,2,4,0,0,2,0,4,2,0,4, ...
to short024[]=26,01,21,01,43,02,21,01,42,01,41,01,28,01,23,02,41,02, ...
group024 change short024 to 0 group, 2 group, 4 group. (0,2,4 are direction)
ascend024 arrange 0 group, 2 group, 4 group in ascending order.
list024 read user input and list direction 0,2,4 to output box. Help user study.
2016-09-19-18-41 start, 2016-09-19-19-20 stop

six n harmony rule visualization. Ignore initial prime 2,3; ignore initial prime gap 1,2. All
gap%6=0 are transparent, gap sequence must be 2,4 in turn. Click [modsix024] see BoxPGA.
gap sequence direction data, output only 0,2,4 RUN ☞
see
BoxPGA   Yellow is one series calculation, green is another

QEboxcPGA.value='' ; Long prime gap sequence example or input your gap sequence
BoxPGA input RUN ☞ BoxPGB output

<a name="bxPGB"> click [modsix024 ], build modsix024[] array first.
Compact [modsix024] data, input from modsix024[] RUN ☞ output to BoxPGB
BoxPGB   short 26,01; drop pID ;

QEboxcPGB.value=''

<a name="bxPGC"> ; click [short024 ], build short024[] array first.
Separate [short024] data to 0,2,4 groups, RUN ☞ id=QEspangroup024
BoxPGC   ;

QEboxcPGC.value=''
Click RUN14 four buttons, then click RUN5 [list024] to build Primegap Modsix Short Table
QEspanPrimeCount.innerHTML='' ;
Click one by one RUN14 ☞ , , ,
QEspanascend024.innerHTML='' ;
list024 example RUN5 ☞ output to BoxPGD ; index
Prime gap modsix begin/end

BoxPGD   ; ask list024

QEboxcPGD.value='';
,



Build prime table
Box01:prime table; Box02:input integer; Box03:output factorized integer;
Box04:input integer factorization list, click [Prime counting] Box05:output summary
Box01   ; paste user prime list to Box01 or prime list

Build⇒ up to ,
in Box02 Show primeID , prime , gap , gap%6 , gapUp/Down , 6*n±1
Box02 data column ↕ to ↔ row change , RUN ☞
upper_lower bounds , default number 1 to 5001
Box02   ;

QAboxc02.value='' ; already merge to [Build prime list]


integer's prime factorization. 2200=2^3 * 5^2 * 11^1
[factorize integer pow] and [factorize integer mul] read input from Box03, output to Box04.
Work is integer's prime factorization. For example, [factorize integer pow] change from
composite 2200 to prime multiplication 2^3 * 5^2 * 11^1 . Button [factorize integer mul]
output to 2200=2*2*2*5*5*11 . Button [integer list] help you build continuous integers.
Box03   ; Integer ends output to Box03

example: , , , RUN ☞ ,
Box04 ; [factorize integer] Box03 input, Box04 output ; index

Box04 in Box05 out
Box05   QAboxc05.value=''

;

Assume Prime Upper/Lower bound has [2,2000], assume One prime gap has [8]
Click [squeezed number] output [2,2000] all prime gap=8 in-gap composite numbers.
Default input has first gap output 90,91,92,93,94,95,96 seven composite. Purpose
is to study squeezed composite their prime multiplication factorization has what
special point relate to 8 (gap size). a508181641
U/L bound box use comma [2,2000] mean 2 and 2000 are both integers.
U/L bound box use column [2:2000] mean 2 and 2000 are both primeID.
Initial primes are 2,3,5,7,11,13,17,19 ... ; primeID=pID=0,1,2,3,4,5,6,7 ...
This page use pID=0 for first prime 2. Some other page use pID=1 for prime 2.
prime pair squeezed integers, middle integer
Prime Upper/Lower bound06 One prime gap
Box06 ; yellow box input output to box06

Second [squeezed number] , near [squeezed middle] ;
[squeezed middle] input is box06, output to box07. If assign [8] to One prime gap box.
Click [squeezed number], box06 has squeezed composite numbers 90,91,92,93,94,95,96 .
MUST be odd count squeezed numbers. Click [squeezed middle] output to box07 93, 363,
393, 405, 453, 483, 495, ... They are all squeezed middle number. Program copy first
squeezed gap ALL numbers for reference. Start from second gap, copy only middle ONE
number. Purpose find whether squeezed middle has special point.
Click in output choice green box, allow you change middle to other chopice.
Output choice ,
Box07 [squeezed middle] alert here

QBboxc07.value='' ;




prime pair listed for given gap
[Double prime] read Upper/Lower bound and read prime gap value. Assume prime gap=12.
Output to Box08 all gap=12 prime to Box08. One line two primes. Each line prime pair
all have difference=12. Purpose is to identify gap=12 prime pairs within Upper/Lower bound.
Prime Upper/Lower bound08 One prime gap
Box08 ; yellow box input output to box08

Input from [Prime Upper/Lower bound08] and [One prime gap]
Output squeezed composite middle number. and output OUTSIDE-gap MIDDLE number.
Assume prime gap=12, prime pairs 199,211 and 211,223 and 467,479 all be gap=12 .
199,211 has middle=205 ; 211,223 has middle=217 ; 467,479 has middle=473 .
From 223 to 467 it has middle=345 . Box09 output in-gap middles 205,217,473
also record OUT-gap middles 211,345,494 etc. Purpose is to see if middle points
contain any secret? 2016-08-19-21-21 record
Box09

QBboxc09.value=''



prime pair + squeezed
[squeezed+prime] list [squeezed number] and its primes.
Assume Prime Upper/Lower bound10 box has [2,2000] , assume One prime gap box has 8.
click [squeezed+prime] Box10 output gap8 prime pair within 2,2000 . First gap8 prime pair
is 89,97 (97=89+8) Box10 output first section 88,89,90,91,92,93,94,95,96,97,98
This section include gap8 prime pair 89,97 those squeezed number 90,91,92,93,94,95,96
and outside number 88,98 . Purpose is to study whether squeezed+prime section has
common characters. For example, analysis [88,89,90,91,92,93,94,95,96,97,98] using
integer's prime multiplication factorization and integer's prime summation factorization

Prime Upper/Lower bound10 One prime gap
Box10 ; output to Box10 ; defined prime

[prime+middle] read Middle Upper/Lower bound10 box numbers 2,2000 (example).
output prime number and middle point of two neighbor primes within 2,2000 .
[middle] button output middle point only. Purpose is to study middle point.
[prime+middle] button and [middle] button output to box10.
Middle Upper/Lower bound10
; ; box goto 03 ;
QCboxc10.value='';



<a name=gapSequenceFinder>

gap sequence finder , up/down finder ; index
Find gap sequence and match prime last digit? go here
Box11 allow user input specific gap sequence and search in defined prime list.
Box12 allow user input two integers and list prime gap sequence in range.
prime 5,7,11,13 oeis.org say p=5 and 5,7,11,13 is "p p+2 p+6 p+8 : A007530"
prime 5,7,11,13 prime_e2 say gap is 2,4,2 that is "7-5, 11-7, 13-11"
If reader apply oeis.org data to prime_e2.htm pay attention to the difference.
Each line prime add one 6n±1 ? line end not add 6*n±1
Example admissible:,,,, ; never: ,,,, ; [,,,]
gap sequence
Box11 ; ; defined prime

upper/lower bounds , default 1 to 5001
gap_up/down
Example: ,,,,,,, ; ;
Box11 allow user input gap up/down sequence and search in defined prime list.
Box12 allow user input two integers and list gap up/down sequence in range.
gap = two consecutive prime difference. Greater - smaller prime, gap always >=0.
gap up/down = two consecutive gap difference. gap up/down can be >,=,< 0.
2016-08-23-11-10 cannon shock

QCboxc11.value='' ;






list prime gap = list prime difference
Prime list similar to distance, prime difference=gap similar to velocity,
gap difference similar to acceleration. Gap up/down variation is a topic.


Given two integers then click
program list prime gap, output to Box12. Click to see more data.
List all prime gaps output to Box12
Box12 ; Full range? How many primes defined ?

Given two integers then click
program list prime gap, output to Box12. Click to see more data.
List all gap differences output to Box12
Prime list similar to distance, prime difference=gap similar to velocity,
gap difference similar to acceleration. Gap up/down variation is a topic.

QCboxc12.value='' ;




2016-09-05-12-50 guess gap sequence 2,4,2,4 has finite count.
Because prime become far away gradually.
How to proof gap sequence 2,4,2,4 has finite count?
How to find gap sequence 2,4,2,4 total count?
One method is to study gap sequence 2,4,2,4 prime set dilute rate

Search gap sequence and match prime LAST digit.
[gapSeq & primEnd] help. Input format is [2,4,2 ; 1,3,7]
2,4,2 are gap sequence, semicolumn flag prime end digit begin.
1,3,7 are prime end digit. Example prime 11, 13, 17, 19 has
gap 2,4,2 and prime end digit 1,3,7. Purpose is to study why
gap sequence [2,4,2,4] must begin with prime end digit 1. If
gap sequence [2,4,2] and begin prime end digit 1 what number
void last prime? 2016-09-05-17-26 ; example ; ;
gap sequence ; prime last digit
green box input Box13 output
Box13 Integer output ; Box13 data column ↕ and ↔ row ,

upper.lower bounds , default number 1 to 5001
Box13 show jump set first prime pID , prime , 1/prime , jump , jump/prime
Above green box input Box13 output
[gapSeq diluteRate] help. Box13 default value jump/prime. Checkbox change default.
What is jump? If green box has [2,4,2,4 ; 1,3,7], click [gapSeq & primEnd], Box13 output
"11, 13, 17, 19, 23"; "101, 103, 107, 109, 113"; "1481, 1483, 1487, 1489, 1493"; etc.
First jump: 101-11=90, second jump: 1481-101=1380, third jump: 16061-1481=14580
Gap sequence "2,4,2,4" show up rare and rare (dilute rate). Guess (no proof) gap
sequence "2,4,2,4" has finite count. Because future gap become larger and larger.
Small size "2,4,2,4" cannot persist (guess, need proof). 2016-09-06-10-38
QDboxc13.value='' ;


<a name=Goldbach>
Goldbach conjecture

Box03 integer's prime multiplication factorization 22=2*11 ;
Box14 integer's prime summation factorization 22=11+11=17+5=19+3
German mathematician C. Goldbach (1690~1764) in his letter addressed
to Swiss mathematician L. Euler (1707~1783), Goldbach wrote:
Proposition (A) Every even integer ( ≥ 6 ) is the sum of two odd primes;
Proposition (B) Every odd integer ( ≥ 9 ) is the sum of three odd primes.
They were called Goldbach conjecture.
2016-06-19-09-47 Liu,Hsinhan access and 2016-06-25-15-55 copied
https://arxiv.org/ftp/math/papers/0309/0309103.pdf

Prime SUMMATION factorization random integer input to Box14 , output to Box15.
Box15 output even=primeA+primeB, if find 16=7+9, 9 is not a prime, Box15 not list.
If next Odd subtract box number end with ';', Box15 output "no match primes+0"
Odd number - odd prime= white box number end with ';' or not?
Integer to prime summation. Click [prime sum random] input Box14, output Box15.
or Click [prime sum seq.] input Integer upper/lower bounds silver box, output Box15.
Box14 Prime sum random input ; , Goldbach conjecture input

Two RUN buttons both do integer's prime summation factorization change 22 to 11+11=17+5=19+3
U/L bounds Silver box number end with ';' or not?
RUN ☞ read random integer from Box14, output to Box15.
RUN ☞   read silver box sequential input, output to Box15.
index
6*n±1 ? [Whitelane] output primeID
Green box decide what to do, click box to choose. checkbox for output pID or prime
Box15 Prime sum output [Detail], [Pave] debug? debug slow down.

RUN ☞ Next blue box input, Box15 output. index
Pave road force ,
Box14 or U/L bounds silver box input Box15 & 16 output
box goto 81 click [real number calculator] output to Box82. ,
Box16 debug How many primes defined ? ;

Example 370:241,251 370-241=129 or 370-251=119 a prime? composite?
[showComposite] input Box16, output Box16.
Box15 line "6=3+3" to Box81, [real number calculator] change to 6-3-3 answer 0 , mean OK.
QDboxc16.value=''; If U/L bounds silver box right end has ';', Box14 output even numbers only.
http://freeman2.com/gevmpri0.jpg is a Goldbach conjecture integer's prime summation factorization
graph. gevmpri0.jpg data can be compared with Box15 Prime sum output data. In U/L bounds [2,200]
enter 2,200. In 6*n±1 ? choose [24=11+5 6n-1,6m-1 ] then click [prime sum seq.] Output to Box15.
In 6*n±1 ? choose [42: 4/8 //4 6n+1, 8-4 6n-1 EVEN only] click [prime sum seq.] 2016-09-28-16-26




prime gap size and gap count
This file use primeArr[] to define prime list and use primeGap[] to define prime gaps.
gap(n)=prime(n+1)-prime(n). Within primeArr[] definition, there are how many size=2
gaps? how many size=4 gaps? ... What size gap not present? Click [gapSum] ,
output to Box17. Some gap sequence never show up, for example 2,8 is forbidden.
Click [gapHelp] read Box17. Read Prime Gap Rules find out why 2,8 is forbidden.
Please visit http://freeman2.com/prim6n01.htm Six n Prime Table from n=1 to 40000
This table give you evidence and convince you gap 2,8 is forbidden. a508232228

[gapSum] input is primeArr[] . Box01 click button [Build prime list] control.
[gapSum] button output to Box17 below. ,
Box17 output ; QDboxc17.value='' ;

<a name=a509130002>
Display Box17 primes are 6*n+1 prime or
6*n-1 prime. Output to Box18.

example , Box17 input Box18 output

6*n±1 each n neighbor one or two prime A,B,C,D list
Integer Bgn/End ;
Box18 output ; detail Y/N? No detail to Box18, faster.

BPrime is 6*n+1 type prime, CPrime is 6*n-1 type prime.
gap[n]=prime[n+1]-prime[n], gap=2,3,6,8,10 ... ; gap%6=0,2,4 Ratio
B:C sample , ; 0:2:4 sample ,
QDboxc18.value='' ;

Prime Modular N
2016-09-02-10-15 start
If integers a, b, m with m≠0. If (a-b)/m is a whole number. We say
"a is congruent to b modulo m", write as a≡b (mod m). In programming
C language, javascript style, write modular expression as 123%7 .
2016-08-31-21-27 Liu,Hsinhan ask "what is avoid_prime7_cut rule?"
Hope to study prime%7 pattern. Build [PrimModN silver] click button.
and [PrimModN box19] button. Allow study any integer modulo any m>1.
Box19 input example for [PrimModN box19]
151%7 or 151%23 ? Modular Box19 input Box19 output
Above Box19 input random order integers. Below silver box input sequential primes.
integer Bgn/End silver box input Box19 output
, Output choice output prime order
Box19 How many primes defined ?

QDboxc19.value='' ;

Six n Prime Table builder

Click button [BPrCPr] create Six n Prime Table. In [6*n±1, n Bgn/End] box specify n value
(not integer value) Click [BPrCPr], program output html table to Box20. If n range not
exceed 1000. Program display Six n Prime Table below Box20. If result satisfied, user can
copy Box20 html table and paste to other page.
[BPrCPr] mean BPrime,CPrime . Follow "List n value with A/B/C/D" Liu,Hsinhan consider
6*n+1 type prime be BPrime. consider 6*n-1 type prime be CPrime.
2016-08-25-11-52 document here ; index
I have two change to n value and save to green box below
I have two ; Show composite long/short 7^2 * 11^1
6*n±1, n Bgn/End , RUN ☞ output to Box20
Box20 Six n Prime Table input green box above, output to Box20

QDboxc20.value='' ;
Show composite long/short? Long output 7^2 * 11^1 it has more information
and bigger html table size. Short output 7^2 only and drop "* 11^1" it has
dominate factor 7^2 and thinner html table size. 2016-09-14-14-27 record
,






Box21 to Box49 is for graph, compatible with prime_e1.htm a508211751

Box21  

Box22

QEboxc21.value=''







Test functions
Prime counting function π(n) is an important function in prime study.
n is any natural number, π(100)=25 say from 0 to 100 there are 25 primes.
This file use pcf(arg1) for π(n). In yellow box below input an integer n and
click [pcf] Box71 output the prime count between 0 and n.
pcf(500)=95 mean there are 95 primes <= 500
π(n) = prime counting function
input an integer>2 RUN ☞
Both pcf and pff yellow box input, output to Box71
integer, +/- count RUN ☞ ,  ,
prime focus function pff('1000,2')=997,991 mean 2 primes below 1000 are 997,991
Negative in pff('1000, -25') ask output 25 primes greater than 1000.
From pcf(500)=95, in yellow box enter [500,95] click [pff()] get all primes below 500.
Box71 How many primes defined ?

QNboxc71.value='' ;

2016-08-25-15-40 document start
If input box has "prime 5" , this "prime" must be a string. this "5" is also a string.
String "1" add string "2" get string "12". Number 1 add number 2 get number 3.
function inIdUL() change input box string data to numbers.
Test function input Upper/Lower bounds , output Box72.

function illPrimeGap() read one prime between 5 and 19, output prime gap sequence
which MUST be void by input prime. Input 23 or greater is not supported.
Test function primeF Output gap sequence which void by primeF
Box72 ; ; alert come here , QNclickMsg.innerHTML

Test function input one integer Output Box72.
; ;
If a box ask user input a prime. Integer 45973 is a prime? or not? It is hard to guess.
function boundPrime() read input number and find nearest prime greater than or equal to
this input number. function boundPrime() use fast search. If user input 2382899, program
count 2382899 has seven digits, then start search from seven digit prime 1000003. Not
start search from 2. function boundPrime() spend shorter time to find answer.
function boundPrime() return primeID, not return prime itself. If primeID=20, prime=73.
2016-08-25-16-40 document stop ;
test function toComma()
copy yellow string numbers and paste to box above 2 ; -4 ; 2 ; 2 ; -4 ; 10 ; ; -8 ; 16 ; 2 ;
Box02 output has ';' , Box11 input need ',' function toComma() change ';' to ',' and del ' '.
Delete redundant comma, delete string end comma.
QNboxc72.value='' ;






<a name=incrementalKount>
If fill long number list to Box73 then click [sumToBox] it is a long long wait.
If click [IntegerList] with Ibounds=[2,200] program has much less number to work.

Box73 input integer for [sumToBox] , [mulToBox] ; index

Ibounds LightNavy box number end with ';' or not?
QNboxc73.value='' ;

Goldbach even decomposition prime count
2016-08-26-21-17 document start
Between Box14 and Box15 there are click buttons [prime sum random] and [prime sum seq]
Fill integer data to Box14, then click [prime sum random] Box15 has Goldbach conjecture
output, that is integer's prime summation factorization. First few output is next
2=2 ; 4=2+2 ; 6=3+3 ; 8=5+3 ; 10=7+3 , 10=5+5 ; 12=7+5 ; 14=11+3 , 14=7+7 ;
16=13+3 , 16=11+5 ; 18=13+5 , 18=11+7 ; 20=17+3 , 20=13+7 ; ...
No one even number missing from list, numerically
support Goldbach conjecture. (data is not a proof)

Box73 and Box74 do auxiliary work. Output the following
2: 1 //this line say: up to integer 2 , prime 2 has 1 count
4: 3 //this line say: up to integer 4 , prime 2 has 3 count
6: 3,2 //up to integer 6 , prime 2 has 3 count , prime 3 has 2 count
8: 3,3,1 //up to 8 , 2 has 3 count , 3 has 3 count , 5 has 1 count
10: 3,4,3,1 //10 , 2: 3 count , 3: 4 count , 5: 3 count , 7: 1 count
12: 3,4,4,2 //12 , 2: 3 count , 3: 4 count , 5: 4 count , 7: 2 count
14: 3,5,4,4,1 //14, 2:3 count,3:5 count,5:4 count,7:4 count,11:1 count
16: 3,6,5,4,2,1 //16, 2:3 cnt,3:6 cnt,5:5 cnt,7:4 cnt,11:2 cnt,13:1 cnt
18: 3,6,6,5,3,2 //18, 2:3 cnt,3:6 cnt,5:6 cnt,7:5 cnt,11:3 cnt,13:2 cnt
20: 3,7,6,6,3,3,1 //similarly, upto 20 all prime count summary
Integer 100 has "3,81,52,52,47...", mean prime2 count 3, prime3 count 81, prime5 count 52 ...
[sumToBox] do incremental summarize work and save result to Box74 and Box75.
Box75 has over all summary which is Box74 output last line result.
[sumSilent] build summary data but NO output. data ready for graph in prime_e1.htm
No output to save time. After [sumSilent] click [sumShow] display [sumSilent] result.
2016-08-26-21-52 document stop

[sumSilent] and [sumToBox] call function intPrimSumCnt(inArr)
function intPrimSumCnt(inArr) read next one line box and checkbox.
Odd number - odd prime= white box number end with ';' or not?
Output long? or short? Output incremental long table, slower.
Box73 input, if empty, Ibounds box input NO output to save time
Box73 input, if empty, Ibounds box input. Box74 Box75 output
Box74 output ; , if silent

Box73 input, if Box73 is empty, Ibounds box is input
[mulSilent], [mulToBox], [mulShow] parallel to [sumSilent], [sumToBox], [sumShow]
Prime multiplication count 123456=2^6 * 3^1 * 643^1
Ibounds box input NO output ; Box74 Box75 output
Box75 output ; , if silent

Box76 output How many primes defined ?

test function stringList_to_arrayList() Click fill example string to Box76 (input box).
click drop newline, change string data to array data. Box77 output.
example , keep newline
stringList_to_arrayList() output array data, when data enter Box77, array data
become string data. If output to other function, other function receive array data,
not string data. HTML box store only string.
Box77 output ; , QNboxc77.value='';



Box78 ; in Box78 ; in Box78


Box79

QNboxc79.value='' ;

2016-08-26-16-34 start
Prime 23 square 23^2=529, cubic 23^3=12167 they are not prime any more.
PrimeA's higher power their neighbor primes have any special point?
Out of curiosity, create next any prime box and [pr^HiPow] button.
any prime output to Box80. 2016-08-26-16-39 stop
Box80 output How many primes defined ?

Box79 input Box80 output
QNboxc80.value=''




Real number calculator ; ; index
Box81 click ex0,ex1,ex2,♫pID then click [real number calculator]

Box81 input Box82 output , , ,
Box82

Integer ends ; ,
QPboxc82.value='' ;
[=][=]




<a name="a506232350">
Prime Counting Function Graph tute0058.htm#primeCountDraw click [A1]
Prime Counting >> Square Counting ; ∑(1/Sq.)=π*π/6 , ∑(1/prime)→∞
see proof at http://freeman2.com/tute0058.htm#docA403 to docA454
http://freeman2.com/primcnt1.png
<a name="docA001">
2016-08-06-15-23 start 
First file http://freeman2.com/prime_e1.htm 
 this file http://freeman2.com/prime_e2.htm 
are both prime page. 
prime_e1.htm start up define prime upto    5003 
prime_e2.htm start up define prime upto 5000011
prime_e2.htm also define 
primeA6n[] prime=6*n-1 mark 0, prime=6*n+1 mark 1. 
primeGap[] record prime gap value. 

prime_e2.htm is copied from prime_e1.htm Both have 
similar input boxes and related click buttons. 
prime_e1.htm in/output boxes are crowded, one box 
has several functions. 
prime_e2.htm in/output boxes are rearranged, each 
box reduce function to one or two. a508291528
prime_e2.htm new add function is next.

<a name="docA002">
Box11 added 
gap sequence  ,

2016-07-30-19-45 use YTD download 
Proving the Riemann hypothesis
https://www.youtube.com/watch?v=eX_RT7fqPsg
https://www.youtube.com/watch?v=zATu8LB7C1c
https://www.youtube.com/watch?v=Bp9bAXxEID4
https://www.youtube.com/watch?v=IZn8UEQxZS0
https://www.youtube.com/watch?v=yFyda0KTf3Y
https://www.youtube.com/watch?v=QBUOIg7bqwk

<a name="docA003">
2016-07-31-13-22 watch 
07/30/2016  07:54 PM        29,963,067 
Proving the Riemann hypothesis 3 of 6 - Chebyshev And Random.mp4
2:10 say gap [8,6] [6,8] [8,4] [4,8] are allowed  
gap [8,2] [2,8] [8,8] [4,10] [10,4], [10,10] are 
NOT allowed. 
2:53 say gap [6,6,6] is allowed, but 
[6,6,6,6] is NOT allowed.
After watch these material, LiuHH build test code. 
Input  click  Box17 output 
no match. Exam over 348514 primes, from 2 to 5000011 .
[6,6,6,6] is NOT allowed, because prime5 must cut 
gap sequence [6,6,6,6]. Goto Box11, click  and 
read Box11 document. 

<a name="docA004">
Another new function added to prime_e2.htm is 
buttons above Box71 
integer, +/- count , , yellow box input, output to Box71
π(n) = prime counting function pcf(500)=95 mean there are 95 primes <= 500
prime focus function pff('1000,2')=997,991 mean 2 primes below 1000 are 997,991
Negative in pff('1000, -25') ask output 25 primes greater than 1000.
From pcf(500)=95, in yellow box enter click [pff()] get all primes below 500.
<a name="docA005">
2016-08-06-16-11 here 
prime counting function pcf(n)≡π(n) is a popular 
function. 
pcf(500)=95 mean there are 95 primes less equal to 
integer 500. 

prime focus function pff(n,c) focus≡n is a real 
number. c is a count integer. 

<a name="docA006">
Input '1000,2' to yellow box, click , 
pff('1000,2') output to Box71 two primes 997,991 
997,991 are two primes right below focus 1000.
Input '1000,0' attention ZERO, click , 
Box71 output two primes 1009,997, one above 1000, 
other one below 1000.
Input '1000,-5' attention NEGATIVE, click , 
Box71 output five primes 1009,1013,1019,1021,1031, 
all greater than 1000. 

prime_e2.htm will add new function in the future.
prime_e1.htm is about saturated.
Thank you for visiting freeman2.com 
Liu,Hsinhan 劉鑫漢 2016-08-06-16-27

<a name="docA007"> update 2016-08-30
2016-08-29-15-46 start 
On 2016-07-29 created prime_e2.htm
On 2016-08-06 first upload prime_e2.htm 
From 2016-08-06 to 2016-08-29 add new function 
and rearranged boxes. Main point is to reduce 
boxes functions, each box has one or two input 
or output. Another main change is all document 
written near function click button. Easier to 
read. Build index, allow reader view whole 
picture at once.
prime_e1.htm has graph code and drawing board.
prime_e2.htm deleted graph code to reduce size.

<a name="docA008">
Next is a small puzzle LiuHH found.
2016-07-14-20-10 use YTD download 
https://www.youtube.com/watch?v=pO7Egc5Dtqs

2016-08-27-09-27 watch 
Math Mornings at Yale_ The Patterns in the Primes, with Andrew Granville
video time 31.33 Formulas for primes say 
start from     5
5+6         = 11
5+6+6       = 17
5+6+6+6     = 23
5+6+6+6+6   = 29
all be primes. 
If reader have similar puzzle, why prime_e2.htm 
cannot find 5,11,17,23,29? because prime_e2.htm 
view 5,7,11,13,17,19,23,29 their gaps 
are   2,4,2,4,2,4,6  not 6,6,6,6 
prime_e2.htm do sequential exam, not do jump exam.
2016-08-29-16-08 stop

<a name="docA009">
2016-10-08-13-27 start 
update 2016-10-08 add more function than last 
update 2016-08-30. 
First improve code efficiency. 
At [factorize integer pow] and [factorize integer mul] 
in function factInteger(arg1,arg2) use code 
ubound=Math.sqrt(newNum); //a509082122
let [factorize integer] work faster. 

<a name="docA010">
Second improve code efficiency. Goldbach conjecture
[[
//hf mean the other HalF
hf=nb-primeArr[j0];
k1=boundPrime(hf) //a509091601
//a509091623 confirmed k1 replace k0 OK
]]
Code line a509091601 let [prime sum random] and 
[prime sum seq.] click button work faster. 

<a name="docA011">
All utility programs are listed under index
Most document are in help click button or in 
output text, either on top of output or below 
output. 

Liu,Hsinhan will write study notes 
http://freeman2.com/tute0068.htm
in which re-state the structure of prime_e2.htm

This file http://freeman2.com/prime_e2.htm 
may have error output. If LiuHH paid attention 
to it, LiuHH will correct in future update. 
Please use prime_e2.htm with caution. 
Liu,Hsinhan 劉鑫漢 2016-10-08-13-49


[=][=]

<a name=JavascriptIndex>
Javascript index
http://freeman2.com/jsindex2.htm   local
Save graph code to same folder as htm files.
http://freeman2.com/jsgraph2.js   local



Older Prime number and prime decomposition
http://freeman2.com/jsprime2.htm
jsprime2.htm first upload 2009-09-15

Goldbach conjecture data 6 to 1000
http://freeman2.com/tute0067.htm

Prime number study notes
http://freeman2.com/tute0068.htm

Six n Prime Table from n=1 to n=40000
http://freeman2.com/prim6n01.htm
ten table files .....
Six n Prime Table from n=360001 to n=400000
http://freeman2.com/prim6n10.htm

Prime number and prime decomposition (drawing board)
http://freeman2.com/prime_e1.htm
Chinese version 素數函數及整數之素數分解
http://freeman2.com/prime_c1.htm
prime_e1.htm first upload 2016-06-23

Prime number calculator
http://freeman2.com/prime_e2.htm
prime_e2.htm first upload 2016-08-06

Thank you for visiting Freeman's page. 
Freeman Liu,Hsinhan 劉鑫漢 2016-08-06-11-26

Please visit freeman2.com/jspico_e.htm
Please get prime list: http://freeman2.com/prime1m2.htm