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

A136799 Last term in a sequence of at least 3 consecutive composite integers.

Original entry on oeis.org

10, 16, 22, 28, 36, 40, 46, 52, 58, 66, 70, 78, 82, 88, 96, 100, 106, 112, 126, 130, 136, 148, 156, 162, 166, 172, 178, 190, 196, 210, 222, 226, 232, 238, 250, 256, 262, 268, 276, 280, 292, 306, 310, 316, 330, 336, 346, 352, 358, 366, 372, 378, 382, 388, 396
Offset: 1

Views

Author

Enoch Haga, Jan 21 2008

Keywords

Comments

An equivalent definition is "Last term in a sequence of at least 2 consecutive composite integers". - Jon E. Schoenfield, Dec 04 2017
The BASIC program below is useful in testing Grimm's Conjecture, subject of Carlos Rivera's Puzzle 430
Use the program with lines 30 and 70 enabled in the first run and then disabled with lines 31 and 71 enabled in the second run.
Composite numbers m such that m-1 is composite, and m+1 is not. - Martin Michael Musatov, Oct 24 2017

Examples

			a(1)=10 because 10 is the last term in a run of three composites beginning with 8 and ending with 10 (8,9,10).
		

Crossrefs

Programs

  • Magma
    [p-1: p in PrimesInInterval(4, 420) | not IsPrime(p - 2)]; // Vincenzo Librandi, Apr 11 2019
  • Mathematica
    Select[Prime@ Range@ 78, CompositeQ[# - 2] &] - 1 (* Michael De Vlieger, Oct 23 2015, after PARI *)
  • PARI
    forprime(p=5, 1000, if(isprime(p-2)==0, print1(p-1, ", "))) \\ Altug Alkan, Oct 23 2015
    
  • UBASIC
    10 'puzzle 430 (gap finder) 20 N=1 30 A=1:S=sqrt(N):print N; 31 'A=1:S=N\2:print N; 40 B=N\A 50 if B*A=N and B=prmdiv(B) then print B; 60 A=A+1 70 if A<=sqrt(N) then 40 71 'if A<=N\2 then 40 80 C=C+1:print C 90 N=N+1: if N=prmdiv(N) then C=0:print:stop:goto 90:else 30
    

Formula

a(n) = A025584(n+2) - 1. - R. J. Mathar, Jan 24 2008
a(n) ~ n log n. - Charles R Greathouse IV, Oct 27 2015

Extensions

Edited by R. J. Mathar, May 27 2009
a(53) corrected by Bill McEachen, Oct 27 2015

A136801 Largest prime factor of the composites in the n-th prime gap larger than 2.

Original entry on oeis.org

5, 7, 11, 13, 17, 19, 23, 17, 29, 31, 23, 37, 41, 43, 47, 11, 53, 37, 61, 43, 67, 73, 31, 79, 83, 43, 89, 61, 97, 103, 109, 113, 29, 79, 83, 127, 131, 89, 137, 139, 97, 151, 103, 157, 163, 167, 173, 13, 179, 181, 53, 47, 191, 193, 197, 199, 101, 139, 211, 109, 17, 223
Offset: 1

Views

Author

Enoch Haga, Jan 24 2008

Keywords

Comments

The largest prime factor of numbers in the interval [A136798(n),A136799(n)].
The sequence is obtained from A052248 by removing terms from composites in prime gaps of size 2.

Examples

			a(1)=5 because the composites in the run from 8, 9, 10 contain prime factors 2, 3, and 5, with 5 being the largest at N=10.
		

Crossrefs

Programs

  • Maple
    A006530 := proc(n) max( op(numtheory[factorset](n))) ; end:
    A136798 := proc(n) local a; if n = 1 then 8; else a := nextprime( procname(n-1))+1 ; while nextprime(a)-a <=2 do a := nextprime(a)+1 ; od; RETURN(a) ; fi; end:
    A136801 := proc(n) local a,i; i := A136798(n) ; a := A006530( i) ; while not isprime(i+1) do i := i+1 ; a := max(a, A006530(i)) ; od: a ; end:
    seq(A136801(n),n=1..20) ; # R. J. Mathar, May 27 2009

Extensions

Edited by R. J. Mathar, May 27 2009

A136800 Number of composites in prime gaps of size 3 or larger, in order of appearance.

Original entry on oeis.org

3, 3, 3, 5, 5, 3, 3, 5, 5, 5, 3, 5, 3, 5, 7, 3, 3, 3, 13, 3, 5, 9, 5, 5, 3, 5, 5, 9, 3, 11, 11, 3, 3, 5, 9, 5, 5, 5, 5, 3, 9, 13, 3, 3, 13, 5, 9, 3, 5, 7, 5, 5, 3, 5, 7, 3, 7, 9, 9, 5, 3, 5, 7, 3, 3, 11, 7, 3, 7, 3, 5, 11
Offset: 1

Views

Author

Enoch Haga, Jan 22 2008

Keywords

Comments

The sequence counts the terms in the runs of composites associated with A136798-A136799.
A129856 is obtained by removing the composites (9, 15 etc.) from this sequence.
This is sequence A046933, with the zero and all the 1's deleted. - R. J. Mathar, Jan 24 2008

Examples

			a(1)=3 because in the run 8, 9, 10 there are three terms.
		

Crossrefs

Programs

  • Mathematica
    Select[#[[2]]-#[[1]]-1&/@Partition[Prime[Range[100]],2,1],#>2&] (* Harvey P. Dale, Apr 08 2015 *)

Formula

a(n)=A136799(n)-A136798(n)+1.

Extensions

Edited by R. J. Mathar, May 27 2009

A225461 a(n) = (prime(k) + prime(k+1))/2 where k = A098015(n).

Original entry on oeis.org

9, 15, 21, 26, 34, 39, 45, 50, 56, 64, 69, 76, 81, 86, 99, 105, 111, 120, 129, 134, 144, 154, 160, 165, 170, 176, 186, 195, 225, 231, 236, 246, 254, 260, 266, 274, 279, 288, 300, 309, 315, 324, 334, 342, 351, 356, 370, 376, 381, 386, 399
Offset: 1

Views

Author

Richard R. Forberg, May 13 2013

Keywords

Comments

Former name: Numbers n such that n^2 = prime(i)*prime(i+1) + prime(j)^2, for some i, j > 0 and such that prime(i+1) = prime(i) + 2*prime(j).
The solution values for n = prime(i) + prime(j), when restricted by the condition prime(i+1) = prime(i) + 2*prime(j). Rather than being overly restrictive, the condition applies to the most prevalent type of solution to the equation above for n^2.
The density of solutions, as a percentage of prime(i) values, is 51.33% in the first 10000 primes, and 49.29% in the second 10000 primes.
Values of prime(j) for these solutions range from the prime 2 to the prime 31 in the first 10000 values of prime(i). In the second 10000 values of prime(i) the solutions shift somewhat to higher p(j) values. This trend is expected with increases in the average spacing of primes. This has the effect of slowing the decline in density of solutions at higher p(i) relative to the decline in density of primes themselves.
There is an infinite family of similar equations when "1" is replaced by "d" as in the following: n^2 = prime(i)*prime(i+d) + prime(j)^2, for any i,j, or d > 0.
In this general case, the condition becomes: prime(i+d) = prime(i) + 2*prime(j).
The solution sequence of n values, of course, differs for each d, as does the sequence of primes(i) that create them.
For this generalized version of the equation (and the condition) it is also true that the solution values of n = prime(i) + prime(j), for all d.
[This can be shown with basic algebra as follows, where p() = prime(): n^2 = (p(i) + p(j))^2 = p(i)^2 + 2*p(i)*p(j) + p(j)^2.
Now replace the first p(j) above with (p(i+d) - p(i))/2, and get: n^2 = p(i)^2 + 2*p(i)*(p(i+d) - p(i))/2 + p(j)^2 = p(i)*p(i+d) + p(j)^2.]
This also proves that for each p(i) there is, at most, one solution when the condition is applied.
There are other solutions to the equation above for n^2 with primes that do NOT obey the condition above. These are sparse. For d=1 (this case) they include 8, 18, 72, 450, and 882. All four of these are found at low values of i (i <= 13). These solutions, for all values of d, appear to have the form n = p(j) + 1, if they exist at all for given d. It can be shown, however, that for any given d NOT all p(i) have a solution, but they can occur with the same p(i) as the "algebraic" solutions above.
This sequence appears to be a large subset of (A136798 + A136799)/2 (the center of composite runs). - Bill McEachen, Oct 22 2015
Heuristically, A001223(n)/2 should be prime with probability ~ 1/log log n, so (prime(n) + prime(n+1))/2 is in the sequence with probability ~ 1/log log n. - Robert Israel, Nov 30 2015

Examples

			n = 9 is in the sequence (with i = 4 and j = 1), because 9^2 = 7*11 + 2^2 = prime(4)*prime(4+1) + 2*prime(1) and prime(4+1) = 11 = 7 + 2*2 = prime(4) + 2*prime(1). Moreover, 9 = 7 + 2 = prime(4) + prime(1).
Whereas n = 8 (not in the sequence) satisfies the first condition with i = 2 and j = 4 (8^2 = 3*5 + 7^2), it does NOT meet the second condition: p(i+1) = 5 != p(i) + 2*p(j) = 3 + 2*7 = 17. Moreover, 8 != 3 + 7.
		

Crossrefs

Cf. A000040. Subsequence of A024675. - Zak Seidov, May 18 2013
Cf. A136798 and A136799, first and last values for runs of adjacent composites.

Programs

  • Maple
    P:= select(isprime, [2,seq(2*i+1,i=1..10^4)]):
    G2:= (P[2..-1] - P[1..-2])/2:
    inds:= select(i -> isprime(G2[i]),[$2..nops(G2)]):
    seq(P[i] + G2[i],i=inds); # Robert Israel, Nov 30 2015
  • Mathematica
    Reap[For[p = 2, p < 400, p = NextPrime[p], p1 = NextPrime[p]; If[PrimeQ[pj = (p1 - p)/2] && IntegerQ[n = Sqrt[p*p1 + pj^2]], Sow[n]]]][[2, 1]](* Jean-François Alcover, May 17 2013 *)

Extensions

Example edited by Danny Rorabaugh, Oct 26 2015
Name changed by Robert Israel, Nov 30 2015

A260933 Lexicographically smallest permutation of the natural numbers, such that a(n)+n and a(n)+n+1 are both composite numbers.

Original entry on oeis.org

7, 6, 5, 4, 3, 2, 1, 12, 11, 10, 9, 8, 13, 18, 17, 16, 15, 14, 19, 24, 23, 22, 21, 20, 25, 28, 27, 26, 33, 32, 31, 30, 29, 34, 39, 38, 37, 36, 35, 40, 43, 42, 41, 46, 45, 44, 47, 50, 49, 48, 53, 52, 51, 56, 55, 54, 57, 58, 59, 60, 61, 62, 65, 64, 63, 66, 67
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 04 2015

Keywords

Comments

The permutation is self-inverse: a(a(n)) = n.

Crossrefs

Cf. A010051, A002808, A136798, A260936 (fixed points), A260822.

Programs

  • Haskell
    import Data.List (delete)
    a260933 n = a260933_list !! (n-1)
    a260933_list = f 1 [1..] where
       f x zs = g zs where
         g (y:ys) = if a010051' (x + y) == 0 && a010051' (x + y + 1) == 0
                       then y : f (x + 1) (delete y zs) else g ys
    
  • Mathematica
    a[n_]:=a[n]=(k=1;While[PrimeQ[k+n]||PrimeQ[k+n+1]||MemberQ[Array[a,n-1],k],k++];k);Array[a,100] (* Giorgos Kalogeropoulos, Jul 06 2021 *)
  • Python
    from sympy import isprime
    def composite(n): return n > 1 and not isprime(n)
    def aupton(terms):
        alst, aset = [], set()
        for n in range(1, terms+1):
            an = 1
            while True:
                while an in aset: an += 1
                if composite(an+n) and composite(an+n+1): break
                an += 1
            alst, aset = alst + [an], aset | {an}
        return alst
    print(aupton(67)) # Michael S. Branicky, Jul 06 2021

A104280 Numbers n such that 2n+1 is not prime and 2n-1 is prime.

Original entry on oeis.org

4, 7, 10, 12, 16, 19, 22, 24, 27, 31, 34, 37, 40, 42, 45, 49, 52, 55, 57, 64, 66, 70, 76, 79, 82, 84, 87, 91, 97, 100, 106, 112, 115, 117, 121, 126, 129, 132, 136, 139, 142, 147, 154, 157, 159, 166, 169, 175, 177, 180, 184, 187, 190, 192, 195, 199, 201, 205, 211, 217
Offset: 1

Views

Author

Alexandre Wajnberg, Apr 17 2005

Keywords

Crossrefs

Cf. A040040 and others.
Equals A136798/2.

Programs

  • Magma
    [n: n in [0..250]| not IsPrime(2*n+1) and IsPrime(2*n-1)] // Vincenzo Librandi, Jan 28 2011
    
  • Mathematica
    Select[ Range[219], !PrimeQ[2# + 1] && PrimeQ[2# - 1] &] (* Robert G. Wilson v, Apr 18 2005 *)
  • PARI
    is(n)=isprime(2*n-1) && !isprime(2*n+1) \\ Charles R Greathouse IV, Jun 13 2017

Extensions

More terms from Robert G. Wilson v, Apr 18 2005

A136802 The composite with the largest prime factor in the n-th prime gap larger than 2.

Original entry on oeis.org

10, 14, 22, 26, 34, 38, 46, 51, 58, 62, 69, 74, 82, 86, 94, 99, 106, 111, 122, 129, 134, 146, 155, 158, 166, 172, 178, 183, 194, 206, 218, 226, 232, 237, 249, 254, 262, 267, 274, 278, 291, 302, 309, 314, 326, 334, 346, 351, 358, 362, 371, 376, 382, 386, 394
Offset: 1

Views

Author

Enoch Haga, Jan 24 2008

Keywords

Comments

Pick the number in the interval [A136798(n),A136799(n)] with the largest prime factor.
The sequence is obtained from A114331 by removing terms in prime gaps of size 2.

Examples

			a(1)=10 because at N=10 the largest prime factor is 5.
		

Crossrefs

Programs

  • Maple
    A006530 := proc(n) max( op(numtheory[factorset](n))) ; end:
    A136798 := proc(n) local a; if n = 1 then 8; else a := nextprime( procname(n-1))+1 ; while nextprime(a)-a <=2 do a := nextprime(a)+1 ; od; RETURN(a) ; fi; end:
    A136802 := proc(n) local c,lpf,a; c := A136798(n) ; lpf := A006530(c) ; a := c; while not isprime(c+1) do c := c+1 ; if A006530(c) > lpf then a := c ; lpf := A006530(c) ; fi; od: a ; end:
    seq(A136802(n),n=1..80) ; # R. J. Mathar, May 27 2009

Formula

A006530(a(n)) = A136801(n).

Extensions

Edited by R. J. Mathar, May 27 2009
Showing 1-7 of 7 results.