A004060 Erroneous version of A028491.
3, 7, 13, 71, 103, 541, 1019, 1367, 1627, 4177, 9011, 9551
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.
Select[Range[10000], PrimeQ[DivisorSigma[1, 3^#]] &] (* Vincenzo Librandi, Mar 26 2015 *)
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
There are 4 3-block bicoverings of a 3-set: {{1, 2, 3}, {1, 2}, {3}}, {{1, 2, 3}, {1, 3}, {2}}, {{1, 2, 3}, {1}, {2, 3}} and {{1, 2}, {1, 3}, {2, 3}}. Ternary........Decimal 0.................0 1.................1 11................4 111..............13 1111.............40 etc. - _Zerinvary Lajos_, Jan 14 2007 There are altogether a(3) = 13 three letter words over {A,B,C} with say, A, appearing an odd number of times: AAA; ABC, ACB, ABB, ACC; BAC, CAB, BAB, CAC; BCA, CBA, BBA, CCA. - _Wolfdieter Lang_, Jul 16 2017
A003462:=List([0..30],n->(3^n-1)/2); # Muniru A Asiru, Sep 27 2017
a003462 = (`div` 2) . (subtract 1) . (3 ^) a003462_list = iterate ((+ 1) . (* 3)) 0 -- Reinhard Zumkeller, May 09 2012
[(3^n-1)/2: n in [0..30]]; // Vincenzo Librandi, Feb 21 2015
A003462 := n-> (3^n - 1)/2: seq(A003462(n), n=0..30); A003462:=1/(3*z-1)/(z-1); # Simon Plouffe in his 1992 dissertation
(3^Range[0, 30] - 1)/2 (* Harvey P. Dale, Jul 13 2011 *) LinearRecurrence[{4, -3}, {0, 1}, 30] (* Harvey P. Dale, Jul 13 2011 *) Accumulate[3^Range[0, 30]] (* Alonso del Arte, Sep 10 2017 *) CoefficientList[Series[x/(1 - 4x + 3x^2), {x, 0, 30}], x] (* Eric W. Weisstein, Sep 28 2017 *) Table[FromDigits[PadRight[{},n,1],3],{n,0,30}] (* Harvey P. Dale, Jun 01 2022 *)
A003462(n):=(3^n - 1)/2$ makelist(A003462(n),n,0,30); /* Martin Ettl, Nov 05 2012 */
a(n)=(3^n-1)/2
concat(0, Vec(x/((1-x)*(1-3*x)) + O(x^30))) \\ Altug Alkan, Nov 01 2015
[(3^n - 1)/2 for n in range(0,30)] # Zerinvary Lajos, Jun 05 2009
2 appears because the 2-digit repunit 11 is prime. 3 does not appear because 111 = 3 * 37 is not prime. 19 appears because the 19-digit repunit 1111111111111111111 is prime.
[p: p in PrimesUpTo(500) | IsPrime((10^p - 1) div 9)]; // Vincenzo Librandi, Nov 06 2014
Select[Range[271000], PrimeQ[FromDigits[PadRight[{}, #, 1]]] &] (* Harvey P. Dale, Nov 05 2011 *) repUnsUpTo[k_] := ParallelMap[If[PrimeQ[#] && PrimeQ[(10^# - 1)/9], #, Nothing] &, Range[k]]; repUnsUpTo[5000] (* Mikk Heidemaa, Apr 24 2017 *)
forprime(x=2,20000,if(ispseudoprime((10^x-1)/9),print1(x","))) \\ Cino Hilliard, Dec 23 2008
from sympy import isprime; {print(n, end = ', ') for n in range(1, 10**7) if isprime(n) and isprime(10**n//9)} # (Note that sympy.isprime is only a pseudo-primality test.) - Ya-Ping Lu, Dec 20 2021, edited by M. F. Hasler, Mar 28 2022
a000978 n = a000978_list !! (n-1) a000978_list = filter ((== 1) . a010051 . a001045) a065091_list -- Reinhard Zumkeller, Mar 24 2013
Select[Range[5000], PrimeQ[(2^# + 1)/3] &] (* Michael De Vlieger, Jan 10 2018 *) Select[Prime[Range[2,500]],PrimeQ[(2^#+1)/3]&] (* Harvey P. Dale, Jun 13 2022 *)
forprime(p=2,5000,if(ispseudoprime(2^p\/3),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
from gmpy2 import divexact from sympy import prime, isprime A000978 = [p for p in (prime(n) for n in range(2,10**2)) if isprime(divexact(2**p+1,3))] # Chai Wah Wu, Sep 04 2014
Select[Prime[Range[100]], PrimeQ[(23^#-1)/22]&]
is(n)=ispseudoprime((23^n-1)/22) \\ Charles R Greathouse IV, Jun 13 2017
lst={};Do[If[PrimeQ[(5^n-1)/4], AppendTo[lst, n]], {n, 10^4}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 20 2008 *)
forprime(p=2,1e4,if(ispseudoprime(5^p\4),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
a033632 n = a033632_list !! (n-1) a033632_list = filter (\x -> a062401 x == a062402 x) [1..] -- Reinhard Zumkeller, Jan 04 2013
Select[ Range[ 10^6 ], DivisorSigma[ 1, EulerPhi[ # ] ] == EulerPhi[ DivisorSigma[ 1, # ] ] & ]
is(n)=sigma(eulerphi(n))==eulerphi(sigma(n)) \\ Charles R Greathouse IV, May 09 2013
from sympy import divisor_sigma as sigma, totient as phi def ok(n): return sigma(phi(n)) == phi(sigma(n)) def aupto(nn): return [m for m in range(1, nn+1) if ok(m)] print(aupto(10**4)) # Michael S. Branicky, Jan 09 2021
[p: p in PrimesUpTo(400) | IsPrime((11^p-3^p) div 8)]; // Vincenzo Librandi, Nov 20 2014
A128027:=n->`if`(isprime((11^n-3^n)/8),n,NULL): seq(A128027(n),n=1..1000); # Wesley Ivan Hurt, Nov 19 2014
k=8; Select[ Prime[ Range[1,200] ], PrimeQ[ ((k+3)^# - 3^#)/k ]& ] Do[If[PrimeQ[(11^n - 3^n)/8], Print[n]], {n, 10^4}] (* Ryan Propper, Mar 17 2007 *) Select[Prime[Range[1200]], PrimeQ[(11^# - 3^#)/8] &] (* Vincenzo Librandi, Nov 20 2014 *)
is(n)=ispseudoprime((11^n - 3^n)/8) \\ Charles R Greathouse IV, Feb 17 2017
Comments