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.

Previous Showing 11-20 of 57 results. Next

A054272 Number of primes in the interval [prime(n), prime(n)^2].

Original entry on oeis.org

2, 3, 7, 12, 26, 34, 55, 65, 91, 137, 152, 208, 251, 270, 315, 394, 471, 502, 591, 656, 685, 790, 864, 977, 1139, 1227, 1268, 1354, 1395, 1494, 1847, 1945, 2109, 2157, 2455, 2512, 2693, 2878, 3005, 3202, 3396, 3471, 3826, 3902, 4045, 4119, 4581, 5059
Offset: 1

Views

Author

Labos Elemer, May 05 2000

Keywords

Comments

These primes are candidates for fortunate numbers (A005235).
These are precisely the primes available for the solution of Aguilar's conjecture or Haga's conjecture in Carlos Rivera's The Prime Puzzles and Problems Connection, (conjecture 26). Aguilar's conjecture states that at least one prime will be available for placement on each row and column of a p X p square array. Haga's conjecture states that just p primes are required for such placement in any p X p array. - Enoch Haga, Jan 23 2002
Also number of times p_n (the n-th prime) occurs as the least prime factor (A020639) among numbers in range [(p_n)+1, ((p_n)^3)-1]. For n=1, p_1 = 2 and there are two even numbers in range [3, 7], namely 4 and 6, so a(1) = 2. See also A250474. - Antti Karttunen, Dec 05 2014
The number of consecutive primes after the leading 1 in the prime(n)-rough numbers. - Benedict W. J. Irwin, Mar 24 2016

Examples

			n=4, the zone in question is [7,49] and encloses a(4)=12 primes, as follows: {7,11,13,17,19,23,29,31,37,41,43,47}.
		

Crossrefs

One less than A250473, two less than A250474.
First differences: A251723.

Programs

  • Mathematica
    a[n_] := PrimePi[Prime[n]^2] - n + 1; Array[a, 50] (* Jean-François Alcover, Dec 07 2015 *)
  • PARI
    \\ A fast version:
    default(primelimit, 2^31 + 2^30);
    A054272(n) = 1 + primepi(prime(n)^2) - n;
    for(n=1, 5000, write("b054272.txt", n, " ", A054272(n)));
    \\ The following mirrors the given new formula. It is far from an optimal way to compute this sequence:
    allocatemem(234567890);
    A002110(n) = prod(i=1, n, prime(i));
    A054272(n) = { my(p2); p2 = prime(n)^2; sumdiv(A002110(n), d, moebius(d)*floor(p2/d)); };
    for(n=1, 22, print1(A054272(n),", ")); \\ Antti Karttunen, Dec 05 2014

Formula

a(n) = A000879(n) - n + 1.
From Antti Karttunen, Dec 05-08 2014: (Start)
a(n) = A250473(n) - 1 = A250474(n) - 2.
a(n) = sum_{d | A002110(n)} moebius(d) * floor((p_n)^2 / d). [Where p_n is the n-th prime (A000040(n)) and A002110(n) gives the product of the first n primes. Because the latter is always squarefree, one could also use Liouville's lambda (A008836) instead of Moebius mu (A008683).]
The ratio (a(n) * A002110(n)) / (A001248(n) * A005867(n)) stays near 1, which follows from the above summation formula. See also A249747.
(End)

A067836 Let a(1)=2, f(n)=a(1)*a(2)*...*a(n-1) for n>=1 and a(n)=nextprime(f(n)+1)-f(n) for n>=2, where nextprime(x) is the smallest prime > x.

Original entry on oeis.org

2, 3, 5, 7, 13, 11, 17, 19, 23, 37, 73, 29, 31, 43, 79, 53, 83, 67, 41, 47, 179, 149, 181, 103, 71, 59, 197, 167, 109, 137, 107, 251, 101, 157, 199, 283, 211, 277, 173, 127, 269, 61, 89, 271, 151, 191, 227, 311, 409, 577, 331, 281, 313, 307, 223, 491, 439, 233, 367
Offset: 1

Views

Author

Frank Buss (fb(AT)frank-buss.de), Feb 09 2002

Keywords

Comments

The terms are easily seen to be distinct. It is conjectured that every element is prime. Do all primes occur in the sequence?
All elements are prime and distinct through n=1000. - Robert Price, Mar 09 2013
All elements are prime and distinct through n=3724. - Dana Jacobsen, Feb 15 2015
With a(0) = 1, a(n) is the next smallest number not in the sequence such that a(n) + Product_{i=1..n-1} a(i) is prime. - Derek Orr, Jun 16 2015
A generalization of Fortunate's conjecture, cf. A005235. - M. F. Hasler, Nov 04 2024
Conjecture: there are infinitely many values of this sequence such that a(n) < n. - Davide Rotondo, Feb 28 2025

Crossrefs

Cf. A062894 has the indices of the primes in this sequence. A071290 has the sequence of f's. Also see A067362, A068192.
Cf. A005235 (Fortunate numbers).

Programs

  • Mathematica
    <Jayanta Basu, Aug 10 2013 *)
  • MuPAD
    f := 1:for n from 1 to 50 do a := nextprime(f+2)-f:f := f*a:print(a) end_for
    
  • PARI
    v=[2];n=2;while(n<500,s=n+prod(i=1,#v,v[i]);if(isprime(s)&&!vecsearch(vecsort(v),n),v=concat(v,n);n=1);n++);v \\ Derek Orr, Jun 16 2015
    
  • Python
    from sympy import nextprime
    def A067836_gen(): # generator of terms
        a, f = 2, 1
        yield 2
        while True:
            yield (a:=nextprime((f:=f*a)+1)-f)
    A067836_list = list(islice(A067836_gen(),30)) # Chai Wah Wu, Sep 09 2023

Extensions

Edited by Dean Hickerson, Mar 02 2002
Edited by Dean Hickerson and David W. Wilson, Jun 10 2002

A179975 Smallest k such that k*10^n is a sum of two successive primes.

Original entry on oeis.org

5, 3, 1, 6, 6, 6, 14, 6, 9, 19, 21, 21, 42, 93, 21, 6, 11, 2, 12, 111, 37, 39, 63, 38, 42, 24, 15, 15, 60, 6, 39, 82, 47, 58, 337, 49, 72, 25, 34, 21, 6, 107, 128, 96, 20, 2, 63, 231, 70, 7, 62, 144, 28, 151, 157, 33, 98, 55, 134, 162, 87, 201, 124, 303, 64, 106, 130, 13, 43
Offset: 0

Views

Author

Zak Seidov, Aug 04 2010

Keywords

Comments

From Robert G. Wilson v, Aug 11 2010: (Start)
A179975 n's such that a(n)=1: 3, 335, ..., .
A179975 First occurrence of k: 3, 18, 2, ???, 1, 4, 50, 162, 9, 335, 17, 19, 68, 7, 27, ..., .
Records: 5, 6, 14, 19, 21, 42, 93, 111, 337, 449, 862, 1049, 1062, 1122, 1280, 2278, 3168, 4290, ..., . (End)

Examples

			a(0)=5 because 5=2+3
a(1)=3 because 30=13+17
a(2)=1 because 100=47+53
a(3)=6 because 6000=2999+3001.
		

Crossrefs

Programs

  • Mathematica
    Join[{5,3},Reap[Do[Do[n=10^m k; If[n==PreviousPrime[n/2]+NextPrime[n/2],Sow[k];Break[]],{k,2000}],{m,2,50}]][[2,1]]]
    f[n_] := Block[{k = 1, tn = 10^n}, While[h = k*tn/2; NextPrime[h, -1] + NextPrime@h != k*tn, k++ ]; k]; f[1] = 3; Array[f, 70, 0] (* Robert G. Wilson v, Aug 11 2010 *)

Extensions

More terms from Robert G. Wilson v, Aug 11 2010

A038711 a(n) is the smallest m such that A002110(n) + m is prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 17, 19, 23, 37, 61, 1, 61, 71, 47, 107, 59, 61, 109, 89, 103, 79, 151, 197, 101, 103, 233, 223, 127, 223, 191, 163, 229, 643, 239, 157, 167, 439, 239, 199, 191, 199, 383, 233, 751, 313, 773, 607, 313, 383, 293, 443, 331, 283, 277, 271, 401, 307
Offset: 0

Views

Author

Labos Elemer, May 02 2000

Keywords

Comments

Any composite a(n) would disprove Fortune's conjecture, see A005235. - Jeppe Stig Nielsen, Oct 31 2003

Examples

			For n=11, 1 + A002110(11) = 200560490131 < 200560490197 = 67 + A002110(11); therefore, a(11)=1 but A005235(11)=67.
		

Crossrefs

Programs

  • Maple
    p:= proc(n) option remember; `if`(n<1, 1, p(n-1)*ithprime(n)) end:
    a:= n-> nextprime(p(n))-p(n):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 16 2020
  • Mathematica
    nmax=2^16384; npd=1;n=1;npd=npd*Prime[n]; While[npdLei Zhou, Feb 15 2005 *)
  • PARI
    a(n) = my(P=vecprod(primes(n))); nextprime(P+1) - P; \\ Michel Marcus, Dec 12 2023

Formula

a(n) = Min(1, A005235(n)); a(n)=1 for n=1, 2, 3, 4, 5, 11, 75, ...
a(n) = 1 for n=0, 1, 2, 3, 4, 5, 11, 75, ... (A014545); a(n) = A005235(n) otherwise. - Jeppe Stig Nielsen, Oct 31 2003
a(n) = A038710(n) - A002110(n). - Alois P. Heinz, Mar 16 2020

Extensions

a(0)=1 prepended by Alois P. Heinz, Mar 16 2020

A038710 a(n) is the smallest prime > product of the first n primes (A002110(n)).

Original entry on oeis.org

2, 3, 7, 31, 211, 2311, 30047, 510529, 9699713, 223092907, 6469693291, 200560490131, 7420738134871, 304250263527281, 13082761331670077, 614889782588491517, 32589158477190044789, 1922760350154212639131, 117288381359406970983379, 7858321551080267055879179
Offset: 0

Views

Author

Labos Elemer, May 02 2000

Keywords

Examples

			for n=1,2,3,4,5,11,75, A002110(n)+1 gives smaller primes than A002110(n)+p, where p is a fortunate number (prime). At n=5, both 2311 and 2333 are primes but the first is smaller.
		

Crossrefs

Programs

  • Maple
    p:= proc(n) option remember; `if`(n<1, 1, p(n-1)*ithprime(n)) end:
    a:= n-> nextprime(p(n)):
    seq(a(n), n=0..20);  # Alois P. Heinz, Mar 16 2020
  • Mathematica
    nmax = 2^16384; npd = 1; n = 1; npd = npd*Prime[n]; While[npd < nmax, cp = npd + 1; While[ ! (PrimeQ[cp]), cp = cp + 2]; Print[cp]; n = n + 1; npd = npd*Prime[n]] (* Lei Zhou, Feb 15 2005 *)
    NextPrime/@FoldList[Times,1,Prime[Range[25]]] (* Harvey P. Dale, Dec 17 2010 *)
  • PARI
    a(n) = nextprime(1+factorback(primes(n))); \\ Michel Marcus, Sep 25 2016; Dec 24 2022
    
  • Python
    from sympy import nextprime, primorial
    def a(n): return nextprime(primorial(n) if n else 1)
    print([a(n) for n in range(20)]) # Michael S. Branicky, Dec 24 2022

Formula

a(n) = A002110(n) + A038711(n). - Alois P. Heinz, Mar 16 2020

Extensions

Offset corrected, incorrect comment and formula removed, and more terms added by Jinyuan Wang, Mar 16 2020

A117825 Distance from n-th highly composite number (cf. A002182) to nearest prime.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 11, 13, 1, 11, 1, 17, 1, 1, 13, 13, 1, 1, 17, 1, 17, 1, 1, 17, 17, 17, 1, 1, 19, 37, 37, 1, 17, 23, 1, 29, 1, 1, 19, 1, 19, 23, 1, 19, 31, 1, 19, 1, 1, 1, 1, 23, 1, 29, 23, 23, 1, 23, 71, 37, 1, 1, 31, 1, 23, 53, 1, 31
Offset: 1

Views

Author

Bill McEachen, May 01 2006

Keywords

Comments

a) Conjecture: entries > 1 will always be prime. The entry will be larger than the largest prime factor of the highly composite number.
b) Will 1 always be the most common entry?
c) While a prime may always be located close to each highly composite number, is the converse false?
d) Is there always a prime between successive highly composite numbers?
From Antti Karttunen, Feb 26 2019: (Start)
The second sentence of point (a) follows as both gcd(n, A151799(n)) = 1 and gcd(A151800(n), n) = 1 for all n > 2 and the fact that the highly composite numbers are products of primorials, A002110 (with the least coprime prime > the largest prime factor). See also the conjectures and notes in A129912 and A141345. (End)

Examples

			a(5) = abs(12-11) = 1.
		

Crossrefs

Sequences tied to conjecture a): A228943, A228945.
Cf. also A005235, A060270.

Programs

Formula

a(1) = 1; for n > 1, a(n) = min(A141345(n), A324385(n)). - Antti Karttunen, Feb 26 2019

Extensions

More terms from Don Reble, May 02 2006

A083771 Rearrangement of primes such that every partial product + 1 is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 19, 29, 13, 59, 37, 31, 47, 67, 53, 41, 97, 73, 113, 103, 43, 71, 233, 61, 151, 109, 101, 251, 107, 587, 79, 223, 167, 311, 239, 137, 139, 359, 181, 257, 337, 163, 173, 881, 563, 149, 409, 157, 179, 293, 127, 331, 191, 269, 317, 83, 277, 23, 821, 373, 271, 283, 461, 569, 853, 487, 433, 647, 953, 383, 199, 367, 1231, 397, 307, 457, 691, 523, 463, 1061, 281, 787, 421, 197, 857, 1103, 347, 631, 499, 991, 643, 769, 983, 607, 811, 449, 1223, 733, 1327, 683, 1021
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 06 2003

Keywords

Comments

Though initial terms match it is different from A039726, in that a smaller prime may appear later.
Some of the larger entries may only correspond to probable primes.
A158076 suggests that the numbers in this sequence can be generated quite easily/quickly. Perhaps this sequence is a fast method to generate large probable primes. [Dmitry Kamenetsky, Mar 12 2009]
Records: 2, 3, 5, 7, 11, 19, 29, 59, 67, 97, 113, 233, 251, 587, 881, 953, 1231, 1327, 1553, 1657, 2383, 3251, 3769, 6737, 6947, 7103, 7879, 8263, 10159, 11369, 22003, ..., . - Robert G. Wilson v, Jul 20 2017
Position of the n_th prime: 1, 2, 3, 4, 5, 8, 472, 6, 57, 7, 11, 10, 15, 20, 12, 14, 9, 23, 13, 21, 17, 30, 55, 478, 16, 26, 19, 28, 25, 18, 50, 345, 35, 36, 45, 24, ..., . - Robert G. Wilson v, Jul 20 2017

Examples

			The n-th term is the smallest prime that is not already in the sequence, such that one plus the product of the first n terms is prime. [_Dmitry Kamenetsky_, Mar 12 2009]
		

Crossrefs

Cf. number of primality tests required for each term in this sequence is in A158076. [Dmitry Kamenetsky, Mar 12 2009]

Programs

  • Mathematica
    f[s_List] := Block[{p = Times @@ s, q = 2}, While[ MemberQ[s, q] || !PrimeQ[p*q + 1], q = NextPrime@ q]; Append[s, q]]; Nest[f, {2}, 63] (* Robert G. Wilson v, Jul 20 2017 *)
  • PARI
    { terms=100; a=A083772=vector(terms); a[1]=2; tmp=1; A083772[1]=3; for(k=2,terms, tmp=tmp*a[k-1]; p=1; while(1, until(isprime(p), p=p+2); for(m=1,k-1, if(p==a[m], break, if(m==k-1, if(isprime(tmp*p+1), a[k]=p; A083772[k]=tmp*p+1; print1(a[k],","); break(2))))))); a }

Extensions

More terms from Rick L. Shepherd, Mar 18 2004

A035345 Smallest prime > prime(1)*prime(2)*...*prime(n)+1.

Original entry on oeis.org

3, 5, 11, 37, 223, 2333, 30047, 510529, 9699713, 223092907, 6469693291, 200560490197, 7420738134871, 304250263527281, 13082761331670077, 614889782588491517, 32589158477190044789, 1922760350154212639131
Offset: 0

Views

Author

Keywords

Examples

			Next prime after 2*3*5 + 1 = 31 is 37, so a(3)=37.
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[Product[Prime@ k, {k, n}] + 1], {n, 0, 17}] (* Michael De Vlieger, Dec 02 2015 *)
  • PARI
    a(n) = nextprime(2+factorback(primes(n))); \\ Michel Marcus, Dec 24 2022
    
  • Python
    from sympy import nextprime, primorial
    def a(n): return nextprime(1 + (primorial(n) if n else 1))
    print([a(n) for n in range(18)]) # Michael S. Branicky, Dec 24 2022

Formula

a(n) = A002110(n) + A005235(n) for n > 0. - Jonathan Sondow, Dec 02 2015

A067362 a(n) = p - n!^2, where p is the smallest prime > n!^2+1.

Original entry on oeis.org

2, 3, 5, 11, 7, 11, 11, 13, 23, 17, 13, 59, 23, 31, 23, 41, 59, 67, 29, 31, 103, 389, 59, 107, 47, 127, 67, 181, 101, 97, 409, 37, 61, 43, 61, 47, 263, 109, 53, 199, 167, 337, 47, 131, 127, 73, 181, 257, 191, 101, 83, 79, 181, 167, 229, 859, 421, 433, 107, 971
Offset: 1

Views

Author

Frank Buss (fb(AT)frank-buss.de), Jan 19 2002

Keywords

Comments

The first 157 terms are primes. Are all terms prime? For n!^i, with 0
The first 200 terms are primes. - Jon Perry and Christ van Willegen, Mar 07 2003
The first 3003 terms are primes. - Dana Jacobsen, May 13 2015

Programs

  • Mathematica
    a[n_] := For[i=2, True, i++, If[PrimeQ[n!^2+i], Return[i]]]
    Table[p = NextPrime[(x = (n!)^2) + 1]; p - x, {n, 60}] (* Jayanta Basu, Aug 10 2013 *)
  • MuPAD
    for n from 1 to 50 do f := n!^2:a := nextprime(f+2)-f:print(a) end_for
    
  • PARI
    for(n=1,500,f=n!^2;print1(nextprime(f+2)-f, ", ")) \\  Dana Jacobsen, May 10 2015
    
  • Perl
    use ntheory ":all"; use Math::GMP qw/:constant/; for my $n (1..500) { my $f=factorial($n)**2; say "$n ",next_prime($f+1)-$f; } # Dana Jacobsen, May 10 2015

Extensions

Edited by Dean Hickerson, Mar 02 2002

A141345 Distance from the n-th highly composite number, A002182(n), to the next prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 5, 1, 5, 1, 7, 1, 1, 7, 7, 13, 17, 13, 1, 11, 1, 11, 1, 1, 19, 13, 1, 11, 1, 17, 1, 29, 13, 13, 1, 1, 17, 13, 23, 17, 19, 17, 17, 19, 1, 19, 23, 37, 53, 1, 17, 29, 43, 29, 1, 19, 19, 1, 23, 23, 1, 41, 41, 1, 53, 29, 19, 19, 23, 23, 47, 29, 23, 37, 1, 59, 71, 41, 1, 29, 37
Offset: 1

Author

T. D. Noe, Jun 26 2008

Keywords

Comments

It appears that (1) every term is either 1 or a prime and (2) every prime greater than 3 appears. Note that a prime can occur only a finite number of times. Similar to Fortune's conjecture (A005235) and McEachen's conjecture (A117825).
The arithmetic mean of a(n)/log(A002182(n)) for the terms 3..10000 is 1.513, i.e., a rough approximation is given by a(n) ~ log(A002182(n)^(3/2)). - A.H.M. Smeets, Dec 02 2020

Programs

  • Mathematica
    With[{s = Array[DivisorSigma[0, #] &, 10^6]}, Map[NextPrime[#] - # &@ FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* or *)
    Map[NextPrime[#] - # &, Import["https://oeis.org/A002182/b002182.txt", "Data"][[1 ;; 80, -1]] ] (* Michael De Vlieger, Dec 11 2020 *)
Previous Showing 11-20 of 57 results. Next