A087578 Duplicate of A023195.
3, 7, 13, 31, 127, 307, 1093, 1723, 2801, 3541, 5113, 8011, 8191, 10303, 17293, 19531
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.
A000668:=Filtered(List(Filtered([1..600], IsPrime),i->2^i-1),IsPrime); # Muniru A Asiru, Oct 01 2017
A000668 := proc(n) local i; i := 2^(ithprime(n))-1: if (isprime(i)) then return i fi: end: seq(A000668(n), n=1..31); # Jani Melik, Feb 09 2011 # Alternate: seq(numtheory:-mersenne([i]),i=1..26); # Robert Israel, Jul 13 2014
2^Array[MersennePrimeExponent, 18] - 1 (* Jean-François Alcover, Feb 17 2018, Mersenne primes with less than 1000 digits *) 2^MersennePrimeExponent[Range[18]] - 1 (* Eric W. Weisstein, Sep 04 2021 *)
forprime(p=2,1e5,if(ispseudoprime(2^p-1),print1(2^p-1", "))) \\ Charles R Greathouse IV, Jul 15 2011
LL(e) = my(n, h); n = 2^e-1; h = Mod(2, n); for (k=1, e-2, h=2*h*h-1); return(0==h) \\ after Joerg Arndt in A000043 forprime(p=1, , if(LL(p), print1(p, ", "))) \\ Felix Fröhlich, Feb 17 2018
from sympy import isprime, primerange print([2**n-1 for n in primerange(1, 1001) if isprime(2**n-1)]) # Karl V. Keller, Jr., Jul 16 2020
[n: n in [1..2*10^6] | IsPrime(SumOfDivisors(n))]; // Vincenzo Librandi, May 05 2015
N:= 10^8: # to get all entries <= N Primes:= select(isprime, [2,seq(2*i+1, i=1..floor((sqrt(N)-1)/2))]): P2:= select(t -> (t > 2 and t < 1 + ilog2(N)), Primes): cands:= {seq(seq([p,q],p=Primes), q=P2)} union {[2,2]}: f:= proc(pq) local t,j; t:= pq[1]^(pq[2]-1); if t <= N and isprime((t*pq[1]-1)/(pq[1]-1)) then t else NULL fi end proc: map(f,cands); # if using Maple 11 or earlier, uncomment the next line # sort(convert(%,list)); # Robert Israel, Jan 13 2015
Select[ Range[ 100000 ], PrimeQ[ DivisorSigma[ 1, # ] ]& ] (* David W. Wilson *) Prepend[Select[Range[1100]^2, PrimeQ[DivisorSigma[1,#]]&],2] (* Harvey P. Dale, Dec 12 2010 *)
for(x=1,1000,if(isprime(sigma(x)),print(x))) /* Jorge Coveiro, Dec 23 2004 */
list(lim)=my(v=List([2])); forprime(p=2,sqrtint(lim\=1), if(isprime(p^2+p+1), listput(v,p^2))); forstep(e=4,logint(lim,2),2, forprime(p=2,sqrtnint(lim,e), if(isprime((p^(e+1)-1)/(p-1)), listput(v,p^e)))); Set(v) \\ Charles R Greathouse IV, Aug 17 2011; updated Jul 22 2016
from sympy import isprime, divisor_sigma A023194_list = [2]+[n**2 for n in range(1,10**3) if isprime(divisor_sigma(n**2))] # Chai Wah Wu, Jul 14 2016
13 is a term since it is prime and 13 = 1 + 3 + 3^2 = 111_3. 31 is a term since it is prime and 31 = 1 + 2 + 2^2 + 2^3 + 2^4 = 11111_2. From _Hartmut F. W. Hoft_, May 08 2017: (Start) The sequence represented as a sparse matrix with the k-th column indexed by A006093(k+1), primes minus 1, and row n by A000027(n+1). Traversing the matrix by counterdiagonals produces a non-monotone ordering. 2 4 6 10 12 16 2 7 31 127 - 8191 131071 3 13 - 1093 - 797161 - 4 - - - - - - 5 31 - 19531 12207031 305175781 - 6 43 - 55987 - - - 7 - 2801 - - 16148168401 - 8 73 - - - - - 9 - - - - - - 10 - - - - - - 11 - - - - - 50544702849929377 12 157 22621 - - - - 13 - 30941 5229043 - - - 14 211 - 8108731 - - - 15 241 - - - - - 16 - - - - - - 17 307 88741 25646167 2141993519227 - - 18 - - - - - - 19 - - - - - - 20 421 - - 10778947368421 - 689852631578947368421 21 463 - - 17513875027111 - 1502097124754084594737 22 - 245411 - - - - 23 - 292561 - - - - 24 601 346201 - - - - Except for the initial values in the respective sequences the rows and columns as labeled in the matrix are: column 2: A002383 row 2: A000668 column 4: A088548 row 3: A076481 column 6: A088550 row 4: - column 10: A162861 row 5: A086122. (End)
a085104 n = a085104_list !! (n-1) a085104_list = filter ((> 1) . a088323) a000040_list -- Reinhard Zumkeller, Jan 22 2014
max = 140; maxdata = (1 - max^3)/(1 - max); a = {}; Do[i = 1; While[i = i + 2; cc = (1 - m^i)/(1 - m); cc <= maxdata, If[PrimeQ[cc], a = Append[a, cc]]], {m, 2, max}]; Union[a] (* Lei Zhou, Feb 08 2012 *) f[n_] := Block[{i = 1, d, p = Prime@ n}, d = Rest@ Divisors[p - 1]; While[ id = IntegerDigits[p, d[[i]]]; id != Reverse@ id || Union@ id != {1}, i++]; d[[i]]]; Select[ Range[2, 60], 1 + f@# != Prime@# &] (* Robert G. Wilson v, Mar 31 2014 *)
list(lim)=my(v=List(),t,k);for(n=2,sqrt(lim), t=1+n;k=1; while((t+=n^k++)<=lim,if(isprime(t), listput(v,t))));vecsort(Vec(v),,8) \\ Charles R Greathouse IV, Jan 08 2013
A085104_vec(N,L=List())=forprime(K=3,logint(N+1,2),for(n=2,sqrtnint(N-1,K-1),isprime((n^K-1)\(n-1))&&listput(L,(n^K-1)\(n-1))));Set(L) \\ M. F. Hasler, Jun 26 2018
a:=List([1..50],n->Sigma(n^2));; Print(a); # Muniru A Asiru, Jan 01 2019
[SumOfDivisors(n^2): n in [1..48]]; // Bruno Berselli, Apr 12 2011
with(numtheory): [sigma(n^2)$n=1..50]; # Muniru A Asiru, Jan 01 2019
Table[Plus@@Divisors[n^2], {n, 48}] (* Alonso del Arte, Feb 24 2012 *) f[p_, e_] := (p^(2*e + 1) - 1)/(p - 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 50] (* Amiram Eldar, Sep 10 2020 *)
numlib::sigma(n^2)$ n=1..81 // Zerinvary Lajos, May 13 2008
a(n) = sigma(n^2); \\ Harry J. Smith, Oct 30 2009
from math import prod from sympy import factorint def A065764(n): return prod((p**((e<<1)+1)-1)//(p-1) for p,e in factorint(n).items()) # Chai Wah Wu, Oct 25 2023
[sigma(n^2,1)for n in range(1,49)] # Zerinvary Lajos, Jun 13 2009
a053183[n_] := Select[Map[Prime[#]^2 + Prime[#] + 1&, Range[n]], PrimeQ] a053183[225] (* data *) (* Hartmut F. W. Hoft, May 05 2017 *) Select[Table[p^2+p+1,{p,Prime[Range[300]]}],PrimeQ] (* Harvey P. Dale, Aug 15 2017 *)
sigma(2) = 3, sigma(4) = 7, sigma(9) = 13 are the first three prime terms of A000203. Hence the sequence starts 3, 7, 13.
[ c: n in [1..1000000] | IsPrime(c) where c:=SumOfDivisors(n) ]; // Klaus Brockhaus, Oct 21 2009
Select[DivisorSigma[1,Range[1000000]],PrimeQ] (* Harvey P. Dale, Nov 09 2012 *)
je=[]; for(n=1,1000000, if(isprime(sigma(n)),je=concat(je, sigma(n)))); je
{ n=0; for (m=1, 10^9, if(isprime(a=sigma(m)), write("b062700.txt", n++, " ", a); if (n==100, break)) ) } \\ Harry J. Smith, Aug 09 2009
from sympy import isprime, divisor_sigma A062700_list = [3]+[n for n in (divisor_sigma(d**2) for d in range(1,10**4)) if isprime(n)] # Chai Wah Wu, Jul 23 2016
[n: n in [1..2000] | IsPrime(SumOfDivisors(n^2))]; // Vincenzo Librandi, Oct 18 2014
Select[Range[2000], PrimeQ[DivisorSigma[1, #^2]] &]
for(n=1,9999,isprime(sigma(n^2))&&print1(n",")) \\ M. F. Hasler, Oct 18 2014
Mersenne exponent 7 is in the sequence because sigma(4) = 7. Mersenne exponent 31 is in the sequence because there are two numbers n (16 and 25) with sigma(n) = 31.
Set(Sort([SumOfDivisors(n): n in[1..10000] | IsPrime((2^SumOfDivisors(n))- 1)]));
Mersenne prime 2147483647 is in the sequence because there are two numbers n (16 and 25) with 2^sigma(n) - 1 = 2^31 - 1 = 2147483647.
Set(Sort([(2^SumOfDivisors(n))-1: n in[1..10000] | IsPrime((2^SumOfDivisors(n))-1)]));
Comments