Post Reply 
(50g) Fibonnaci Pseudoprime Test & Prime Test
02-17-2019, 09:12 PM (This post was last modified: 02-18-2019 09:39 PM by Albert Chan.)
Post: #2
RE: (50g) Fibonnaci Pseudoprime Test & Prime Test
Using Mathematica, this shows first few Fibonacci pseudoprimes, below 1000:

f[n_] := Fibonacci[n - Part[{0, 1, -1, -1, 1}, Mod[n,5]+1]];
fprimeQ[n_] := (Mod[f[n], n] == 0);

Select[Table[i, {i,1000}], fprimeQ[#] != PrimeQ[#]&]

→ {1, 25, 60, 120, 125, 180, 240, 300, 323, 360, 377, 480, 540, 600, 625, 660, 720, 840, 900, 960}

Edit: tried above code to strong pseduoprimes, base-2: https://oeis.org/A001262
→ smallest number that is both strong base-2 and Fibonacci pseduoprime is 252601
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (50g) Fibonnaci Pseudoprime Test & Prime Test - Albert Chan - 02-17-2019 09:12 PM



User(s) browsing this thread: 1 Guest(s)