A005992 Erroneous version of A011260.
1, 1, 2, 2, 6, 4, 18, 16, 48, 60
Offset: 1
Keywords
References
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
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.
Corresponding to the initial terms 2, 3, 5, 7, 13, 17, 19, 31 ... we get the Mersenne primes 2^2 - 1 = 3, 2^3 - 1 = 7, 2^5 - 1 = 31, 127, 8191, 131071, 524287, 2147483647, ... (see A000668).
MersennePrimeExponent[Range[48]] (* Eric W. Weisstein, Jul 17 2017; updated Oct 21 2024 *)
isA000043(n) = isprime(2^n-1) \\ Michael B. Porter, Oct 28 2009
is(n)=my(h=Mod(2,2^n-1)); for(i=1, n-2, h=2*h^2-1); h==0||n==2 \\ Lucas-Lehmer test for exponent e. - Joerg Arndt, Jan 16 2011, and Charles R Greathouse IV, Jun 05 2013 forprime(e=2,5000,if(is(e),print1(e,", "))); /* terms < 5000 */
from sympy import isprime, prime for n in range(1,100): if isprime(2**prime(n)-1): print(prime(n), end=', ') # Stefano Spezia, Dec 06 2018
Binary strings (Lyndon words, cf. A102659): a(0) = 1 = #{ "" }, a(1) = 2 = #{ "0", "1" }, a(2) = 1 = #{ "01" }, a(3) = 2 = #{ "001", "011" }, a(4) = 3 = #{ "0001", "0011", "0111" }, a(5) = 6 = #{ "00001", "00011", "00101", "00111", "01011", "01111" }.
a001037 0 = 1 a001037 n = (sum $ map (\d -> (a000079 d) * a008683 (n `div` d)) $ a027750_row n) `div` n -- Reinhard Zumkeller, Feb 01 2013
with(numtheory): A001037 := proc(n) local a,d; if n = 0 then RETURN(1); else a := 0: for d in divisors(n) do a := a+mobius(n/d)*2^d; od: RETURN(a/n); fi; end;
f[n_] := Block[{d = Divisors@ n}, Plus @@ (MoebiusMu[n/d]*2^d/n)]; Array[f, 32]
A001037(n)=if(n>1,sumdiv(n,d,moebius(d)*2^(n/d))/n,n+1) \\ Edited by M. F. Hasler, Jan 11 2016
{a(n)=polcoeff(1-sum(k=1,n,moebius(k)/k*log(1-2*x^k+x*O(x^n))),n)} \\ Paul D. Hanna, Oct 13 2010
a(n)=if(n>1,my(s);forstep(i=2^n+1,2^(n+1),2,s+=polisirreducible(Mod(1,2) * Pol(binary(i))));s,n+1) \\ Charles R Greathouse IV, Jan 26 2012
from sympy import divisors, mobius def a(n): return sum(mobius(d) * 2**(n//d) for d in divisors(n))/n if n>1 else n + 1 # Indranil Ghosh, Apr 26 2017
The first few are x, x+1; x^2+x+1; x^3+x+1, x^3+x^2+1; ... Note that x is irreducible but not primitive.
Do[a = Reverse[ IntegerDigits[n, 2]]; b = {0}; l = Length[a]; k = 1; While[k < l + 1, b = Append[b, a[[k]]*x^(k - 1) ]; k++ ]; b = Apply[Plus, b]; c = Factor[b, Modulus -> 2]; If[b == c, Print[ FromDigits[ IntegerDigits[n, 2]]]], {n, 3, 250, 2} ]
seq(N, p=2, maxdeg=oo) = { my(a = List(), k=0, d=0); while (d++ <= maxdeg, for (n=p^d, 2*p^d-1, my(f=Mod(Pol(digits(n,p)),p)); if(polisirreducible(f), listput(a, subst(lift(f),'x,10)); k++); if(k >= N, break(2)))); Vec(a); }; seq(27) \\ Gheorghe Coserea, May 28 2018
List([1..35],n->Phi(2^n-1)); # Muniru A Asiru, Oct 31 2018
[EulerPhi(2^n-1): n in [1..40]]; // Vincenzo Librandi, Jul 15 2015
a := n -> numtheory:-phi(2^n - 1): seq(a(n), n=1..32); # Zerinvary Lajos, Oct 05 2007
EulerPhi[2^Range[25] - 1] (* Giovanni Resta, Sep 06 2019 *)
a(n) = eulerphi(2^n-1) \\ Michael B. Porter, Oct 06 2009
The first few are x+1; x^2+x+1; x^3+x+1, x^3+x^2+1; ... Note that x is irreducible but not primitive.
car = 2; maxDegree = 13; okQ[{1, 1}] = True; okQ[coefs_List] := Module[{P}, P = coefs.x^Range[Length[coefs]-1, 0, -1]; coefs[[1]] == 1 && IrreduciblePolynomialQ[P, Modulus -> car] && PrimitivePolynomialQ[P, car]]; FromDigits /@ Select[Table[IntegerDigits[k, car], {k, car+1, car^(maxDegree + 1)}], okQ] (* Jean-François Alcover, Sep 09 2019 *)
Array begins: n\k| 2 3 4 5 6 7 8 9 ... ---+--------------------------------------------------- 1 | 1 1 2 2 4 2 6 4 ... 2 | 1 2 4 4 12 8 18 16 ... 3 | 2 4 12 20 56 36 144 96 ... 4 | 2 8 32 48 216 160 432 640 ... 5 | 6 22 120 280 1240 1120 5400 5280 ... 6 | 6 48 288 720 5040 6048 23328 27648 ... 7 | 18 156 1512 5580 31992 37856 254016 340704 ... 8 | 16 320 4096 14976 139968 192000 829440 1966080 ... ...
A369291[n_, k_] := EulerPhi[k^n - 1]/n; Table[A369291[k, n-k+2], {n, 15}, {k, n}] (* Paolo Xausa, Jun 17 2024 *)
T(n,k) = eulerphi(k^n-1)/n
Table[If[n==1,2,EulerPhi[2^n-1]/n],{n,1,50}] (* Vladimir Joseph Stephan Orlovsky, Jan 24 2012 *)
a(n)=if(n==1,2,eulerphi(2^n-1)/n) \\ Hauke Worpel (thebigh(AT)outgun.com), Jun 10 2008
Comments