A084731 Duplicate of A066180.
2, 2, 2, 2, 5, 2, 2, 2, 10, 6, 2, 61, 14, 15, 5, 24, 19, 2, 46, 3, 11, 22, 41, 2, 12, 22, 3, 2
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
a(11) = 5 because C11(k) is composite for k = 2, 3, 4 and prime for k = 5. a(37) = 61 because C37(k) is composite for k = 2, 3, 4, ..., 60 and prime for k = 61.
f:= proc(n) local k; for k from 2 do if isprime(numtheory:-cyclotomic(n,k)) then return k fi od end proc: seq(f(n), n = 1 .. 100); # Robert Israel, Nov 13 2014
Table[k = 2; While[!PrimeQ[Cyclotomic[n, k]], k++]; k, {n, 300}] (* Eric Chen, Nov 14 2014 *)
a(n) = k=2; while(!isprime(polcyclo(n, k)), k++); k; \\ Michel Marcus, Nov 13 2014
a(7) = 5 as (7^5 - 1 )/(7 - 1) = 2801 = 1 + 7 + 7^2 + 7^3 + 7^4 is a prime but no smaller partial sum yields a prime.
a(n) = {l=List([9, 25, 32, 49, 64, 81, 121, 125, 144, 169, 216, 225, 243, 289, 324, 343]); for(q=1, #l, if(n==l[q], return(0))); k=1; while(k, s=(n^prime(k)-1)/(n-1); if(ispseudoprime(s), return(prime(k))); k++)} n=2; while(n<361, print1(a(n), ", "); n++) \\ Derek Orr, Jul 13 2014
(2^prime(2)+1)/(2+1) = 3 is prime, so a(2)=2; (2^prime(10)+1)/(2+1) = 178956971 has a factor of 59; (3^prime(10)+1)/(3+1) = 17157594341221 has a factor of 523; ... (7^prime(10)+1)/(7+1) = 402488219476647465854701 is prime, so a(10)=7.
Do[p=Prime[k]; n=2; cp=(n^p+1)/(n+1); While[ !PrimeQ[cp], n=n+1; cp=(n^p+1)/(n+1)]; Print[n], {k, 2, 200}]
a(7) = 5 because (7^5 - 1)/6 = 2801 = 11111_7 is prime and (7^k - 1)/6 = 1, 8, 57, 400 for k = 1, 2, 3, 4. - _Bernard Schott_, Apr 23 2017
Table[Function[m, If[m > 0, k = 3; While[! PrimeQ[(m^k - 1)/(m - 1)], k++]; k, 0]]@ If[Set[e, GCD @@ #[[All, -1]]] > 1, {#, IntegerExponent[n, #]} &@ Power[n, 1/e] /. {{k_, m_} /; Or[Not[PrimePowerQ@ m], Prime@ m, FactorInteger[m][[1, 1]] == 2] :> 0, {k_, m_} /; m > 1 :> n}, n] &@ FactorInteger@ n, {n, 2, 17}] (* Michael De Vlieger, Apr 24 2017 *)
a052409(n) = my(k=ispower(n)); if(k, k, n>1) a052410(n) = if (ispower(n, , &r), r, n) is(n) = issquare(n) || (ispower(n) && !ispseudoprime((n^a052410(a052409(n))-1)/(n-1))) a(n) = if(is(n), 0, forprime(p=3, 2^16, if(ispseudoprime((n^p-1)/(n-1)), return(p)))) \\ Eric Chen, Jun 01 2015, corrected by Eric Chen, Jun 04 2018, after Charles R Greathouse IV in A052409 and Michel Marcus in A052410
f[n_] := NestWhile[NextPrime, 2, ! PrimeQ[Cyclotomic[Prime[n], #]] &]; Array[f, 63](* Davin Park, Dec 28 2016 and Robert G. Wilson v, Dec 28 2016 *)
a(n) = {my(x = 2); while (!isprime(polcyclo(prime(n), x)), x= nextprime(x+1)); x;} \\ Michel Marcus, Dec 10 2016
a(5)=12207031 because 11 is the 5th prime; C11(x) is composite for x=2,3,4 and C11(5)=12207031 is prime.
2^prime(1)-1^prime(1)=3 is prime, so a(1)=2; 2^prime(5)-1^prime(5)=2047 has a factor of 23; ... 6^prime(5)-5^prime(5)=313968931 is prime, so a(5)=6;
f:= proc(n) local p,b; p:= ithprime(n); for b from 2 do if isprime(b^p - (b-1)^p) then return b fi od end proc: map(f, [$1..80]); # Robert Israel, Jun 04 2024
Do[p=Prime[k]; n=2; nm1=n-1; cp=n^p-nm1^p; While[ !PrimeQ[cp], n=n+1; nm1=n-1; cp=n^p-nm1^p]; Print[n], {k, 1, 200}]
3 = (111) base -2, so a(1) = 3; 7 = (111) base 2, so a(2) = 7; 11 = (11111) base -2, so a(3) = 11. 31 = (2^5-1)/(2-1) = (5^3-1)/(5-1) = (6^3+1)/(6+1), 43 = (2^7+1)/(2+1) = (7^3+1)/(7+1) = (6^3-1)/(6-1), 8191 = (2^13-1)/(2-1) = (90^3-1)/(90-1) = (91^3+1)/(91+1).
phiinv[n_, pl_] := Module[{i, p, e, pe, val}, If[pl == {}, Return[If[n == 1, {1}, {}]]]; val = {}; p = Last[pl]; For[e = 0; pe = 1, e == 0 || Mod[n, (p - 1) pe/p] == 0, e++; pe *= p, val = Join[val, pe*phiinv[If[e == 0, n, n*p/pe/(p - 1)], Drop[pl, -1]]]]; Sort[val]]; phiinv[n_] := phiinv[n, Select[1 + Divisors[n], PrimeQ]]; maxdata = 13500; max = Ceiling[(1 + Sqrt[1 + 4*(maxdata - 1)])/4]*2; eb = 2*Floor[(Log[2, maxdata])/2 + 0.5]; While[eg = phiinv[eb]; lu = Length[eg]; lu == 0, eb = eb + 2]; t = Select[Range[eg[[Length[eg]]]], ((EulerPhi[#] <= eb) && (a = FactorInteger[#]; b = Length[a]; (((b == 1) && (a[[1]][[1]] > 2)) || ((b == 2) && (a[[1]][[1]] == 2))))) &]; ap = SortBy[t, Cyclotomic[#, 2] &]; a = {}; Do[i = 0; While[i++; cc = Cyclotomic[ap[[i]], m]; cc <= maxdata, If[PrimeQ[cc], a = Append[a, cc]]], {m, 2, max}]; Union[a] nn = 120; ps = Prime[Range[2, PrimePi[Log[2, 2*nn^2 + 1]]]]; t = {}; Do[n = 0; If[Abs[m] > 1, n = (m^p - 1)/(m - 1); If[n > nn^2, n = 0]]; If[PrimeQ[n], AppendTo[t, n]], {p, ps}, {m, -nn, nn}]; t = Union[t] (* T. D. Noe, May 03 2013 *)
Comments