cp's OEIS Frontend

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.

Showing 1-9 of 9 results.

A257466 Smallest prime number p such that p + pps(1), p + pps(2), ..., p + pps(n) are all prime but p + pps(n+1) is not, where pps(n) is the partial primorial sum (A060389(n)).

Original entry on oeis.org

2, 17, 11, 5, 3, 101, 19469, 38669, 191459, 191, 59, 3877889, 494272241, 360772331, 6004094833991, 41320119600341
Offset: 0

Views

Author

Fred Schneider, Apr 25 2015

Keywords

Comments

The n-th member in the sequence m is the smallest prime with exactly n prime terms starting from m + 2.

Examples

			For prime 3: 3+2, 3+8, 3+38, 3+248 are all prime. 3+2558 = 13 * 197 is not. So a(4)= 3. (3 is the smallest prime that has exactly 4 terms.)
2 has zero terms because 2+2 is composite, so a(0)=2.
		

Crossrefs

Programs

  • PARI
    pps(n)=my(s, P=1); forprime(p=2, prime(n), s+=P*=p); s;
    isokpps(p, n) = {for (k=1, n, if (!isprime(p+pps(k)), return (0));); if (!isprime(p+pps(n+1)), return (1));}
    a(n) = {my(p = 2); while (!isokpps(p,n), p = nextprime(p+1)); p;} \\ Michel Marcus, May 02 2015

Extensions

a(15) from Fred Schneider, May 15 2015

A000918 a(n) = 2^n - 2.

Original entry on oeis.org

-1, 0, 2, 6, 14, 30, 62, 126, 254, 510, 1022, 2046, 4094, 8190, 16382, 32766, 65534, 131070, 262142, 524286, 1048574, 2097150, 4194302, 8388606, 16777214, 33554430, 67108862, 134217726, 268435454, 536870910, 1073741822, 2147483646, 4294967294, 8589934590, 17179869182, 34359738366, 68719476734, 137438953470
Offset: 0

Views

Author

Keywords

Comments

For n > 1, a(n) is the expected number of tosses of a fair coin to get n-1 consecutive heads. - Pratik Poddar, Feb 04 2011
For n > 2, Sum_{k=1..a(n)} (-1)^binomial(n, k) = A064405(a(n)) + 1 = 0. - Benoit Cloitre, Oct 18 2002
For n > 0, the number of nonempty proper subsets of an n-element set. - Ross La Haye, Feb 07 2004
Numbers j such that abs( Sum_{k=0..j} (-1)^binomial(j, k)*binomial(j + k, j - k) ) = 1. - Benoit Cloitre, Jul 03 2004
For n > 2 this formula also counts edge-rooted forests in a cycle of length n. - Woong Kook (andrewk(AT)math.uri.edu), Sep 08 2004
For n >= 1, conjectured to be the number of integers from 0 to (10^n)-1 that lack 0, 1, 2, 3, 4, 5, 6 and 7 as a digit. - Alexandre Wajnberg, Apr 25 2005
Beginning with a(2) = 2, these are the partial sums of the subsequence of A000079 = 2^n beginning with A000079(1) = 2. Hence for n >= 2 a(n) is the smallest possible sum of exactly one prime, one semiprime, one triprime, ... and one product of exactly n-1 primes. A060389 (partial sums of the primorials, A002110, beginning with A002110(1)=2) is the analog when all the almost primes must also be squarefree. - Rick L. Shepherd, May 20 2005
From the second term on (n >= 1), the binary representation of these numbers is a 0 preceded by (n - 1) 1's. This pattern (0)111...1110 is the "opposite" of the binary 2^n+1: 1000...0001 (cf. A000051). - Alexandre Wajnberg, May 31 2005
The numbers 2^n - 2 (n >= 2) give the positions of 0's in A110146. Also numbers k such that k^(k + 1) = 0 mod (k + 2). - Zak Seidov, Feb 20 2006
Partial sums of A155559. - Zerinvary Lajos, Oct 03 2007
Number of surjections from an n-element set onto a two-element set, with n >= 2. - Mohamed Bouhamida, Dec 15 2007
It appears that these are the numbers n such that 3*A135013(n) = n*(n + 1), thus answering Problem 2 on the Mathematical Olympiad Foundation of Japan, Final Round Problems, Feb 11 1993 (see link Japanese Mathematical Olympiad).
Let P(A) be the power set of an n-element set A and R be a relation on P(A) such that for all x, y of P(A), xRy if x is a proper subset of y or y is a proper subset of x and x and y are disjoint. Then a(n+1) = |R|. - Ross La Haye, Mar 19 2009
The permutohedron Pi_n has 2^n - 2 facets [Pashkovich]. - Jonathan Vos Post, Dec 17 2009
First differences of A005803. - Reinhard Zumkeller, Oct 12 2011
For n >= 1, a(n + 1) is the smallest even number with bit sum n. Cf. A069532. - Jason Kimberley, Nov 01 2011
a(n) is the number of branches of a complete binary tree of n levels. - Denis Lorrain, Dec 16 2011
For n>=1, a(n) is the number of length-n words on alphabet {1,2,3} such that the gap(w)=1. For a word w the gap g(w) is the number of parts missing between the minimal and maximal elements of w. Generally for words on alphabet {1,2,...,m} with g(w)=g>0 the e.g.f. is Sum_{k=g+2..m} (m - k + 1)*binomial((k - 2),g)*(exp(x) - 1)^(k - g). a(3)=6 because we have: 113, 131, 133, 311, 313, 331. Cf. A240506. See the Heubach/Mansour reference. - Geoffrey Critzer, Apr 13 2014
For n > 0, a(n) is the minimal number of internal nodes of a red-black tree of height 2*n-2. See the Oct 02 2015 comment under A027383. - Herbert Eberle, Oct 02 2015
Conjecture: For n>0, a(n) is the least m such that A007814(A000108(m)) = n-1. - L. Edson Jeffery, Nov 27 2015
Actually this follows from the procedure for determining the multiplicity of prime p in C(n) given in A000108 by Franklin T. Adams-Watters: For p=2, the multiplicity is the number of 1 digits minus 1 in the binary representation of n+1. Obviously, the smallest k achieving "number of 1 digits" = k is 2^k-1. Therefore C(2^k-2) is divisible by 2^(k-1) for k > 0 and there is no smaller m for which 2^(k-1) divides C(m) proving the conjecture. - Peter Schorn, Feb 16 2020
For n >= 0, a(n) is the largest number you can write in bijective base-2 (a.k.a. the dyadic system, A007931) with n digits. - Harald Korneliussen, May 18 2019
The terms of this sequence are also the sum of the terms in each row of Pascal's triangle other than the ones. - Harvey P. Dale, Apr 19 2020
For n > 1, binomial(a(n),k) is odd if and only if k is even. - Charlie Marion, Dec 22 2020
For n >= 2, a(n+1) is the number of n X n arrays of 0's and 1's with every 2 X 2 square having density exactly 2. - David desJardins, Oct 27 2022
For n >= 1, a(n+1) is the number of roots of unity in the unique degree-n unramified extension of the 2-adic field Q_2. Note that for each p, the unique degree-n unramified extension of Q_p is the splitting field of x^(p^n) - x, hence containing p^n - 1 roots of unity for p > 2 and 2*(2^n - 1) for p = 2. - Jianing Song, Nov 08 2022

Examples

			a(4) = 14 because the 14 = 6 + 4 + 4 rationals (in lowest terms) for n = 3 are (see the Jun 14 2017 formula above): 1/2, 1, 3/2, 2, 5/2, 3; 1/4, 3/4, 5/4, 7/4; 1/8, 3/8, 5/8, 7/8. - _Wolfdieter Lang_, Jun 14 2017
		

References

  • H. T. Davis, Tables of the Mathematical Functions. Vols. 1 and 2, 2nd ed., 1963, Vol. 3 (with V. J. Fisher), 1962; Principia Press of Trinity Univ., San Antonio, TX, Vol. 2, p. 212.
  • Ralph P. Grimaldi, Discrete and Combinatorial Mathematics: An Applied Introduction, Fifth Edition, Addison-Wesley, 2004, p. 134. - Mohammad K. Azarian, Oct 27 2011
  • S. Heubach and T. Mansour, Combinatorics of Compositions and Words, Chapman and Hall, 2009 page 86, Exercise 3.16.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 33.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. H. Voigt, Theorie der Zahlenreihen und der Reihengleichungen, Goschen, Leipzig, 1911, p. 31.

Crossrefs

Row sums of triangle A026998.
Cf. A058809 (3^n-3, n>0).

Programs

  • Haskell
    a000918 = (subtract 2) . (2 ^)
    a000918_list = iterate ((subtract 2) . (* 2) . (+ 2)) (- 1)
    -- Reinhard Zumkeller, Apr 23 2013
    
  • Magma
    [2^n - 2: n in [0..40]]; // Vincenzo Librandi, Jun 23 2011
    
  • Maple
    seq(2^n-2,n=0..20) ;
  • Mathematica
    Table[2^n - 2, {n, 0, 29}] (* Alonso del Arte, Dec 01 2012 *)
  • PARI
    a(n)=2^n-2 \\ Charles R Greathouse IV, Jun 16 2011
    
  • Python
    def A000918(n): return (1<Chai Wah Wu, Jun 10 2025

Formula

a(n) = 2*A000225(n-1).
G.f.: 1/(1 - 2*x) - 2/(1 - x), e.g.f.: (e^x - 1)^2 - 1. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 07 2001
For n >= 1, a(n) = A008970(n + 1, 2). - Philippe Deléham, Feb 21 2004
G.f.: (3*x - 1)/((2*x - 1)*(x - 1)). - Simon Plouffe in his 1992 dissertation for the sequence without the leading -1
a(n) = 2*a(n - 1) + 2. - Alexandre Wajnberg, Apr 25 2005
a(n) = A000079(n) - 2. - Omar E. Pol, Dec 16 2008
a(n) = A058896(n)/A052548(n). - Reinhard Zumkeller, Feb 14 2009
a(n) = A164874(n - 1, n - 1) for n > 1. - Reinhard Zumkeller, Aug 29 2009
a(n) = A173787(n,1); a(n) = A028399(2*n)/A052548(n), n > 0. - Reinhard Zumkeller, Feb 28 2010
a(n + 1) = A027383(2*n - 1). - Jason Kimberley, Nov 02 2011
G.f.: U(0) - 1, where U(k) = 1 + x/(2^k + 2^k/(x - 1 - x^2*2^(k + 1)/(x*2^(k + 1) - (k + 1)/U(k + 1) ))); (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Dec 01 2012
a(n+1) is the sum of row n in triangle A051601. - Reinhard Zumkeller, Aug 05 2013
a(n+1) = A127330(n,0). - Reinhard Zumkeller, Nov 16 2013
a(n) = Sum_{k=1..n-1} binomial(n, k) for n > 0. - Dan McCandless, Nov 14 2015
From Miquel Cerda, Aug 16 2016: (Start)
a(n) = A000225(n) - 1.
a(n) = A125128(n-1) - A000325(n).
a(n) = A095151(n) - A125128(n) - 1. (End)
a(n+1) = 2*(n + Sum_{j=1..n-1} (n-j)*2^(j-1)), n >= 1. This is the number of the rationals k/2, k = 1..2*n for n >= 1 and (2*k+1)/2^j for j = 2..n, n >= 2, and 2*k+1 < n-(j-1). See the example for n = 3 below. Motivated by the proposal A287012 by Mark Rickert. - Wolfdieter Lang, Jun 14 2017

Extensions

Maple programs fixed by Vaclav Kotesovec, Dec 13 2014

A006939 Chernoff sequence: a(n) = Product_{k=1..n} prime(k)^(n-k+1).

Original entry on oeis.org

1, 2, 12, 360, 75600, 174636000, 5244319080000, 2677277333530800000, 25968760179275365452000000, 5793445238736255798985527240000000, 37481813439427687898244906452608585200000000, 7517370874372838151564668004911177464757864076000000000, 55784440720968513813368002533861454979548176771615744085560000000000
Offset: 0

Views

Author

Keywords

Comments

Product of first n primorials: a(n) = Product_{i=1..n} A002110(i).
Superprimorials, from primorials by analogy with superfactorials.
Smallest number k with n distinct exponents in its prime factorization, i.e., A071625(k) = n.
Subsequence of A130091. - Reinhard Zumkeller, May 06 2007
Hankel transform of A171448. - Paul Barry, Dec 09 2009
This might be a good place to explain the name "Chernoff sequence" since his name does not appear in the References or Links as of Mar 22 2014. - Jonathan Sondow, Mar 22 2014
Pickover (1992) named this sequence after Paul Chernoff of California, who contributed this sequence to his book. He was possibly referring to American mathematician Paul Robert Chernoff (1942 - 2017), a professor at the University of California. - Amiram Eldar, Jul 27 2020

Examples

			a(4) = 360 because 2^3 * 3^2 * 5 = 1 * 2 * 6 * 30 = 360.
a(5) = 75600 because 2^4 * 3^3 * 5^2 * 7 = 1 * 2 * 6 * 30 * 210 = 75600.
		

References

  • Clifford A. Pickover, Mazes for the Mind, St. Martin's Press, NY, 1992, p. 351.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James K. Strayer, Elementary number theory, Waveland Press, Inc., Long Grove, IL, 1994. See p. 37.

Crossrefs

Cf. A000178 (product of first n factorials), A007489 (sum of first n factorials), A060389 (sum of first n primorials).
A000142 counts divisors of superprimorials.
A000325 counts uniform divisors of superprimorials.
A008302 counts divisors of superprimorials by bigomega.
A022915 counts permutations of prime indices of superprimorials.
A076954 is a sister-sequence.
A118914 has row a(n) equal to {1..n}.
A124010 has row a(n) equal to {n..1}.
A130091 lists numbers with distinct prime multiplicities.
A317829 counts factorizations of superprimorials.
A336417 counts perfect-power divisors of superprimorials.
A336426 gives non-products of superprimorials.

Programs

  • Haskell
    a006939 n = a006939_list !! n
    a006939_list = scanl1 (*) a002110_list -- Reinhard Zumkeller, Jul 21 2012
    
  • Magma
    [1] cat [(&*[NthPrime(k)^(n-k+1): k in [1..n]]): n in [1..15]]; // G. C. Greubel, Oct 14 2018
    
  • Maple
    a := []; printlevel := -1; for k from 0 to 20 do a := [op(a),product(ithprime(i)^(k-i+1),i=1..k)] od; print(a);
  • Mathematica
    Rest[FoldList[Times,1,FoldList[Times,1,Prime[Range[15]]]]] (* Harvey P. Dale, Jul 07 2011 *)
    Table[Times@@Table[Prime[i]^(n - i + 1), {i, n}], {n, 12}] (* Alonso del Arte, Sep 30 2011 *)
  • PARI
    a(n)=prod(k=1,n,prime(k)^(n-k+1)) \\ Charles R Greathouse IV, Jul 25 2011
    
  • Python
    from math import prod
    from sympy import prime
    def A006939(n): return prod(prime(k)**(n-k+1) for k in range(1,n+1)) # Chai Wah Wu, Aug 12 2025

Formula

a(n) = m(1)*m(2)*m(3)*...*m(n), where m(n) = n-th primorial number. - N. J. A. Sloane, Feb 20 2005
a(0) = 1, a(n) = a(n - 1)p(n)#, where p(n)# is the n-th primorial A002110(n) (the product of the first n primes). - Alonso del Arte, Sep 30 2011
log a(n) = n^2(log n + log log n - 3/2 + o(1))/2. - Charles R Greathouse IV, Mar 14 2011
A181796(a(n)) = A000110(n+1). It would be interesting to have a bijective proof of this theorem, which is stated at A181796 without proof. See also A336420. - Gus Wiseman, Aug 03 2020

Extensions

Corrected and extended by Labos Elemer, May 30 2001

A070826 One half of product of first n primes A000040.

Original entry on oeis.org

1, 3, 15, 105, 1155, 15015, 255255, 4849845, 111546435, 3234846615, 100280245065, 3710369067405, 152125131763605, 6541380665835015, 307444891294245705, 16294579238595022365, 961380175077106319535, 58644190679703485491635, 3929160775540133527939545, 278970415063349480483707695
Offset: 1

Views

Author

Wolfdieter Lang, May 10 2002

Keywords

Comments

Also, with offset 0, product of first n odd primes. - N. J. A. Sloane, Feb 26 2017
Identical to A002110(n)/2, n>=1.
a(n+1) is the least odd number with exactly n distinct prime divisors. - Labos Elemer, Mar 24 2003
Also, odd numbers n for which sigma(n)*phi(n)/n^2 reaches a new record low, monotonically decreasing to the lower bound 8/Pi^2. - M. F. Hasler, Jul 08 2025

Crossrefs

Cf. A003266 (for Fibonacci), A070825 (for Lucas), A003046 (for Catalan).
Cf. also A002110, A024451, A060389, A091852, A276086, A203008 [= A003415(a(1+n))].
Range of A196529.

Programs

  • Maple
    a:=n->mul(ithprime(j), j=2..n):seq(a(n), n=1..17); # Zerinvary Lajos, Aug 24 2008
  • Mathematica
    Rest[ FoldList[ Times, 1, Prime[ Range[ 18]] ]]/2 (* Robert G. Wilson v, Feb 17 2004 *)
    FoldList[Times, 1, Prime[Range[2, 18]]] (* Zak Seidov, Jan 26 2009 *)
  • PARI
    a(n) = prod(k=2, n, prime(k)) \\ Michel Marcus, Mar 25 2017, simplified by M. F. Hasler, Jul 09 2025
    
  • Python
    from sympy import primorial
    def A070826(n): return primorial(n)>>1 # Chai Wah Wu, Jul 21 2022

Formula

a(n) = A002110(n)/2.
From Antti Karttunen, Feb 06 2024: (Start)
a(1) = 1, and for n > 1, a(n) = A276086(A060389(n-1)).
a(n) = A024451(n) - 2*A203008(n-1).
(End)
a(n) = A000040(n)*a(n-1) for n > 1, a(1) = 1. - M. F. Hasler, Jul 09 2025

Extensions

Formula corrected by Gary Detlefs, Dec 07 2011

A373158 Fully additive with a(p) = p# for prime p, where x# is the primorial A034386(x).

Original entry on oeis.org

0, 2, 6, 4, 30, 8, 210, 6, 12, 32, 2310, 10, 30030, 212, 36, 8, 510510, 14, 9699690, 34, 216, 2312, 223092870, 12, 60, 30032, 18, 214, 6469693230, 38, 200560490130, 10, 2316, 510512, 240, 16, 7420738134810, 9699692, 30036, 36, 304250263527210, 218, 13082761331670030, 2314, 42, 223092872, 614889782588491410, 14
Offset: 1

Views

Author

Antti Karttunen, May 27 2024

Keywords

Comments

Completely additive with a(p^e) = e * A002110(A000720(p)).

Crossrefs

Programs

  • PARI
    A373158(n) = { my(f=factor(n)); sum(i=1, #f~, f[i, 2]*prod(i=1,primepi(f[i, 1]),prime(i))); }; \\ corrected Jun 25 2024

Formula

From Antti Karttunen, Jun 25 2024, Oct 28 2024: (Start)
a(n) = A276085(A003961(n)).
For n >= 1, a(A000040(n)) = A002110(n), a(A002110(n)) = A060389(n).
(End)

Extensions

Data [first incorrect term was at a(8)] and the faulty PARI-program corrected by Antti Karttunen, Jun 25 2024

A203008 (n-1)-st elementary symmetric function of the first n odd primes; a(0) = 0.

Original entry on oeis.org

0, 1, 8, 71, 886, 12673, 230456, 4633919, 111429982, 3343015913, 106868339918, 4054408822031, 169941130770676, 7459593754902673, 357142287146260646, 19235986110046059943, 1151217759731312559002, 71185663518687172418657
Offset: 0

Views

Author

Clark Kimberling, Dec 29 2011

Keywords

Comments

Arithmetic derivative of the product of first n odd primes. - Antti Karttunen, Jan 31 2024
Primes occur at indices: 3, 19, 23, 117, 119, 127, 161, 209, ..., and they are: 71, 346723099672193960193396979, 15360643606799479140185671512081451, ... - Antti Karttunen, Feb 06 2024

Crossrefs

Cf. A000035, A003415, A024451, A060389, A070826 (n-th. symm. function), A071148 (1st symm. func), A327860.

Programs

  • Mathematica
    f[k_] := Prime[k + 1]; t[n_] := Table[f[k], {k, 1, n}]
    a[n_] := SymmetricPolynomial[n - 1, t[n]]
    Table[a[n], {n, 1, 16}] (* A203008 *)
  • PARI
    A002110(n) = prod(i=1,n,prime(i));
    A003415(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]/f[i, 1]));
    A203008(n) = if(!n,n,A003415(A002110(1+n)/2)); \\ Antti Karttunen, Jan 31 2024

Formula

From Antti Karttunen, Jan 31 2024 and Feb 06 2024: (Start)
a(n) = A003415(A070826(1+n)) = (1/2)*(A024451(1+n)-A070826(1+n)).
For n >= 1, a(n) = A327860(A060389(n)).
A000035(a(n)) = A000035(n).
(End)

Extensions

Term a(0) = 0 prepended by Antti Karttunen, Jan 31 2024

A217723 a(n) = (sum of first n primorial numbers) minus 1.

Original entry on oeis.org

1, 7, 37, 247, 2557, 32587, 543097, 10242787, 233335657, 6703028887, 207263519017, 7628001653827, 311878265181037, 13394639596851067, 628284422185342477, 33217442899375387207, 1955977793053588026277, 119244359152460559009547
Offset: 1

Views

Author

Paul Larm, Mar 21 2013

Keywords

Examples

			For n = 4, a(4) = 2 + 2*3 + 2*3*5 + 2*3*5*7 - 1 = 247.
		

Crossrefs

Equals A060389 - 1. Cf. A223546, A223548.

Programs

  • Mathematica
    Accumulate[Denominator[Accumulate[1/Prime[Range[20]]]]] - 1 (* Alonso del Arte, Mar 21 2013 *)
    Accumulate[Table[Fold[Times,Prime[Range[n]]],{n,20}]]-1 (* Harvey P. Dale, May 23 2020 *)

Formula

a(1) = P(1)# - 1, a(2) = P(1)# + P(2)# -1; where P(n)# is the product of first n prime numbers (primorial#).

A084737 Beginning with 1, numbers such that (a(n+2)-a(n+1))/(a(n+1)-a(n)) = prime(n).

Original entry on oeis.org

1, 2, 4, 10, 40, 250, 2560, 32590, 543100, 10242790, 233335660, 6703028890, 207263519020, 7628001653830, 311878265181040, 13394639596851070, 628284422185342480, 33217442899375387210, 1955977793053588026280
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 14 2003

Keywords

Comments

Successive differences are primorials.

Examples

			a(3) = 4, a(4) = 10 and a(5) = 40 and (40-10)/(10-4) = 5 = prime(3).
		

Crossrefs

Programs

  • Mathematica
    Join[{1},Accumulate[FoldList[Times,1,Prime[Range[20]]]]+1] (* Harvey P. Dale, Dec 14 2011 *)

Formula

From Antti Karttunen, Feb 06 2024: (Start)
For n >= 1, a(n) = A276085(2*A002110(n-1)).
For n >= 2, a(n) = 1 + A143293(n-2).
For n >= 3, a(n) = 2 + A060389(n-2).
(End)

Extensions

More terms from Vladeta Jovovic, Jun 17 2003

A225841 Numbers n such that the sum of first n primorial numbers is divisible by n.

Original entry on oeis.org

1, 2, 4, 523, 1046, 2092
Offset: 1

Views

Author

Alex Ratushnyak, May 21 2013

Keywords

Comments

The k-th primorial number is defined as the product of the first k primes.
The next term, if it exists, is greater than 14000000. - Alex Ratushnyak, Jun 13 2013
If a prime p | a(n) for some n, then p = 2, p = 523, or p > 10^8. Any such prime is itself a member of this sequence. From this (and a small amount of additional calculation) it follows that any other terms below 10^10 are of the form 2^k * p for p > 10^8. - Charles R Greathouse IV, Feb 09 2014

Examples

			2 + 2*3 + 2*3*5 + 2*3*5*7 = 2 + 6 + 30 + 210 = 248, because 248 is divisible by 4, the latter is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    With[{nn=2100},Select[Thread[{Accumulate[FoldList[Times,Prime[ Range[ nn]]]],Range[nn]}],Divisible[ #[[1]],#[[2]]]&]][[All,2]] (* Harvey P. Dale, Jul 29 2021 *)
  • PARI
    list(maxx)={n=prime(1); cnt=1;summ=0;scnt=0;
    while(n<=maxx,summ=summ+prodeuler(x=1,prime(cnt),x);
    if(summ%cnt==0,scnt++;print(scnt,"  ",cnt) );cnt++;n=nextprime(n+1) ); }
    \\note MUST increase precision to 10000+ digits \\Bill McEachen, Feb 04 2014
    
  • PARI
    P=1;S=n=0;forprime(p=2,1e4,S+=P*=p;if(S%n++==0,print1(n", "))) \\ Charles R Greathouse IV, Feb 05 2014
    
  • PARI
    is(n)=my(q=prime(n),P=Mod(1,n),S);forprime(p=2,q,S+=P*=p);!S \\ Charles R Greathouse IV, Feb 05 2014
    
  • Python
    primes = []
    n = 1
    sum = 2
    primorial = 6
    def addPrime(k):
      global n, sum, primorial
      for p in primes:
        if k%p==0:  return
        if p*p > k:  break
      primes.append(k)
      sum += primorial
      primorial *= k
      n += 1
      if sum % n == 0:  print(n, end=',')
    print(1, end=',')
    for p in range(5, 100000, 6):
      addPrime(p)
      addPrime(p+2)
    
  • Python
    from itertools import accumulate, count, islice
    from operator import mul
    from sympy import prime
    def A225841_gen(): return (i+1 for i, m in enumerate(accumulate(accumulate((prime(n) for n in count(1)), mul))) if m % (i+1) == 0)
    A225841_list = list(islice(A225841_gen(),6)) # Chai Wah Wu, Feb 23 2022
Showing 1-9 of 9 results.