A055511 Erroneous version of A006794.
3, 5, 11, 41, 89, 317, 337, 991, 1873, 2053, 2377, 4093, 4297, 4583, 6569, 13033, 15877
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(9) = 23# = 2*3*5*7*11*13*17*19*23 = 223092870 divides the difference 5283234035979900 in the arithmetic progression of 26 primes A204189. - _Jonathan Sondow_, Jan 15 2012
a002110 n = product $ take n a000040_list a002110_list = scanl (*) 1 a000040_list -- Reinhard Zumkeller, Feb 19 2012, May 03 2011
[1] cat [&*[NthPrime(i): i in [1..n]]: n in [1..20]]; // Bruno Berselli, Oct 24 2012
[1] cat [&*PrimesUpTo(p): p in PrimesUpTo(60)]; // Bruno Berselli, Feb 08 2015
A002110 := n -> mul(ithprime(i),i=1..n);
FoldList[Times, 1, Prime[Range[20]]] primorial[n_] := Product[Prime[i], {i, n}]; Array[primorial,20] (* José María Grau Ribas, Feb 15 2010 *) Join[{1}, Denominator[Accumulate[1/Prime[Range[20]]]]] (* Harvey P. Dale, Apr 11 2012 *)
a(n)=prod(i=1,n, prime(i)) \\ Washington Bomfim, Sep 23 2008
p=1; for (n=0, 100, if (n, p*=prime(n)); write("b002110.txt", n, " ", p) ) \\ Harry J. Smith, Nov 13 2009
a(n) = factorback(primes(n)) \\ David A. Corneth, May 06 2018
from sympy import primorial def a(n): return 1 if n < 1 else primorial(n) [a(n) for n in range(51)] # Indranil Ghosh, Mar 29 2017
[sloane.A002110(n) for n in (1..20)] # Giuseppe Coppoletta, Dec 05 2014
; with memoization-macro definec (definec (A002110 n) (if (zero? n) 1 (* (A000040 n) (A002110 (- n 1))))) ;; Antti Karttunen, Aug 30 2016
3! + 1 = 7 is prime, so 3 is in the sequence.
[n: n in [0..800] | IsPrime(Factorial(n)+1)]; // Vincenzo Librandi, Oct 31 2018
v = {0, 1, 2}; Do[If[ !PrimeQ[n + 1] && PrimeQ[n! + 1], v = Append[v, n]; Print[v]], {n, 3, 29651}] Select[Range[100], PrimeQ[#! + 1] &] (* Alonso del Arte, Jul 24 2014 *)
for(n=0,500,if(ispseudoprime(n!+1),print1(n", "))) \\ Charles R Greathouse IV, Jun 16 2011
from sympy import factorial, isprime for n in range(0,800): if isprime(factorial(n)+1): print(n, end=', ') # Stefano Spezia, Jan 10 2019
From _Gus Wiseman_, Jul 04 2019: (Start) The sequence of numbers n! - 1 together with their prime indices begins: 1: {} 5: {3} 23: {9} 119: {4,7} 719: {128} 5039: {675} 40319: {9,273} 362879: {5,5,430} 3628799: {10,11746} 39916799: {6,7,9,992} 479001599: {25306287} 6227020799: {270,256263} 87178291199: {3610490805} 1307674367999: {7,11,11,16,114905} 20922789887999: {436,318519035} 355687428095999: {8,21,10165484947} 6402373705727999: {17,20157,25293727} 121645100408831999: {119,175195,4567455} 2432902008176639999: {11715,659539127675} (End)
[n: n in [0..500] | IsPrime(Factorial(n)-1)]; // Vincenzo Librandi, Sep 07 2017
Select[Range[10^3], PrimeQ[ #!-1] &] (* Vladimir Joseph Stephan Orlovsky, May 01 2008 *)
is(n)=ispseudoprime(n!-1) \\ Charles R Greathouse IV, Mar 21 2013
from sympy import factorial, isprime A002982_list = [n for n in range(1,10**2) if isprime(factorial(n)-1)] # Chai Wah Wu, Apr 04 2021
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
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
The 6th primorial is A002110(6) = 2*3*5*7*11*13 = 30030, and 30030 - 1 = 30029 is a prime, so 6 is in the sequence.
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, Dec 25 2014
a057704[n_] := Flatten@Position[ Rest[FoldList[Times, 1, Prime[Range[n]]]] - 1, Integer?PrimeQ]; a057704[500] (* _Michael De Vlieger, Dec 25 2014 *)
lista(nn) = {s = 1; for(k=1, nn, s *= prime(k); if(ispseudoprime(s - 1), print1(k, ", ")); ); } \\ Altug Alkan, Dec 08 2015
is(n) = ispseudoprime(prod(k=1, n, prime(k)) - 1); \\ Altug Alkan, Dec 08 2015
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 *)
a(3)=30 where the prime factors are 2,3,5; since N-1=29, prime, N=30 is added to the sequence.
Select[FoldList[Times,1,Prime[Range[70]]],PrimeQ[#-1]&] (* Harvey P. Dale, Jan 09 2011 *)
c=0;t=1;vector(7,n,until( ispseudoprime( -1+t*=prime(c++)),);t)
Comments