Thâbit ibn Kurrah Prime

Author

Eric W. Weisstein
November 26, 2014

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/ThabitibnKurahPrime.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/ThabitibnKurahPrime.html.

©2014 Wolfram Research, Inc. except for portions noted otherwise

Code

ThabitIbnKurrah[n_]:=3 2^n-1

Enumeration

ThabitIbnKurrah/@Range[0,10]

Primes

(p=-1+Position[ThabitIbnKurrah/@Range[0,100],_?PrimeQ]//Flatten)//Timing

ThabitIbnKurrah/@p

A002235

http://primes.utm.edu/primes/search.php?Description=^3*2^%-1&Style=HTML

Length[l={0,1,2,3,4,6,7,11,18,34,38,43,55,64,76,94,103,143,206,216,306,324,391,458,470,827,1274,3276,4204,5134,7559,12676,14898,18123,18819,25690,26459,41628,51387,71783,80330,85687,88171,97063,123630,155930,164987,234760,414840,584995,702038,727699,992700,1201046,1232255,2312734,3136255,4235414,6090515,11484018}]

Grid[{#,IntegerLength[ThabitIbnKurrah[#]]}&/@l,Dividers->All,Alignment->Decimal]

Do[
Print[{i,l[[i]],PrimeQ[ThabitIbnKurrah[l[[i]]]]//Timing}],
{i,Length[l]}
]

Do[
Print[{i,l[[i]],PrimeQ[ThabitIbnKurrah[l[[i]]]]//Timing}],
{i,51,Length[l]}
]

Misc Stuff

l={1,2,3,4,6,7,11,18,34,38,43,55,64,76,94,103,143,206,216,306,324,391,458,470,827,1274};
Do[
If[Mod[n,100]==0,Print[n,"..."]];
If[PrimeQ[3 2^n-1],AppendTo[l,n];Print[l]],
{n,2000,3000}];
l

p[n_]:=Module[{h=3 2^n-1,t=3 2^(n-1)-1,s=9 2^(2n-1)-1},
{PrimeQ[{h,t,s}],
{2^n h t,2^n s},AmicablePair[{2^n h t,2^n s}]
}
]

p[2]

p[3]

p[4]

p[7]