Documentation ¶
Index ¶
- Constants
- Variables
- func AddSymbols(symbol1, symbol2 *int) int
- func AdjustTNumsForFilename(n *big.Int) string
- func AnalyzeCritSectByCSIDRange(fromID, toID *CritSectID, primesOnly, doAdd, details bool)
- func AnalyzeCritSectByTNumber(tTarget *big.Int, details bool)
- func AnalyzeTNumbersInteractive()
- func ArtIntToTNum(rNum, interval int) int
- func ArtTNumToInt(tNum, interval int) int
- func Basis29RangeTNum() (startTNum, endTNum int)
- func BasisToTNumRange(basis, returnHereBegin, returnHereEnd *big.Int)
- func BuildInflationMap(p *PrimeGTE31, n *big.Int)
- func ChangeFileExt(fName, newExt string) string
- func CheckTwinSextuplet(filename string, out *os.File)
- func Choose29BasisFile() (string, bool)
- func ClearSymbolCounts()
- func ConfigFilename() string
- func Configure()
- func CountClearTNumbers(fromTNum, toTNum, maxN *big.Int, detailed bool) []int
- func CritLen(csid *CritSectID, returnHereLen *big.Int)
- func CritLenForceGetN(p *PrimeGTE31, len, returnHereN *big.Int)
- func CrossingAtTNumCountingNumber(prime, tNum *big.Int) *big.Int
- func CrossingAtTNumExpandedCountingNumber(prime, tNumExpanded *big.Int) *big.Int
- func CrossingAtTNumExpandedMod(prime, tNumExpanded *big.Int) *big.Int
- func CrossingAtTNumMod(prime, tNum *big.Int) *big.Int
- func DisplayProgress(from, to int64, part int) func()
- func DisplayProgressBig(from, to *big.Int, part int64) func(*big.Int, *big.Int)
- func DisplayProgressBookend(msg string, isStarting bool) time.Time
- func Factorial(n int64) *big.Int
- func FileClose(f *os.File)
- func FileExists(name string) bool
- func FileOpen(p string, append bool) (*os.File, error)
- func GenCombinations(start, k, n int) []string
- func GenerateBasis()
- func GenerateBasis29(ctrl *GenPrimesStruct, f *os.File)
- func GenerateBasisInteractive()
- func GeneratePrimeTuplets(ctrl *GenPrimesStruct)
- func GeneratePrimeTupletsAutomated(auto *AutomationStruct) int
- func GeneratePrimeTupletsInteractive()
- func GeneratePrimes7to23()
- func GetCritLength(abs bool, p *PrimeGTE31, fixedN, n, returnHereLen *big.Int) error
- func GetCritLengthByDiff(abs bool, p *PrimeGTE31, N, diff, returnHereLen *big.Int) error
- func GetCrossNumMod(givenTNum, n *big.Int, p *PrimeGTE31, returnHereCrossNumMod *big.Int)
- func GetCrossNumModDirect(givenTNum, n *big.Int, p *PrimeGTE31, returnHereCrossNumMod *big.Int)
- func GetCrossNumModSimple(givenTNum, n *big.Int, p *PrimeGTE31, returnHereCrossNumMod *big.Int)
- func GetEffectDisplay(symbol int) string
- func GetEffectiveTNum(n *big.Int, p *PrimeGTE31, returnHereTNum *big.Int)
- func GetEffectiveTNumSimple(n *big.Int, p *PrimeGTE31, returnHereTNum *big.Int)
- func GetFileInfosFromFolder(path string) ([]os.FileInfo, error)
- func GetFilesInFolder(folder, ext string) ([]string, error)
- func GetFilter(filterType int) (pre, post uint)
- func GetFilter29(filterType int) (disallow, finalPass uint)
- func GetFilterAbbrev(filterType int) string
- func GetFilterDesc(filterType int) string
- func GetLocalPrimes()
- func GetNfromInt(rNum *big.Int, p *PrimeGTE31, returnedHereN *big.Int)
- func GetNfromIntComplicated(rNum *big.Int, p *PrimeGTE31, returnedHereN *big.Int)
- func GetNfromTNum(givenTNum *big.Int, p *PrimeGTE31, returnedHereN *big.Int)
- func GetNfromTNumComplicated(givenTNum *big.Int, p *PrimeGTE31, returnedHereN *big.Int)
- func GetSymbolDisplay(symbol int) string
- func GetSymbolEnglish(symbol int) string
- func GetSymbolString(symbol int, fullSymbol bool) string
- func GetTNum29Basis(tNum, basisnum *big.Int) *big.Int
- func GetUserBoolChoice(prompt, deflt string, result *bool) (canceled bool)
- func GetUserConfirmation(prompt, answer string) bool
- func GetUserInput(prompt, defaultTo, cancel string) (string, bool)
- func GetUserInputInteger(prompt, defaultTo, cancel string) (string, bool)
- func HelpOutputFiles()
- func HelpSymbols()
- func HelpSymbolsMath()
- func HumanReadable(tNum *big.Int, symbol *int, tNum29, notify *string, f *os.File)
- func InflatePrimeGTE31Position(prime *PrimeGTE31, idx int, n, returnHereOffset *big.Int) (effect int)
- func InitGTE31(prime *PrimeGTE31)
- func IntToBasisNum(anInt, returnHereBasisNum *big.Int) error
- func IntToTNum(rNum *big.Int) *big.Int
- func IsConfigured() bool
- func JuusTestReadChunk(file string, buf int)
- func NChooseK(n, k int64) int
- func ReadConfig()
- func ScanPrimeTuplets(auto *AutomationStruct) int
- func ShowCombos(n int)
- func ShowMe(choice int, p *PrimeGTE31, b *big.Int) error
- func ShowSymbolCounts(from, to *big.Int, filter int, f *os.File)
- func ShowSymbolFileDesignations(f *os.File)
- func ShowTwinSextupletResults(twins *string, f *os.File)
- func Slice2d(dx, dy int) [][]string
- func Slice3d(dx, dy, dz int) [][][]string
- func SymbolIsOfInterest(symbol int) bool
- func TNumLastNatNum(tNum *big.Int) *big.Int
- func TNumToBasisNum(tNum, returnHereBasisNum *big.Int) error
- func TNumToInt(tNum *big.Int) *big.Int
- type ArtControl
- type ArtPrime
- type AutomationStruct
- type CritSectID
- func (id *CritSectID) Add(csID *CritSectID)
- func (id *CritSectID) AsString() string
- func (id *CritSectID) Compare(csID *CritSectID) int
- func (id *CritSectID) GetTNumberRange(from, to, L *big.Int)
- func (id *CritSectID) ID2Int() *big.Int
- func (id *CritSectID) Increment(value int) error
- func (id *CritSectID) SetFromID(csID *CritSectID) error
- func (id *CritSectID) SetFromInt(value *big.Int) error
- func (id *CritSectID) SetFromString(value string) error
- func (id *CritSectID) SetFromTNumber(tNumber *big.Int)
- func (id *CritSectID) String() string
- func (id *CritSectID) Subtract(csID *CritSectID) error
- type GenPrimesStruct
- type PrimeGTE31
- func (prime *PrimeGTE31) DisplayFullCritLengths(fixedN *big.Int)
- func (prime *PrimeGTE31) GetCritLength(abs bool, fixedN, n, returnHereLen *big.Int) error
- func (prime *PrimeGTE31) GetCritLengthByDiff(abs bool, N, diff, returnHereLen *big.Int) error
- func (prime *PrimeGTE31) GetQbyReverseInflation(n, offset, returnHereQ *big.Int) error
- func (prime *PrimeGTE31) GetResultAtCrossNum(addResult *int, offset, n *big.Int) bool
- func (prime *PrimeGTE31) GetResultAtCrossNumByReverseInflation(addResult *int, offset, n *big.Int) bool
- func (prime *PrimeGTE31) InflateCrossingNum(crossNum int, n, returnHereInflated *big.Int) int
- func (p *PrimeGTE31) MemberAtN(n, returnMember *big.Int)
- func (prime *PrimeGTE31) ShowDetails(withPausing bool)
- func (prime *PrimeGTE31) String() string
- func (prime *PrimeGTE31) SubN() int64
- type PrimeGTE31InflationModel
- type PrimeHelper
- type PrimeIF
- type PrimeLTE29
Constants ¶
const ( CSextuplet = iota CLQuint29 CRQuint13 CQuad CXNoTrack CX17 CX19 CX23 CX25 )
the integer representation of the Tuplet symbols
const ( //Basis29PathStr const defining a string for Basis29Path Basis29PathStr = "Basis29Path" //DataPathStr const defining a string for DataPath DataPathStr = "DataPath" )
const (
Basis29Msg = `` /* 516-byte string literal not displayed */
)
some large string constants for printing into various information files
Variables ¶
var ( //SymbolCount : map to hold accumulated symbols SymbolCount map[int]int //FilterMap : map to hold filtering choices FilterMap = map[int]uint{ CSextuplet: filterSextuplet, CLQuint29: filterLQuint29, CRQuint13: filterRQuint13, CQuad: filterQuad, CXNoTrack: filterXNoTrack, } )
var ( //Basis29Path : string to hold configuration path to 29basis files Basis29Path string //DataPath : string to hold configuration path to write tuplet files DataPath string )
var (
AllowHugeCombos bool
)
var ( //TemplateLength : This a constant used a lot in big.Int calcs, it is the length of a Template (30) TemplateLength *big.Int )
Functions ¶
func AddSymbols ¶
AddSymbols : Return the "addition" of effects that determine whether the two symbols add to a significant result
func AdjustTNumsForFilename ¶
AdjustTNumsForFilename : used to keep filename lengths under control, if the incoming TNumber or basis (n) is bigger than 9999999999999999999999999999999 it returns an md5 hash, otherwise returns the string representation of the incoming number
func AnalyzeCritSectByCSIDRange ¶ added in v1.2.0
func AnalyzeCritSectByCSIDRange(fromID, toID *CritSectID, primesOnly, doAdd, details bool)
AnalyzeCritSectByCSIDRange : Given a from and to CritSectID will analyze in detail all TNumbers in that (inclusive) range, be aware this can be a LOT of information, details shows very detailed information, primesOnly will reject non-Prime pP's and lump together until the next Prime pP, doAdd assumes the "toID" is to be added to the "fromID" instead of being a static toID, this always prints a summary and will print a ".B." represenation where "." is a critical section where there are clear channels, and "B" is a critical section that is "black", i.e., no clear channels
func AnalyzeCritSectByTNumber ¶ added in v1.2.0
AnalyzeCritSectByTNumber : Given a TNumber will analyze its parent CritSectID for clear channels and/or sextuplets, details shows a lot of information, the calculated crit length will be inclusive, caller be aware: the "to" var here is processed as LTE(<=)
func AnalyzeTNumbersInteractive ¶ added in v1.1.0
func AnalyzeTNumbersInteractive()
AnalyzeTNumbersInteractive : interactive full analysis of any TNumbers you like >= 32, =careful= large TNumbers could take a while and can produce LOTS of output.
func ArtIntToTNum ¶ added in v1.2.0
IntToTNum : given any integer return the TemplateNum where it will be found. Key function for this package.
func ArtTNumToInt ¶ added in v1.2.0
func Basis29RangeTNum ¶
func Basis29RangeTNum() (startTNum, endTNum int)
Basis29RangeTNum : func that returns the start/end values, in TNumbers, of a 29Basis range, not used, primarily here so that an interested person can see how they were determined, The pattern then begins again and repeats to infinity
func BasisToTNumRange ¶
BasisToTNumRange : basis is 0 based, results are set directly to passed in param pointers, results are the beginning and ending TNumbers for the specified basis
func BuildInflationMap ¶ added in v1.2.0
func BuildInflationMap(p *PrimeGTE31, n *big.Int)
BuildInflationMap : Builds, from first principles, the inflated structure for p at n by repeadedly adding the values, essentially equivalent to doing the inflation by hand, used primarily as a check to other inflation routines
func ChangeFileExt ¶
ChangeFileExt : change the extension of fName to newExt
func CheckTwinSextuplet ¶ added in v1.0.1
CheckTwinSextuplet : testing, check rawdata files for twin Sextuplets, can also serve as template for other quick tests one wants.
func Choose29BasisFile ¶
Choose29BasisFile : Routine that prepares a list of 29basis files from the Basis29Path and presents them to the user.
func ClearSymbolCounts ¶
func ClearSymbolCounts()
ClearSymbolCounts : Clears the SymbolCount map which is used to accumulate results
func ConfigFilename ¶
func ConfigFilename() string
ConfigFilename : return the expected path of the config file, executable name + ".config", dev environment writes jup.config to HOME
func Configure ¶
func Configure()
Configure : should be called at least once or routines will have to default to HOME folder for writing/reading data, the answers will be written to config file, for now simple setup instead of full blown ini file
func CountClearTNumbers ¶ added in v1.2.0
CountClearTNumbers : fromTNum/toTNum are inclusive, detailed gives a lot of output, returned []int has 3 rows: Sextuplet, Clear, and total counts, this func tests each TNumber to see if it has a clear channel, if so adds to sextuplet total if a true sextuplet, otherwise goes into "unused" clear channels, caller be aware - - toTNum is processed as LTE (<=) since it is inclusive
func CritLen ¶ added in v1.2.0
func CritLen(csid *CritSectID, returnHereLen *big.Int)
CritLen : get the true critical length (between families), length is returned in the return param, also see CritLenForceGetN()
func CritLenForceGetN ¶ added in v1.2.0
func CritLenForceGetN(p *PrimeGTE31, len, returnHereN *big.Int)
CritLenForceGetN : complement to CritLen(), given a length (in TNumbers) returns in the return param the n needed to get as close as possible to the provided given length, e.g., given the length of the 29Baseis (215656441) returns the n where the prime's critical length begins exceeding a complete Basis
func CrossingAtTNumCountingNumber ¶
CrossingAtTNumCountingNumber : Given the Prime and TemplateNum, return the crossing number in Counting number format (starting at 1), only for humans preferring counting numbers rather than mod results, do not use in calculations!
func CrossingAtTNumExpandedCountingNumber ¶
CrossingAtTNumExpandedCountingNumber : Given the Prime and TemplateNum expanded to int, return the crossing number in Counting number format (starting at 1), only for humans preferring counting numbers rather than mod results, do not use in calculations!
func CrossingAtTNumExpandedMod ¶
CrossingAtTNumExpandedMod : Given the Prime and a TemplateNum expanded to number line integer, return the crossing number in mod format (starting at 0), Key function for this package
func CrossingAtTNumMod ¶
CrossingAtTNumMod : Given the Prime and TemplateNum return the crossing number, Key function for this package, "prime" is not necessarily a prime #, but a potentially prime #
func DisplayProgress ¶
DisplayProgress : from and to are usually ranges of TNumbers, but it depends on what you want to measure, part is how fine to divide the notifications: for example, 20 will partition it into 5% blocks, 100 into 1% blocks, this is setup as a closure func, its virtue is being able to accurately measure progress even when the index vs TNum do not match, ie. "jerky" progress, primarily used when generating "small" int/int64 compatible ranges, see also DisplayProgressBig
func DisplayProgressBig ¶
DisplayProgressBig : closure for displaying progress for data where the range is not evenly, ie. 1 to 1, probed, for example, a range from 234 to 2345 which is actually indexed randomly in that range, used when processing GTE 31's against the Basis29 file, works for huge numbers
func DisplayProgressBookend ¶
DisplayProgressBookend : Display the msg, isStarting is true for the first call (a header) and false for the end call (a footer), it returns a Time, meant to be used to wrap DisplayProgress
func FileClose ¶
FileClose : close a file previously opened with FileOpen with error checking, usually called with defer
func FileExists ¶
FileExists : Returns true if file or directory (?) exists
func FileOpen ¶
FileOpen : wrapper for opening files, if append is true the file is opened for reading/writing/appending, if false the file is created or overwritten
func GenCombinations ¶ added in v1.2.0
GenCombinations : returns slice of strings containing all combinations of (n choose k) with all possible k values.
func GenerateBasis ¶
func GenerateBasis()
GenerateBasis : the default and recommended 29 basis file generation routine for new/inexperienced users
func GenerateBasis29 ¶
func GenerateBasis29(ctrl *GenPrimesStruct, f *os.File)
GenerateBasis29 : The engine func that generates 29Basis files, it can be called with a GenPrimesStruct already filled in if you are comfortable with that, otherwise recommended to use GenerateBasisInteractive()
func GenerateBasisInteractive ¶
func GenerateBasisInteractive()
GenerateBasisInteractive : Interactive func to take user input and generate 29Basis files, generally one only needs the "no filter" version, but one is allowed to choose other varieties, recommended to always use default ranges unless you are completely comfortable with juusprimes and filtering
func GeneratePrimeTuplets ¶
func GeneratePrimeTuplets(ctrl *GenPrimesStruct)
GeneratePrimeTuplets : The engine func that generates juusprime Tuplets, it can be called with a GenPrimesStruct already filled in if you are comfortable with that, otherwise recommended to use GeneratePrimeTupletsInteractive
func GeneratePrimeTupletsAutomated ¶ added in v1.0.1
func GeneratePrimeTupletsAutomated(auto *AutomationStruct) int
GeneratePrimeTupletsAutomated : For use with automation through code or shell scripts, etc. Pass in a filled automation structure.
func GeneratePrimeTupletsInteractive ¶
func GeneratePrimeTupletsInteractive()
GeneratePrimeTupletsInteractive : The user interactive func to begin the generation of juusprimes
func GeneratePrimes7to23 ¶
func GeneratePrimes7to23()
GeneratePrimes7to23 : Trivial output, but important as sanity check that the routines give back the correct effects, The primes 7 to 23 cannot be generated using the general methods I've written, this func prints them out for completeness, but they are not for use in any further routines or analysis
func GetCritLength ¶ added in v1.1.0
func GetCritLength(abs bool, p *PrimeGTE31, fixedN, n, returnHereLen *big.Int) error
GetCritLength : deprecated, moved to PrimeGTE31 method, given fixedN (a chosen, fixed n level), and n the n-level you want to compare to, calculate the number of Templates between them, prime is a *PrimeGTE31, and abs flag is whether to return the absolute value, result is returned in last parameter
func GetCritLengthByDiff ¶ added in v1.1.0
func GetCritLengthByDiff(abs bool, p *PrimeGTE31, N, diff, returnHereLen *big.Int) error
GetCritLengthByDiff : deprecated, moved to PrimeGTE31 method, return the total number of Templates for potPrime p between fromN and toN, toN can be less than fromN, if abs is true return the length's absolute value, result returned in last param,
func GetCrossNumMod ¶
func GetCrossNumMod(givenTNum, n *big.Int, p *PrimeGTE31, returnHereCrossNumMod *big.Int)
GetCrossNumMod : returns in pointer param the offset (crossing number) for the GTE 31 Prime at level n at the specified given target TNumber, NOTE - After the release I realized that this function is very poorly named and misleading, It does NOT return a crossing number, it returns the relative offset of givenTNum into the prime's Natural Progression. Renaming the function would require a major version number change because it would break existing code, this is the original CrossNumMod function built using TNumber mod algorithms, also see the newer GetCrossNumModDirect or GetCrossNumModSimple funcs which are simpler and faster, This DOES NOT return errors if you send in too small a TNumber because this routine is used very often in loops, caller needs to validate the TNumbers submitted are >= the p's startTemplateNumber
func GetCrossNumModDirect ¶ added in v1.1.0
func GetCrossNumModDirect(givenTNum, n *big.Int, p *PrimeGTE31, returnHereCrossNumMod *big.Int)
GetCrossNumModDirect : An alternative to GetCrossNumMod original, it uses a direct "mod" operation which then adjusts back to TNumbers crossing, basically "unwrapping" the expansions, result is returned in parameter, A bit less calculation and requires no floor function since effectiveTNum is not required, also see GetCrossNumModSimple, This DOES NOT return errors if you send in too small a TNumber because this routine is used very often in loops, caller needs to validate the TNumbers submitted are >= the p's startTemplateNumber
func GetCrossNumModSimple ¶ added in v1.2.0
func GetCrossNumModSimple(givenTNum, n *big.Int, p *PrimeGTE31, returnHereCrossNumMod *big.Int)
GetCrossNumModSimple : Another alternative to GetCrossNumMod original, but even slightly faster, found by inspection rather than derivation, also see GetCrossNumModDirect, This DOES NOT return errors if you send in too small a TNumber because this routine is used very often in loops, caller needs to validate the TNumbers submitted are >= the p's startTemplateNumber
func GetEffectDisplay ¶
GetEffectDisplay : Return a user friendly string for symbol. used where only the effect is shown.
func GetEffectiveTNum ¶
func GetEffectiveTNum(n *big.Int, p *PrimeGTE31, returnHereTNum *big.Int)
GetEffectiveTNum : "effective" TNumber is the TNumber where the square of the potential prime (p) resides, ie. where it begins its effect on the following TNumbers. It is the Start Template Number for the calculated potential GTE 31 primes
func GetEffectiveTNumSimple ¶
func GetEffectiveTNumSimple(n *big.Int, p *PrimeGTE31, returnHereTNum *big.Int)
GetEffectiveTNumSimple : lighter alternative to GetEffectiveTNum: see note in GetEffectiveTNum
func GetFileInfosFromFolder ¶
GetFileInfosFromFolder : a func that gets a list of all files in given path
func GetFilesInFolder ¶ added in v1.2.0
GetFilesInFolder : Given a folder return slice of files in folder
func GetFilter29 ¶
GetFilter29 : Returns the disallow & finalPass filters for routines working with LTE 29 Primes
func GetFilterAbbrev ¶
GetFilterAbbrev : abbreviation for filter types, usually used in file names
func GetFilterDesc ¶
GetFilterDesc : Human readable description for filter types, usually used in information and messages to the user
func GetLocalPrimes ¶ added in v1.2.0
func GetLocalPrimes()
GetLocalPrimes : helper for analysis routines, initializes the p## *PrimeGTE31 variables for direct use, can be called any number of times
func GetNfromInt ¶
func GetNfromInt(rNum *big.Int, p *PrimeGTE31, returnedHereN *big.Int)
GetNfromInt : the compliment to GetNfromTNum where an Int (regular number line value) is used, rather than an already known Template Number. rNum is a "real" number, ie. a number line integer, not a Template Number, p is is a potential prime of type PrimeGTE31
func GetNfromIntComplicated ¶
func GetNfromIntComplicated(rNum *big.Int, p *PrimeGTE31, returnedHereN *big.Int)
GetNfromIntComplicated : the compliment to GetNfromTNumComplicated where an Int (regular number line value) is used, rather than an already known Template Number. rNum is a "real" number, ie. a number line integer, not a Template Number. p is a PrimeGTE31
func GetNfromTNum ¶
func GetNfromTNum(givenTNum *big.Int, p *PrimeGTE31, returnedHereN *big.Int)
GetNfromTNum : Given a TNum and a PrimeGTE31 the n value, ie how many potential primes must be tested to complete the calculation, Validation that givenTNum is equal to or greater than p's effective start TNumber is the responsibility of the calling func(), This is later derived algebraic equation that turns out to be far simpler and just as accurate, The first equation was quite complicated, see GetNfromTNumComplicated, result is returned in param and in p.Helper.MaxN
func GetNfromTNumComplicated ¶
func GetNfromTNumComplicated(givenTNum *big.Int, p *PrimeGTE31, returnedHereN *big.Int)
GetNfromTNumComplicated : Given a TNum & PrimeGTE31 return the the n value, ie. how many potential primes must be tested, Validation that givenTNum is equal to or greater than p's effective start TNumber is the responsibility of the calling func(), to complete the calculation. This comes from the first derivation of the formula and is complicated in many ways (lots of roots), a simpler form was found, see GetNfromTNum, result is returned in param and in p.Helper.MaxN
func GetSymbolDisplay ¶
GetSymbolDisplay : Return a user friendly string for symbol, used where Symbol is displayed either screen or file.
func GetSymbolEnglish ¶ added in v1.2.0
GetSymbolEnglish : Return the english phrase for the symbol, used where Symbol is displayed either screen or file.
func GetSymbolString ¶
GetSymbolString : Similar to GetSymbolDisplay. Return a user friendly string for symbol, with the addition of a less busy string for Sextuplets which is used if fullSymbol is false
func GetUserBoolChoice ¶ added in v1.2.0
GetUserBoolChoice : wraps GetUserInput to allow various true values
func GetUserConfirmation ¶
GetUserConfirmation : basic confirmation "dialog"
func GetUserInput ¶
GetUserInput : Good for basic input, returns the string the User enters. The calling func must deal with type verification
func GetUserInputInteger ¶
GetUserInputInteger : Get input and validate that answer is a Number. Loops forever unless canceled.
func HelpOutputFiles ¶
func HelpOutputFiles()
HelpOutputFiles : func that returns juusprime file information to stdout
func HelpSymbols ¶
func HelpSymbols()
HelpSymbols : Display the explanation and symbols used for Tuplets
func HumanReadable ¶
HumanReadable : Output to f a neatly packaged human readable format of the found Tuplet's details, Using this one can translate a .rawdata file by sending in the Tnumber and the effect integer, tNum29 is the corresponding TNumber from the 29Basis file and must be calculated, and notify is any message that needs to be communicate, generally used to inform in the pretty file that a basis number change occurred, currently it does check using ProbablyPrime if the found primes are probably prime, pretty much useless since they must be! But at higher numbers it is worthwhile because it would show in the pretty data if an erroneous result (false negative) has ever been seen.
func InflatePrimeGTE31Position ¶ added in v1.2.0
func InflatePrimeGTE31Position(prime *PrimeGTE31, idx int, n, returnHereOffset *big.Int) (effect int)
InflatePrimeGTE31Position : Given any idx <= prime.value-1 use n to calculate its expanded position. This is similar to the Lookup Table where c + qn is used, but this can be for any position in the prime's cycle using the CQModel slice, used for analysis, offset result returned in parameter, effect at that pos in result
func InitGTE31 ¶
func InitGTE31(prime *PrimeGTE31)
InitGTE31 : fill in the appropriate data for the particular GTE 31 prime, in essence these are "constants" associated with that GTE 31 prime, they can be calculated with pen and paper
func IntToBasisNum ¶
IntToBasisNum : Given an integer, return the basis Number it will be found in to the passed in pointer param
func IntToTNum ¶
IntToTNum : given any integer return the TemplateNum where it will be found. Key function for this package.
func IsConfigured ¶
func IsConfigured() bool
IsConfigured : check to see if config/paths have been setup, if false is returned then recommended to run Configure()
func JuusTestReadChunk ¶ added in v1.2.0
func ScanPrimeTuplets ¶ added in v1.2.0
func ScanPrimeTuplets(auto *AutomationStruct) int
ScanPrimeTuplets : SLOW, EXPERIMENTAL For use with SCAN automation through code or shell scripts, etc, uses big.Probablyprime to pre-qualify tuplets for further investigation, useful for large basis Numbers, Pass in a filled automation structure
func ShowMe ¶
func ShowMe(choice int, p *PrimeGTE31, b *big.Int) error
ShowMe : testing and internal use, good to use when you want to see unexported variable results without a lot of bother
func ShowSymbolCounts ¶
ShowSymbolCounts : Print out the SymbolCount map accumulated results
func ShowSymbolFileDesignations ¶
ShowSymbolFileDesignations : a routine that assembles the pieces that are printed to the info file so people can understand the symbol strings in file names
func ShowTwinSextupletResults ¶ added in v1.0.1
ShowSymbolCounts : Print out the SymbolCount map accumulated results
func SymbolIsOfInterest ¶
SymbolIsOfInterest : basic filtering func, rejects any thing that is not a Tuple, only used in GeneratePrimes7to23()
func TNumLastNatNum ¶
TNumLastNatNum : helper func that calculates the last natural number in a TNumber range
func TNumToBasisNum ¶
TNumToBasisNum : Given a TNumber, return the basis Number it will be found in to the passed pointer param
Types ¶
type ArtControl ¶ added in v1.2.0
TODO:
func NewArtControl ¶ added in v1.2.0
func NewArtControl(interval int) *ArtControl
type ArtPrime ¶ added in v1.2.0
func NewArtPrime ¶ added in v1.2.0
type AutomationStruct ¶ added in v1.0.1
type AutomationStruct struct {
BasisFile, OutputPath string
FromBasisNum, ToBasisNum string
Filter int
}
AutomationStruct : used to pass automation params into automation routines
func GetNewAutomationStructure ¶ added in v1.0.1
func GetNewAutomationStructure() *AutomationStruct
GetNewAutomationStructure : return a pointer to an AutomationStruct
type CritSectID ¶ added in v1.2.0
type CritSectID struct { N *big.Int //actually relates to the idx, 0-7, of the 8 pP familes //but for traversing true crit sects a "sub"N more sense SubN int64 }
CritSectID : abbrev csID, Unique identifier for each Critical Section in format "n:subN", N is the usual n, subN is an index from 0 to 7 corresponding with the 8 potPrimes 31 to 59, while there are associated "math" routines the CS ID's have no 0 or negative value, ie., 0:0 is equivalent to 1 and stands for n=0, pP=31
func NewCritSectID ¶ added in v1.2.0
func NewCritSectID(n *big.Int, p *PrimeGTE31) *CritSectID
NewCritSectID : returns a pointer to a CritSectID struct, n >= 0, p is any PrimeGTE31, each of which have a constant "subN"
func (*CritSectID) Add ¶ added in v1.2.0
func (id *CritSectID) Add(csID *CritSectID)
Add : adds csID to id
func (*CritSectID) AsString ¶ added in v1.2.0
func (id *CritSectID) AsString() string
AsString : central func to return a string representation of the CritSectID
func (*CritSectID) Compare ¶ added in v1.2.0
func (id *CritSectID) Compare(csID *CritSectID) int
Compare : compares id with csID, returns -1 if <, 0 if =, +1 if greater
func (*CritSectID) GetTNumberRange ¶ added in v1.2.0
func (id *CritSectID) GetTNumberRange(from, to, L *big.Int)
GetTNumberRange : generally analysis use only, returns in params the corresponding from/to TNumber and its (inclusive) length (L)
func (*CritSectID) ID2Int ¶ added in v1.2.0
func (id *CritSectID) ID2Int() *big.Int
ID2Int : This gives back the integer representation of the csID allowing a unique integer for each csID, also math can be used and a csID can then be set from an the resulting integer, see SetFromInt
func (*CritSectID) Increment ¶ added in v1.2.0
func (id *CritSectID) Increment(value int) error
Increment : increments the csID by value, value must >= 0
func (*CritSectID) SetFromID ¶ added in v1.2.0
func (id *CritSectID) SetFromID(csID *CritSectID) error
SetFromID : Sets, copies, the id's values to those of csID
func (*CritSectID) SetFromInt ¶ added in v1.2.0
func (id *CritSectID) SetFromInt(value *big.Int) error
SetFromInt : Set the csID by an integer value, value is a corresponding integer of any csID, obtain it with ID2Int()
func (*CritSectID) SetFromString ¶ added in v1.2.0
func (id *CritSectID) SetFromString(value string) error
SetFromString : sets id's vars from a string representation of format "n:subN", eg. 0:0, 123:7, n >=0, subN is 0-7, only returns error if an invalid format otherwise adjusts to valid values
func (*CritSectID) SetFromTNumber ¶ added in v1.2.0
func (id *CritSectID) SetFromTNumber(tNumber *big.Int)
SetFromTNumber : Sets id's vars to the appropriate values based on tNumber
func (*CritSectID) String ¶ added in v1.2.0
func (id *CritSectID) String() string
Stringer for CritSectID
func (*CritSectID) Subtract ¶ added in v1.2.0
func (id *CritSectID) Subtract(csID *CritSectID) error
Subtract : subtracts csID from id, csID's have no 0, if the subtraction results in 0 or less id is set to 0:0 (equiv to 1), caller is reponsible to compare and only subtract if csID is < id
type GenPrimesStruct ¶
type GenPrimesStruct struct { BasisNum *big.Int DefaultPath string FilterType int From *big.Int FullPathto29RawFile string //only used for GTE 31s To *big.Int OpMode int // contains filtered or unexported fields }
GenPrimesStruct : A structure that can be filled in to control prime generation (both LTE 29's and GTE 31's, though the usage is slightly different), for GTE 31's it will call its Prepare() method which adjusts parameters based on OpMode and returns a proper filename
func NewGenPrimesStruct ¶
func NewGenPrimesStruct() *GenPrimesStruct
NewGenPrimesStruct : returns a pointer to GenPrimesStruct which is used to control prime GTE 31's generation
func (*GenPrimesStruct) Prepare ¶
func (ctrl *GenPrimesStruct) Prepare() (fileName string)
Prepare : Method for GenPrimesStruct which takes the OpMode and prepares proper settings, it returns a proper filename and fullpath, Always used for GTE 31's, LTE 29's are special and handled slightly differently, Generally no need to call this, it is done automatically when generating Tuplets
type PrimeGTE31 ¶
type PrimeGTE31 struct { Helper *PrimeHelper Prime *primeBase LookUp *primeGT30Lookup CQModel []*PrimeGTE31InflationModel // contains filtered or unexported fields }
PrimeGTE31 : Structure to use for primes greater than or equal to 31, the sextuplet program only uses this for primes 31, 37, 41, 43, 47, "49", 53, and 59, there are no need for others since these can do the checking for sextuplets via lookups all the way out to infinity + 1
func GetPrimeGTE31Slice ¶ added in v1.1.0
func GetPrimeGTE31Slice() []*PrimeGTE31
GetPrimeGTE31Slice : helper for analysis routines, gives back a slice of all Primes GTE 31, len = 8, so [0]-[7] is 31-59
func NewPrimeGTE31 ¶
func NewPrimeGTE31(prime *big.Int) *PrimeGTE31
NewPrimeGTE31 : Return a pointer to an initialized PrimeGTE31 prime is the prime value the variable will have.
func P31 ¶ added in v1.1.0
func P31() *PrimeGTE31
P31 : Call to get a *PrimeGTE31 for pP(31) for whatever purpose you like
func P37 ¶ added in v1.1.0
func P37() *PrimeGTE31
P37 : Call to get a *PrimeGTE31 for pP(37) for whatever purpose you like
func P41 ¶ added in v1.1.0
func P41() *PrimeGTE31
P41 : Call to get a *PrimeGTE31 for pP(41) for whatever purpose you like
func P43 ¶ added in v1.1.0
func P43() *PrimeGTE31
P43 : Call to get a *PrimeGTE31 for pP(43) for whatever purpose you like
func P47 ¶ added in v1.1.0
func P47() *PrimeGTE31
P47 : Call to get a *PrimeGTE31 for pP(47) for whatever purpose you like
func P49 ¶ added in v1.1.0
func P49() *PrimeGTE31
P49 : Call to get a *PrimeGTE31 for pP(49) for whatever purpose you like
func P53 ¶ added in v1.1.0
func P53() *PrimeGTE31
P53 : Call to get a *PrimeGTE31 for pP(53) for whatever purpose you like
func P59 ¶ added in v1.1.0
func P59() *PrimeGTE31
P59 : Call to get a *PrimeGTE31 for pP(59) for whatever purpose you like
func (*PrimeGTE31) DisplayFullCritLengths ¶ added in v1.2.0
func (prime *PrimeGTE31) DisplayFullCritLengths(fixedN *big.Int)
DisplayFullCritLengths : analysis use, testing, checking Will show first from 0 to fixedN-1, then from fixedN+1 to 0 the number of Templates between each diff of fixedN +/- n and will also display the appropriate offsets of each n level to the fixedN border, careful, large fixedN means lots and lots of output
func (*PrimeGTE31) GetCritLength ¶ added in v1.2.0
func (prime *PrimeGTE31) GetCritLength(abs bool, fixedN, n, returnHereLen *big.Int) error
GetCritLength : analysis use, critlen here is only between members of the same family, see GetCritLen for between families, given fixedN (a chosen, fixed n level), and n the n-level you want to compare to, calculate the number of Templates between them, prime is a *PrimeGTE31, and abs flag is whether to return the absolute value, result is returned in last parameter
func (*PrimeGTE31) GetCritLengthByDiff ¶ added in v1.2.0
func (prime *PrimeGTE31) GetCritLengthByDiff(abs bool, N, diff, returnHereLen *big.Int) error
GetCritLengthByDiff : analysis use, critlen here is only between members of the same family, return the total number of Templates for potPrime p between fromN and toN, toN can be less than fromN, if abs is true return the length's absolute value, result returned in last param,
func (*PrimeGTE31) GetQbyReverseInflation ¶ added in v1.2.0
func (prime *PrimeGTE31) GetQbyReverseInflation(n, offset, returnHereQ *big.Int) error
GetQbyReverseInflation : takes n and offset from other routines and returns, in the parameter, a q appropriate for that n, the q is used to "deconstruct" an inflated potPrime so that the offset can be re-traced to its actual natural progression position so that its effect can be retrieved, this is a VERY INEFFICIENT func, and is meant for testing and analyis only, it has been used to search for sextuplets and returns correct results, Lookup tables are the efficient way to see whether an offset has an effect of interest, if offset is in an inflated region then returns -1 in param
func (*PrimeGTE31) GetResultAtCrossNum ¶
func (prime *PrimeGTE31) GetResultAtCrossNum(addResult *int, offset, n *big.Int) bool
GetResultAtCrossNum : tests the GTE 31 primes at the given offset (crossing number) for the applicable effect, addResult is changed and will be accumulated in the calling function, n is the current n-level (0 based) one is testing, offset is calculated by GetCrossNumModDirect() or GetCrossNumMod()
func (*PrimeGTE31) GetResultAtCrossNumByReverseInflation ¶ added in v1.2.0
func (prime *PrimeGTE31) GetResultAtCrossNumByReverseInflation(addResult *int, offset, n *big.Int) bool
GetResultAtCrossNumByReverseInflation : Alternative to GetResultAtCrossNum(), Used for testing and analysis because it is very inefficient and slow, It uses GetQbyReverseInflation() which re-contructs the inflation at n to get the q needed to take the offset back to its natural progression index to get its effect, addResult is changed and will be accumulated in the calling function, n is the current n-level (0 based) one is testing, offset is calculated by GetCrossNumModDirect() or GetCrossNumMod()
func (*PrimeGTE31) InflateCrossingNum ¶ added in v1.2.0
func (prime *PrimeGTE31) InflateCrossingNum(crossNum int, n, returnHereInflated *big.Int) int
InflateCrossingNum : Given a natural progression crossing number and n return in parameter the inflated value for the crossing and in result the effect at those crossing numbers, this func is intended for analysis
func (*PrimeGTE31) MemberAtN ¶ added in v1.1.0
func (p *PrimeGTE31) MemberAtN(n, returnMember *big.Int)
MemberAtN : return the member of the potPrime family at n, e.g. family 31, n=0 return 31, n=1 return 61, n=2 return 91, etc.
func (*PrimeGTE31) ShowDetails ¶
func (prime *PrimeGTE31) ShowDetails(withPausing bool)
ShowDetails : print to screen all the GTE 31 details
func (*PrimeGTE31) SubN ¶ added in v1.2.0
func (prime *PrimeGTE31) SubN() int64
Value : Getter for a prime's value
type PrimeGTE31InflationModel ¶ added in v1.2.0
type PrimeGTE31InflationModel struct { Q30 int CEffect int //rather than have to look ahead to the next index position, I store //this value to help the routine and keep it simple Wait bool }
PrimeGTE31InflationModel : This models a natural progression such that one can project forward to any n any position in the natural Progression and/or reverse engineer, or de-inflate, an inflated potPrime, used for analysis and testing, it also holds effect information, Wait is used as a helper var when re-constructing the q var, which is the inflation factor which is then based on n level, see note in code at the getPrimeGTE31InflationModel() func
type PrimeHelper ¶ added in v1.0.1
PrimeHelper struct : holds variables that don't belong properly to a prime's properties, but that can be useful in calculations, looping, etc.
type PrimeIF ¶
type PrimeIF interface {
// contains filtered or unexported methods
}
PrimeIF : interface for the prime struct's and useful methods, experimental, needs to be developed
type PrimeLTE29 ¶
PrimeLTE29 : Structure to use for primes 7 to less than or equal to 29. Primes LTE 29 are useful only in generating the sequence showing all possible prime sextuplets (the 29Basis)
func NewPrimeLTE29 ¶
func NewPrimeLTE29(prime *big.Int) *PrimeLTE29
NewPrimeLTE29 : Return a pointer to an initialized PrimeLTE29 prime is the prime value the variable will have.
func (*PrimeLTE29) GetEffect ¶
func (prime *PrimeLTE29) GetEffect(crossingNum *big.Int) int
GetEffect : Given the prime's crossing number return the effect the crossing has for that Template Number. These are "constants" in the sense that for each prime the patterns repeat forever, These numbers came from on paper analysis, We assumes it is being compared to the 2,3,5 template and, so, against a Sextuplet
func (*PrimeLTE29) ShowDetails ¶
func (prime *PrimeLTE29) ShowDetails(withPausing bool)
ShowDetails : produce the details in mod & counting numbers of how the prime will effect the Prime Templates
func (*PrimeLTE29) ShowRawDetails ¶
func (prime *PrimeLTE29) ShowRawDetails()
ShowRawDetails : display the basic data of the prime structure and the "raw" crossing effects. Natural progressions are derived from this data.