A091312 Erroneous version of A018239.
2, 7, 31, 211, 2311, 200560490131
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(4) = 2 + 3 + 7 + 31 = 43, which is prime, but not primorial prime.
a002109 n = a002109_list !! n a002109_list = scanl1 (*) a000312_list -- Reinhard Zumkeller, Jul 07 2012
f := proc(n) local k; mul(k^k,k=1..n); end; A002109 := n -> exp(Zeta(1,-1,n+1)-Zeta(1,-1)); seq(simplify(A002109(n)),n=0..11); # Peter Luschny, Jun 23 2012
Table[Hyperfactorial[n], {n, 0, 11}] (* Zerinvary Lajos, Jul 10 2009 *) Hyperfactorial[Range[0, 11]] (* Eric W. Weisstein, Jul 14 2017 *) Join[{1},FoldList[Times,#^#&/@Range[15]]] (* Harvey P. Dale, Nov 02 2023 *)
a(n)=prod(k=2,n,k^k) \\ Charles R Greathouse IV, Jan 12 2012
a(n)=polcoeff(1-sum(k=0, n-1, a(k)*x^k/prod(j=1,k+1,(1+j^j*x+x*O(x^n)) )), n) \\ Paul D. Hanna, Oct 02 2013
A002109 = [1] for n in range(1, 10): A002109.append(A002109[-1]*n**n) # Chai Wah Wu, Sep 03 2014
a = lambda n: prod(falling_factorial(n,k) for k in (1..n)) [a(n) for n in (0..10)] # Peter Luschny, Nov 29 2015
It is a universal convention that an empty product is 1 (just as an empty sum is 0), and since this sequence has offset 0, the first term is 1+1 = 2. - _N. J. A. Sloane_, Dec 02 2015
[2] cat [&*PrimesUpTo(p)+1: p in PrimesUpTo(70)]; // Vincenzo Librandi, Dec 03 2015
with(numtheory): A006862 := proc(n) local i; if n=0 then 2 else 1+product('ithprime(i)','i'=1..n); fi; end; # second Maple program: a:= proc(n) option remember; `if`(n=0, 2, 1+ithprime(n)*(a(n-1)-1)) end: seq(a(n), n=0..20); # Alois P. Heinz, Feb 06 2021
Table[Product[Prime[k], {k, 1, n}] + 1, {n, 1, 18}] 1 + FoldList[Times, 1, Prime@ Range@ 19] (* Harvey P. Dale, Dec 02 2015 and modified by Robert G. Wilson v, Mar 25 2017 *)
a(n)=my(v=primes(n)); prod(i=1,#v,v[i])+1 \\ Charles R Greathouse IV, Nov 20 2012
from sympy import primorial def A006862(n): if n == 0: return 2 else: return 1 + primorial(n) # Karl-Heinz Hofmann, Aug 21 2024
a(1) = 0 because the (empty) product of 0 primes is 1, plus 1 yields the prime 2. prime(4413) = 42209 and Primorial(4413) + 1 = 42209# + 1 is a 18241-digit prime. prime(13494) = 145823 and Primorial(13494) + 1 = 145823# + 1 is a 63142-digit prime.
P:= 1: p:= 1: count:= 0: for n from 1 to 1000 do p:= nextprime(p); P:= P*p; if isprime(P+1) then count:= count+1; A[count]:= n; fi od: seq(A[i], i=1..count); # Robert Israel, Nov 04 2015
Flatten[Position[Rest[FoldList[Times,1,Prime[Range[180]]]]+1,?PrimeQ]] (* _Harvey P. Dale, May 04 2012 *) (* this program generates the first 9 positive terms of the sequence; changing the Range constant to 33237 will generate all 23 terms above, but it will take a long time to do so *)
is(n)=ispseudoprime(prod(i=1,n,prime(i))+1) \\ Charles R Greathouse IV, Mar 21 2013
P=1; n=0; forprime(p=1, 10^5, if(ispseudoprime(P+1), print1(n", ")); n=n+1; P*=p;) \\ Hans Loeblich, May 10 2019
primorial[p_] := Product[Prime[k], {k, 1, PrimePi[p]}]; Select[Prime[Range[1900]], PrimeQ[primorial[#] - 1] &] (* Jean-François Alcover, Mar 16 2011 *) Transpose[With[{pr=Prime[Range[2000]]},Select[Thread[{Rest[FoldList[ Times,1,pr]], pr}], PrimeQ[ First[#]-1]&]]][[2]] (* Harvey P. Dale, Jun 21 2011 *) With[{p = Prime[Range[200]]}, p[[Flatten[Position[Rest[FoldList[Times, 1, p]] - 1, ?PrimeQ]]]]] (* _Eric W. Weisstein, Nov 03 2015 *)
is(n)=isprime(n) && ispseudoprime(prod(i=1,primepi(n),prime(i))-1) \\ Charles R Greathouse IV, Apr 29 2015
from sympy import nextprime, isprime A006794_list, p, q = [], 2, 2 while p < 10**5: if isprime(q-1): A006794_list.append(p) p = nextprime(p) q *= p # Chai Wah Wu, Apr 03 2021
P(2)/2-2^0=2 is prime, so a(2)=0; P(10)/2-2^3=3234846607 is Prime, so a(10)=3.
nmax = 2^8192; npd = 1; n = 2; npd = npd*Prime[n]; While[npd < nmax, tn = 1; tt = 2; cp = npd - tt; While[(cp > 1) && (! (PrimeQ[cp])), tn = tn + 1; tt = tt*2; cp = npd - tt]; If[cp < 2, Print["*"], Print[tn]]; n = n + 1; npd = npd*Prime[n]] (* Second program: *) k = 1; a = {}; Do[k = k*Prime[n]; m = 1; While[ ! PrimeQ[k - 2^m], m++ ]; Print[m]; AppendTo[a, m], {n, 2, 200}]; a (* Artur Jasinski, Apr 21 2008 *)
a(n)=my(t=prod(i=2,n,prime(i)),m); while(!isprime(t-2^m),m++); m \\ Charles R Greathouse IV, Apr 28 2015
[p:p in PrimesUpTo(3000)|IsPrime(&*PrimesUpTo(p)+1)]; // Marius A. Burtea, Mar 25 2019
N:= 5000: # to get all terms <= N Primes:= select(isprime, [$2..N]): P:= 1: count:= 0: for n from 1 to nops(Primes) do P:= P*Primes[n]; if isprime(P+1) then count:= count+1; A[count]:= Primes[n] fi od: seq(A[i],i=1..count); # Robert Israel, Nov 03 2015
(* This program is not convenient for large values of p *) p = pp = 1; Reap[While[p < 5000, p = NextPrime[p]; pp = pp*p; If[PrimeQ[1 + pp], Print[p]; Sow[p]]]][[2, 1]] (* Jean-François Alcover, Dec 31 2012 *) With[{p = Prime[Range[200]]}, p[[Flatten[Position[Rest[FoldList[Times, 1, p]] + 1, ?PrimeQ]]]]] (* _Eric W. Weisstein, Nov 03 2015 *)
is(n)=isprime(n) && ispseudoprime(prod(i=1,primepi(n),prime(i))+1) \\ Charles R Greathouse IV, Feb 20 2013
is(n)=isprime(n) && ispseudoprime(factorback(primes([2,n]))+1) \\ M. F. Hasler, May 31 2018
a057705 n = a057705_list !! (n-1) a057705_list = filter ((== 1) . a010051) a057588_list -- Reinhard Zumkeller, Mar 27 2013
Select[FoldList[Times, 1, Prime[Range[70]]], PrimeQ[# - 1] &] - 1 (* Harvey P. Dale, Jan 27 2014 *)
Comments