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 130 results. Next

A117092 Numbers n such that nextprime(2*n) > 2*nextprime(n) (here nextprime = A007918; if p is prime then nextprime(p) = p).

Original entry on oeis.org

2, 3, 4, 5, 7, 10, 11, 12, 13, 16, 17, 19, 22, 23, 27, 28, 29, 31, 37, 40, 41, 42, 43, 45, 46, 47, 52, 53, 57, 58, 59, 60, 61, 66, 67, 70, 71, 72, 73, 79, 82, 83, 87, 88, 89, 97, 100, 101, 102, 103, 106, 107, 108, 109, 112, 113, 126, 127, 129, 130, 131, 136
Offset: 1

Views

Author

Mohammed Bouayoun (mohammed.bouayoun(AT)sanef.com), Apr 18 2006

Keywords

Comments

Contains all primes (A000040), and the intersection of A006093 and A047845. - Robert Israel, Mar 30 2016

Examples

			nextprime(2*12)=29 and nextprime(2)*nextprime(12)=2*13 then 12 is member because 29>26.
		

Crossrefs

Programs

  • Maple
    select(t -> nextprime(2*t) > 2*nextprime(t-1),[$1..100]); # Robert Israel, Mar 30 2016
  • Mathematica
    Select[Range@100, NextPrime[2 #] > 2 NextPrime[# - 1] &] (* Ivan Neretin, Mar 30 2016 *)
  • PARI
    for(i=1,100,if(nextprime(2*i)
    				

Extensions

Corrected by T. D. Noe, Oct 25 2006

A117842 Partial sum of smallest prime >= n (A007918).

Original entry on oeis.org

2, 4, 6, 9, 14, 19, 26, 33, 44, 55, 66, 77, 90, 103, 120, 137, 154, 171, 190, 209, 232, 255, 278, 301, 330, 359, 388, 417, 446, 475, 506, 537, 574, 611, 648, 685, 722, 759, 800, 841, 882, 923, 966, 1009, 1056, 1103, 1150, 1197, 1250, 1303, 1356
Offset: 0

Views

Author

Jonathan Vos Post, Apr 30 2006

Keywords

Comments

Bertrand's [1845] postulate as proved by Chebyshev [1850] is versified: "Chebyshev said it, but I'll say it again; There's always a prime between n and 2n." [N. J. Fine in Schechter, 1998]. This sequence is the partial sum of the least such primes. It differs from A007504 "sum of first n primes" because of the repetitions in A007918.

Examples

			a(50) = 2+ 2+ 2+ 3+ 5+ 5+ 7+ 7+ 11+ 11+ 11+ 11+ 13+ 13+ 17+ 17+ 17+ 17+ 19+ 19+ 23+ 23+ 23+ 23+ 29+ 29+ 29+ 29+ 29+ 29+ 31+ 31+ 37+ 37+ 37+ 37+ 37+ 37+ 41+ 41+ 41+ 41+ 43+ 43+ 47+ 47+ 47+ 47+ 53+ 53+ 53 = 1356.
		

References

  • Schechter, B., My Brain is Open: The Mathematical Journeys of Paul Erdős. New York: Simon and Schuster, 1998.

Crossrefs

Programs

  • Maple
    ListTools:-PartialSums(map(nextprime,[$-1..100])); # Robert Israel, Aug 09 2020
  • Mathematica
    Accumulate[NextPrime[Range[0,50]-1]] (* Harvey P. Dale, Nov 13 2022 *)

Formula

a(n) = SUM[i=0..n] A007918(n). a(n) = SUM[i=0..n] smallest prime >= i. a(n) = SUM[i=0..n] nextprime(i).

Extensions

Corrected by T. D. Noe, Nov 01 2006

A157939 Numbers n divisible by precprime(sqrt(n)) or nextprime(sqrt(n)) but not both, where precprime=A007917, nextprime=A007918.

Original entry on oeis.org

8, 10, 12, 18, 20, 21, 24, 28, 30, 40, 42, 45, 55, 56, 63, 66, 70, 84, 88, 91, 98, 99, 105, 110, 112, 119, 130, 132, 154, 156, 165, 170, 182, 187, 195, 204, 208, 234, 238, 247, 255, 260, 272, 273, 286, 304, 306, 340, 342, 357, 368, 380, 391, 399, 414, 418, 456
Offset: 1

Views

Author

M. F. Hasler, Mar 10 2009

Keywords

Comments

Equal to the union of its disjoint subsequences A157938 and A157940.

Examples

			For n=1,2,3, precprime(sqrt(n)) is undefined, so these are not considered here. a(1) = 8 is divisible by 2=precprime(sqrt(8)) but not by 3=nextprime(sqrt(8)).
a(2) = 10 is divisible by 5=nextprime(sqrt(10)) but not by 3=precprime(sqrt(8)).
n=4,6,9,... are excluded since divisible by both precprime(sqrt(n)) and nextprime(sqrt(n)). (Note that precprime=A007917 and nextprime=A007918 are defined using weak inequalities.) n=5,7,11,13 but also 14 are excluded since not divisible by precprime(sqrt(n)) nor by nextprime(sqrt(n)).
		

Programs

  • Mathematica
    ndQ[n_]:=Module[{s=Sqrt[n]},Total[Boole[{Divisible[n,NextPrime[ s]], Divisible[ n, NextPrime[ s,-1]]}]]==1]; Select[Range[5,500],ndQ] (* Harvey P. Dale, Mar 19 2019 *)
  • PARI
    for( n=4,999, !(n % nextprime(sqrtint(n-1)+1)) != !(n % precprime(sqrtint(n))) & print1(n",")) /* sqrtint(n-1)+1 avoids rounding errors but can be replaced by sqrt(n) for small n */

Formula

A157939 = A157938 union A157940 = A157937 /\ A157941 = A157936 /\ A157942, where A /\ B = (A u B) \ (A n B) = (A \ B) u (B \ A) is the symmetric difference; A157937 intersect A157941 = A006094 = (A157936 intersect A157942) \ A001248.

A181616 a(1)=5; thereafter a(2n) = nextprime(a(2n-1)^2), a(2n+1) = nextprime(floor(2*a(2n)/(a(2n-1) + 1))) where nextprime(.) is A007918(.).

Original entry on oeis.org

5, 29, 11, 127, 23, 541, 47, 2213, 97, 9413, 193, 37253, 389, 151337, 787, 619373, 1579, 2493259, 3163, 10004573, 6329, 40056253, 12659, 160250297, 25321, 641153069, 50647, 2565118639, 101293, 10260271859, 202591, 41043113401, 405199
Offset: 1

Views

Author

Bill McEachen, Jan 30 2011

Keywords

Comments

This gives a sawtooth log plot a bit reminiscent of Goldbach's comet, with wave frequency and amplitude increasing indefinitely. I started at 5 for no particular reason.
The two "lines" in the graph approach ratio 2.0 and 4.0 respectively for consecutive terms. The two are then (5, 11, 23, 47, ...) and (29, 127, 541, 2213, ...). - Bill McEachen, Sep 27 2013

Examples

			Beginning at 5 (n=1), a(2) via nextprime(5^2) = 29.
Divisor = ceiling(5/2) = 3 so a(3) = nextprime(floor(29/3)) = 11.
Then repeat: a(4) via nextprime(11^2) = 127.
Divisor = ceiling(11/2) = 6 so a(5) = nextprime(floor(127/6)) = 23.
		

Programs

  • Maple
    A007491 := proc(n) nextprime(n^2) ; end proc:
    A181616 := proc(n) option remember; if n = 1 then 5; elif type(n,'even') then A007491(procname(n-1)) ; else 2*procname(n-1)/(procname(n-2)+1) ; nextprime(floor(%)) ; end if; end proc: # R. J. Mathar, Feb 09 2011
  • Mathematica
    a[1] = 5; a[n_] := a[n] = If[OddQ@ n, NextPrime[ a[n - 1]/Ceiling[ a[n - 2]/2]], NextPrime[ a[n - 1]^2]]; Array[a, 33]
  • PARI
    \\ example call newseq9(2,50) to use square power, 1st 50 terms
    \\  I never tried any power but 2
    newseq9(a,iend)=
    {
    a=floor(a);
    if(a<2,a=2);
    i5=5;
    print(i5);
    for(n=1,iend,
      i6=nextprime(i5^a);
      b=ceil(i5/2);   \\ vary as f{i5}
      i7=nextprime(floor(i6/b));
      print(i6);
      print(i7);
      i5=i7
    );  \\end FOR
    print("Designed pgm exit (a,b) ...",a," , ",b);
    }

A262463 If n is prime a(n) = n else a(n) = nextprime(reverse(n)), where "next prime" is the smallest prime >= n, see A007918.

Original entry on oeis.org

2, 2, 3, 5, 5, 7, 7, 11, 11, 2, 11, 23, 13, 41, 53, 61, 17, 83, 19, 2, 13, 23, 23, 43, 53, 67, 73, 83, 29, 3, 31, 23, 37, 43, 53, 67, 37, 83, 97, 5, 41, 29, 43, 47, 59, 67, 47, 89, 97, 5, 17, 29, 53, 47, 59, 67, 79, 89, 59, 7, 61, 29, 37, 47, 59, 67, 67, 89, 97, 7, 71, 29, 73, 47, 59, 67, 79, 89, 79, 11, 19, 29
Offset: 1

Views

Author

Maghraoui Abdelkader, Sep 23 2015

Keywords

Examples

			For n=7 a(7)=7.
For n=12, reverse(12)=21; a(12)=nextprime(21)=23.
		

Crossrefs

Programs

  • Mathematica
    Table[Which[PrimeQ[n],n,PrimeQ[IntegerReverse[n]],IntegerReverse[n], True, NextPrime[ IntegerReverse[ n]]],{n,100}] (* Harvey P. Dale, May 12 2018 *)
  • PARI
    rev(n)={d=digits(n); p=""; for(i=1, #d, p=concat(Str(d[i]), p)); return(eval(p))}
    i=0; t=vector(200);
    findn(n)={if(isprime(n),t[i++]=n, a=rev(n); b=nextprime(a); t[i++]=b); }
    for(n=1,200,findn(n)); t

Formula

a(n)=n if n is prime;
else b=reverse(n);
if b is prime a(n)=b else a(n)=nextprime(b);
(using "next prime" function as "smallest prime >= n"; see A007918. )

A129541 Primes of the form p^2 + q^2 + A007918(p + q) - p - q, where p and q are consecutive primes.

Original entry on oeis.org

13, 37, 2333, 51229, 84131, 141539, 273821, 591893, 649813, 744221, 889877, 911269, 1065829, 2146619, 2205013, 2766007, 2913773, 3090187, 3348893, 3374821, 3505979, 3942493, 4095547, 4885981, 5766421, 6125029, 6336829
Offset: 1

Views

Author

J. M. Bergot, Jun 08 2007

Keywords

Comments

The trial number was 80 pairs of consecutive primes to produce seven primes. Oddly it seems more productive as the pairs of primes increase in value, rather unusual for generators of primes. Perhaps an extension will confirm this.

Examples

			Take consecutive primes 31 and 37. The sum 31 + 37 = 68 and is three less than the next prime 71. Hence 31^2 + 37^2 + 3 = 961+1369+3=2333 which is a prime that belongs to the sequence.
		

Programs

  • Mathematica
    cp[{a_,b_}]:=a^2+b^2+NextPrime[a+b]-a-b; Join[{13},Select[cp/@ Partition[ Prime[Range[500]],2,1],PrimeQ]] (* Harvey P. Dale, Nov 16 2013 *)
  • PARI
    p=2;forprime(q=3,1e4,t=p^2+q^2+nextprime(p+q)-p-q;if(isprime(t),print1(t","));p=q)

Formula

For two consecutive primes p and q, add them and subtract that amount from the nearest prime greater than p+q. Call this number d; then see whether p^2 + q^2 + d is a prime.

Extensions

Extended, edited, and program added by Charles R Greathouse IV, Nov 11 2009

A383358 Numbers k >= 2 such that (S(k) - I(k)) / (k - 1) is an integer, where S(k) = Sum_{i=2..k} A007918(i) and I(k) = Sum_{i=2..k} A007917(i).

Original entry on oeis.org

2, 3, 16, 21, 23, 39, 49, 381, 396, 24963, 39762, 40101, 40276, 4431583, 21553054, 36244531, 2183957515, 2183971285, 2183971945, 3636636400, 3636636411, 6063744535, 16846463635, 28070695902, 215867952637, 359222008925, 597739400517, 597739400913, 597739426757
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 24 2025

Keywords

Examples

			k = 16: ((Sum_{i=2..k} A007918(i)) - (Sum_{i=2..k} A007917(i))) / (k - 1) = (150 - 120) / 15 = 2, thus k = 16 is a term.
		

References

  • Kenichiro Kashihara, Problem 10 in Comments and topics on Smarandache notions and problems, Erhus University Press, USA, 1996.

Crossrefs

Programs

  • Mathematica
    With[{m = 10^7}, (Position[Accumulate[Table[If[PrimeQ[n], 0, NextPrime[n] - NextPrime[n, -1]], {n, 2, m+1}]]/Range[m], ?IntegerQ] // Flatten) + 1] (* _Amiram Eldar, Apr 24 2025 *)
  • PARI
    list(lim) = {my(k = 0, c = 0, p = 2, g); forprime(q = 3, lim, g = q-p; k++; if(!(c % k), print1(k+1, ", ")); for(i = 1, g-1, c += g; k++; if(!(c % k), print1(k+1, ", "))); p = q);} \\ Amiram Eldar, Apr 24 2025

Extensions

a(10)-a(23) from Amiram Eldar, Apr 24 2025
a(24)-a(29) from Jinyuan Wang, Apr 28 2025

A151800 Least prime > n (version 2 of the "next prime" function).

Original entry on oeis.org

2, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 31, 37, 37, 37, 37, 37, 37, 41, 41, 41, 41, 43, 43, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 59, 59, 59, 59, 61, 61, 67, 67, 67, 67, 67, 67, 71, 71, 71, 71, 73, 73, 79
Offset: 0

Views

Author

N. J. A. Sloane, Jun 29 2009

Keywords

Comments

Version 1 of the "next prime" function is A007918: smallest prime >= n.
Maple's nextprime() is this version 2; PARI/GP's nextprime() is version 1.
See A007918 for references and further information.
a(n) is the smallest number greater than one that is not divisible by any 1 < k <= n. Consider a multi-round election in which, in each round, voters each cast one vote for one of the remaining candidates. Then, any candidates which receive the fewest votes in that round are eliminated. This repeats until either one candidate remains, who wins the election, or no candidates remain. a(n) is the smallest nontrivial number of voters that can guarantee a winner if the election initially has n > 0 candidates. This is a consequence of the first fact. - Thomas Anton, Mar 30 2020
Conjecture: if n > 3, then a(n) < n^(n^(1/n)). - Thomas Ordowski, Feb 23 2023

Crossrefs

Programs

Formula

a(n) = A007918(n+1).
a(n) = 1 + Sum_{k=1..2n} (floor((n!^k)/k!) - floor(((n!^k)-1)/k!)). - Anthony Browne, May 11 2016
a(n) = A000040(A036234(n)). - Ridouane Oudra, Sep 30 2024

A007917 Version 1 of the "previous prime" function: largest prime <= n.

Original entry on oeis.org

2, 3, 3, 5, 5, 7, 7, 7, 7, 11, 11, 13, 13, 13, 13, 17, 17, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 29, 29, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 41, 41, 43, 43, 43, 43, 47, 47, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 61, 61, 61, 61, 61, 61, 67, 67, 67, 67, 71, 71, 73, 73, 73, 73
Offset: 2

Views

Author

R. Muller

Keywords

Comments

Version 2 of the "previous prime" function (see A151799) is "largest prime < n". This produces the same sequence of numerical values, except the offset (or indexing) starts at 3 instead of 2.
Maple's "prevprime" function uses version 2.
Also the largest prime dividing n! or lcm(1,...,n). - Labos Elemer, Jun 22 2000
Also largest prime among terms of (n+1)st row of Pascal's triangle. - Jud McCranie, Jan 17 2000
Also largest integer k such that A000203(k) <= n+1. - Benoit Cloitre, Mar 17 2002. - Corrected by Antti Karttunen, Nov 07 2017
Also largest prime factor of A061355(n) (denominator of Sum_{k=0..n} 1/k!). - Jonathan Sondow, Jan 09 2005
Also prime(pi(x)) where pi(x) is the prime counting function = number of primes <= x. - Cino Hilliard, May 03 2005
Also largest prime factor, occurring to the power p, in denominator of Sum_{k=1..n} 1/k^p, for any positive integer p. - M. F. Hasler, Nov 10 2006
For n > 10, these values are close to the most negative eigenvalues of A191898 (conjecture). - Mats Granvik, Nov 04 2011

References

  • K. Atanassov, On the 37th and the 38th Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 2, 83-85.
  • J. Castillo, Other Smarandache Type Functions: Inferior/Superior Smarandache f-part of x, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 202-204.

Crossrefs

Programs

Formula

Equals A006530(A000142(n)). - Jonathan Sondow, Jan 09 2005
Equals A006530(A056040(n)). - Peter Luschny, Mar 04 2011
a(n) = A000040(A049084(A007918(n)) + 1 - A010051(n)). - Reinhard Zumkeller, Jul 26 2012
From Wesley Ivan Hurt, May 22 2013: (Start)
omega( Product_{i=2..n} a(i) ) = pi(n).
Omega( Product_{i=2..n} a(i) ) = n - 1. (End)
For n >= 2, a(A000203(n)) = A070801(n). - Antti Karttunen, Nov 07 2017
a(n) = n + 1 - Sum_{i=1..n} floor(pi(i)/pi(n)) = n + 1 - A175851(n). - Ridouane Oudra, Jun 24 2024
Conjecture: a(n) = floor(log(Sum_{k=2..n} exp(A000010(k)+1))). - Joseph M. Shunia, Aug 09 2024
a(n) = A000040(A000720(n)). - Ridouane Oudra, Oct 04 2024

Extensions

Edited by N. J. A. Sloane, Apr 06 2008

A151799 Version 2 of the "previous prime" function: largest prime < n.

Original entry on oeis.org

2, 3, 3, 5, 5, 7, 7, 7, 7, 11, 11, 13, 13, 13, 13, 17, 17, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 29, 29, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 41, 41, 43, 43, 43, 43, 47, 47, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 61, 61, 61, 61, 61, 61, 67, 67, 67, 67, 71, 71, 73, 73, 73, 73
Offset: 3

Views

Author

N. J. A. Sloane, Jun 29 2009

Keywords

Comments

Version 1 of the "previous prime" function is "largest prime <= n". This produces A007917, the same sequence of numerical values, except the offset (or indexing) starts at 2 instead of 3.
Maple's "prevprime" function uses version 2.
See A007917 for references and further information.

Crossrefs

Programs

Formula

a(n) = A000040(A000720(n-1)). - Enrique Pérez Herrero, Jul 23 2011
a(n) = n + 1 - Sum_{k=1..n}( floor(k!^(n-1)/(n-1)!)-floor((k!^(n-1)-1)/(n-1)!) ). - Anthony Browne, May 17 2016
a(n) = A060265(floor(n/2)) for n >= 4. - Georg Fischer, Nov 29 2022
Previous Showing 11-20 of 130 results. Next