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-8 of 8 results.

A255909 Second difference sequence of A070865.

Original entry on oeis.org

1, 4, 2, 2, 2, 6, 2, 2, 4, 4, 4, 2, 6, 2, 2, 4, 2, 8, 6, 6, 2, 2, 2, 2, 2, 20, 6, 6, 2, 2, 8, 2, 4, 4, 2, 6, 2, 4, 4, 4, 4, 4, 4, 4, 12, 10, 2, 12, 12, 6, 8, 4, 4, 2, 8, 16, 10, 2, 18, 6, 6, 6, 2, 2, 4, 8, 2, 18, 2, 14, 4, 4, 4, 4, 10, 10, 4, 2, 10, 4, 4, 2
Offset: 1

Views

Author

Clark Kimberling, Apr 14 2015

Keywords

Comments

Does 2 occur infinitely many times? If so, does every even positive integer occur infinitely many times? More generally, suppose that p < q are primes, and let p(1) = p, p(2) = q, and, for n > 2, let p(n) = least prime h such that h - p(n-1) > p(n-1) - p(n-2). Does every even positive integer occur infinitely many times in the second difference sequence of (p(n))?

Examples

			A070865 = (2,3,5,11,19,29,41,59,79,...)
1st differences:  1,2,6,8,10,12,18,20,...
2nd differences:  1,4,2,2,2,6,2,...
		

Crossrefs

Programs

  • Mathematica
    d = 0; p = 2; t = {p}; Do[d = NextPrime[p + d] - p; AppendTo[t, p += d], {200}]; t
    Differences[t,2]  (* A255909 *)
    (* uses Vladimir Joseph Stephan Orlovsky's program at A070865 *)

A070866 Smallest prime such that the difference of successive terms is nondecreasing.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 23, 29, 37, 47, 59, 71, 83, 97, 113, 131, 149, 167, 191, 223, 257, 293, 331, 373, 419, 467, 521, 577, 641, 709, 787, 877, 967, 1061, 1163, 1277, 1399, 1523, 1657, 1801, 1949, 2099, 2251, 2411, 2579, 2749, 2927, 3109, 3299, 3491, 3691, 3907
Offset: 1

Views

Author

Amarnath Murthy, May 16 2002

Keywords

Crossrefs

Cf. A070865.

Programs

  • Julia
    using Primes
    function A070866(bound)
        a, b = 2, 3
        P = [a, b]
        while true
            p = nextprime(b + (b - a))
            p > bound && break
            push!(P, p)
            a, b = b, p
        end
    P end
    A070866(100000) |> println # Peter Luschny, Dec 23 2019
  • Mathematica
    d = 2; p = 2; t = {2, 3}; Do[p = NextPrime[p + d - 1]; d = p - t[[-1]]; AppendTo[t, p], {98}]; t (* T. D. Noe, Nov 21 2011 *)
  • PARI
    s=1; t=1; for(n=1,100,s=s+t; while(isprime(s+t)==0,t++); print1(s+t,","))
    

Formula

a(1)=2, a(2)=3, a(n) = A007918(2*a(n-1) - a(n-2)). - Reinhard Zumkeller, Jul 08 2004

Extensions

More terms from Benoit Cloitre, May 20 2002

A257559 The slowest increasing sequence of semiprimes with strictly increasing difference of successive terms.

Original entry on oeis.org

4, 6, 9, 14, 21, 33, 46, 62, 82, 106, 133, 161, 194, 235, 278, 323, 371, 422, 478, 535, 597, 662, 731, 802, 878, 955, 1037, 1121, 1207, 1294, 1382, 1473, 1565, 1658, 1754, 1851, 1954, 2059, 2165, 2279, 2395, 2513, 2638, 2771, 2906, 3043
Offset: 1

Views

Author

Zak Seidov, Apr 30 2015

Keywords

Comments

Semiprime analog of A070865.
Heuristically a(n) is around n^2 log n/log log n. - Charles R Greathouse IV, May 01 2015

Crossrefs

Programs

  • PARI
    issemi(n)=bigomega(n)==2
    t=0; print1(last=4); while(1, n=last+t; while(!issemi(n++),); print1(", "n); t=n-last; last=n) \\ Charles R Greathouse IV, Apr 30 2015

Formula

a(n) >> n^2. - Charles R Greathouse IV, Apr 30 2015

A284188 a(1)=2; thereafter a(n+1) = a(n)+i if a(n) is a prime and a(1),...,a(n) contains i primes, or a(n+1) = a(n)-i if a(n) is composite and a(1),...,a(n) contains i primes.

Original entry on oeis.org

2, 3, 5, 8, 5, 9, 5, 10, 5, 11, 18, 11, 19, 28, 19, 29, 40, 29, 41, 54, 41, 55, 41, 56, 41, 57, 41, 58, 41, 59, 78, 59, 79, 100, 79, 101, 124, 101, 125, 101, 126, 101, 127, 154, 127, 155, 127, 156, 127, 157, 188, 157, 189, 157, 190, 157, 191, 226, 191, 227, 264, 227, 265
Offset: 1

Views

Author

Bob Selcoe, Mar 21 2017

Keywords

Comments

Without repeated terms, the primes appear in order as A070865.
Variant of A284172; the difference is that in A284172, a(n+1) = a(n)-i if a(n) is composite and a(1),...,a(n) contains i composites (rather than i primes).
For n >= 3: When a(n) = prime p it is followed by an even number j at a(n+1); p repeats k-j times (where k is the smallest prime > j), appearing at a(n+2m) {m=1..k-j}. a(n+2m+1) = p+m until p+m = k (immediately following the final p); k now becomes "new p" immediately followed by a "new j", and the process repeats.

Examples

			a(10) = 11; there are 7 primes in the sequence up to and including a(10) so a(11) = 11+7 = 18. 18 is composite so a(12) = 18-7 = 11.  Now there are 8 primes in the sequence; and since 11 is prime, a(13) = 11+8 = 19 (the 9th prime in the sequence), so a(14) = 28.
		

Crossrefs

Programs

  • Maple
    c:= proc(n) option remember; `if`(n<1, 0,
          `if`(isprime(a(n)), 1, 0)+c(n-1))
        end:
    a:= proc(n) option remember; `if`(n=1, 2, (m->
          `if`(isprime(m), 1, -1)*c(n-1)+m)(a(n-1)))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 15 2017
  • Mathematica
    Block[{c = 1, m = 2, n}, {2}~Join~Reap[Do[If[PrimeQ[m], Set[n, m + c]; c++, Set[n, m - c + 1]]; Sow[n]; m = n, 63]][[-1, -1]]] (* Michael De Vlieger, Oct 20 2021 *)
  • PARI
    lista(nn) = {print1(a=2, ", "); nbp = 1; for (n=2, nn, if (isprime(a), a += nbp, a -= nbp); print1(a, ", "); if (isprime(a), nbp++););} \\ Michel Marcus, Mar 24 2017

A178547 Composite numbers; start sequence with composite number and end with prime, length of successive sequences are strictly increasing.

Original entry on oeis.org

4, 6, 12, 20, 30, 42, 60, 80, 102, 128, 158, 192, 228, 270, 314, 360, 410, 462, 522, 588, 660, 734, 810, 888, 968, 1050, 1152, 1260, 1374, 1490, 1608, 1734, 1862, 1994, 2130, 2268, 2412, 2558, 2708, 2862, 3020, 3182, 3348, 3518, 3692, 3878, 4074, 4272, 4482
Offset: 1

Views

Author

Keywords

Examples

			{004, 005} {006, 007, 008, 009, 010, 011} {012, 013, 014, 015, 016, 017, 018, 019} {020, 021, 022, 023, 024, 025, 026, 027, 028, 029} {030, 031, 032, 033, 034, 035, 036, 037, 038, 039, 040, 041}..
		

Crossrefs

Programs

  • Mathematica
    PrimeNext[n_]:=Module[{k},k=n+1;While[ !PrimeQ[k],k++ ];k]; d=0;p=2;lst={};Do[d=PrimeNext[p+d]-p;p+=d;AppendTo[lst,p+1],{n,0,5!}];lst

A073847 a(0) = 1, c(0) = 1, a(n) for n > 0 is the smallest prime a(n-1) + c(n), where c(n) is composite and larger than c(n-1).

Original entry on oeis.org

1, 5, 11, 19, 29, 41, 59, 79, 101, 127, 157, 191, 227, 269, 313, 359, 409, 461, 521, 587, 659, 733, 809, 887, 967, 1049, 1151, 1259, 1373, 1489, 1607, 1733, 1861, 1993, 2129, 2267, 2411, 2557, 2707, 2861, 3019, 3181, 3347, 3517, 3691, 3877, 4073, 4271, 4481
Offset: 0

Views

Author

Amarnath Murthy, Aug 14 2002

Keywords

Comments

Same as A070865 after first term. - David Wasserman, Jun 27 2005

Examples

			a(6) = 59 since 59 = a(5) + c(6) = 41 + 18, 18 is composite and larger than c(5) = 12 and the composite numbers 14, 15, 16 do not lead to a prime when added to 41.
		

Programs

  • Mathematica
    a[n_] := a[n] = NextPrim[a[n - 1] + a[n - 1] - a[n - 2]]; a[0] = 1; a[1] = 5; Table[ a[n], {n, 0, 50}]
  • PARI
    {print1(a=1,","); c=1; for(n=1,48,c++; while(isprime(c)||!isprime(a+c),c++); a=a+c; print1(a,","))}

Extensions

Edited and extended by Klaus Brockhaus and Robert G. Wilson v, Aug 14 2002

A085626 Partial sums of A051935.

Original entry on oeis.org

2, 5, 11, 19, 29, 41, 59, 79, 101, 127, 157, 191, 227, 269, 313, 359, 409, 461, 521, 587, 659, 733, 809, 887, 967, 1049, 1151, 1259, 1373, 1489, 1607, 1733, 1861, 1993, 2129, 2267, 2411, 2557, 2707, 2861, 3019, 3181, 3347, 3517, 3691, 3877, 4073, 4271, 4481
Offset: 1

Views

Author

Patrick Capelle, Jul 10 2003

Keywords

Comments

Same as A070865 after first term. - David Wasserman, Jun 27 2005

Examples

			a(3) = 11 because it is the sum of the first 3 terms of A051935: 2+3+6 = 11.
		

Crossrefs

A178549 a(n) is a composite number at the start of an interval of consecutive integers, ending in a prime, and non-overlapping with and at least as long as the interval addressed by a(n-1).

Original entry on oeis.org

4, 6, 8, 12, 18, 24, 30, 38, 48, 60, 72, 84, 98, 114, 132, 150, 168, 192, 224, 258, 294, 332, 374, 420, 468, 522, 578, 642, 710, 788, 878, 968, 1062, 1164, 1278, 1400, 1524, 1658, 1802, 1950, 2100, 2252, 2412, 2580, 2750, 2928, 3110, 3300, 3492, 3692, 3908
Offset: 1

Views

Author

Keywords

Comments

Non-overlapping intervals of the integers of nondecreasing length, starting with a composite number and ending with a prime number, define an intermediate table (as below), the first column of which defines the sequence.
4, 5
6, 7
8, 9, 10, 11
12, 13, 14, 15, 16, 17
18, 19, 20, 21, 22, 23
24, 25, 26, 27, 28, 29
30, 31, 32, 33, 34, 35, 36, 37
38, 39, 40, 41, 42, 43, 44, 45, 46, 47
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59
60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71

Crossrefs

Programs

  • Mathematica
    PrimeNext[n_]:=Module[{k},k=n+1;While[ !PrimeQ[k],k++ ];k]; d=0;p=2;lst={}; Do[d=PrimeNext[p+d]-p;p=p+=d;d--;AppendTo[lst,p+1],{n,0,5!}];lst

Formula

a(n) = 1 + A070866(n+1). - R. J. Mathar, Jun 07 2010

Extensions

Definition rephrased by R. J. Mathar, Jun 07 2010
Showing 1-8 of 8 results.