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

A263676 Numbers that are both interprime and oblong.

Original entry on oeis.org

6, 12, 30, 42, 56, 72, 240, 342, 420, 462, 506, 552, 600, 650, 870, 1056, 1190, 1482, 1722, 1806, 2550, 2652, 2970, 3540, 4422, 6320, 7140, 8010, 10302, 12656, 13572, 14042, 17292, 18360, 19182, 19460, 20022, 22952, 23562, 24180, 27060, 29070, 29756, 31152, 33306, 35156, 35532, 39006
Offset: 1

Views

Author

Antonio Roldán, Oct 23 2015

Keywords

Examples

			342 is in this sequence because 342 = 18*19 is oblong, and 342 = (337 + 347)/2, with 337 and 347 consecutive primes.
		

Crossrefs

Intersection of A024675 and A002378. - Omar E. Pol, Oct 24 2015
Lesser of consecutive primes is in the sequence A242383.

Programs

  • Mathematica
    lim = 40000; Intersection[Plus @@@ Partition[Table[Prime@ n, {n, 2, PrimePi@ lim}], 2, 1]/2, Table[n (n + 1), {n, 0, lim}]] (* Michael De Vlieger, Nov 18 2015, after Clark Kimberling at A024675 and Robert G. Wilson v at A002378 *)
    obQ[n_]:=With[{divs=Partition[Divisors[n],2,1]},Length[Select[divs,#[[2]]-#[[1]]== 1 && Times@@#==n&]]>0]; Select[Mean/@Partition[Prime[ Range[ 2,40000]],2,1],obQ] (* Harvey P. Dale, Nov 01 2022 *)
  • PARI
    {for(i=1,500,n=i*(i+1);if(n==(precprime(n-1)+nextprime(n+1))/2, print1(n,", ")))}

A263675 Numbers that are both averages of consecutive primes and nontrivial prime powers.

Original entry on oeis.org

4, 9, 64, 81, 625, 1681, 4096, 822649, 1324801, 2411809, 2588881, 2778889, 3243601, 3636649, 3736489, 5527201, 6115729, 6405961, 8720209, 9006001, 12752041, 16056049, 16589329, 18088009, 21743569, 25230529, 29343889, 34586161, 37736449, 39150049
Offset: 1

Views

Author

Antonio Roldán, Oct 23 2015

Keywords

Comments

Intersection of A024675 and A025475.
Lesser of consecutive primes is in the sequence A084289.

Examples

			625 is in this sequence because 625 = 5^4, nontrivial prime power, and 625 = (619+631)/2, with 619 and 631 consecutive primes.
		

Crossrefs

Programs

  • Maple
    N:= 10^10: # to get all terms <= N
    Primes:= select(isprime, [2,seq(i,i=3..isqrt(N),2)]):
    S:= select(t -> t - prevprime(t) = nextprime(t)-t, {seq(seq(p^j, j=2..floor(log[p](N))),p=Primes)}):
    sort(convert(S,list)); # Robert Israel, Dec 27 2015
  • Mathematica
    (* version >= 6 *)(#/2 + NextPrime[#]/2) & /@
    Select[Prime[Range[5000000]], PrimePowerQ[#/2 + NextPrime[#]/2] &]
    (* Wouter Meeussen, Oct 26 2015 *)
  • PARI
    {for(i=1,10^8,if(isprimepower(i)>1&&i==(precprime(i-1)+nextprime(i+1))/2,print1(i,", ")))}

A373299 Numbers prime(k) such that prime(k) - prime(k-1) = prime(k+2) - prime(k+1).

Original entry on oeis.org

7, 11, 13, 17, 29, 41, 59, 79, 101, 103, 107, 113, 139, 163, 181, 193, 227, 257, 269, 311, 359, 379, 397, 419, 421, 439, 461, 487, 491, 547, 569, 577, 599, 691, 701, 709, 761, 811, 823, 857, 863, 881, 887, 919, 983, 1021, 1049, 1051, 1091, 1109, 1163
Offset: 1

Views

Author

Alexandre Herrera, May 31 2024

Keywords

Examples

			7 is in the list because the prime previous to 7 is 5 and the next primes after 7 are 11 and 13, so we have 7 - 5 = 13 - 11 = 2.
		

Crossrefs

Programs

  • Maple
    P:= select(isprime,[seq(i,i=3..10^4,2)]):
    G:= P[2..-1]-P[1..-2]: nG:= nops(G):
    J:= select(t -> G[t-1]=G[t+1],[$2..nG-1]):
    P[J]; # Robert Israel, May 31 2024
  • Mathematica
    Select[Partition[Prime[Range[200]], 4, 1], #[[2]] - #[[1]] == #[[4]] - #[[3]] &][[;; , 2]] (* Amiram Eldar, May 31 2024 *)
  • Python
    from sympy import prime
    def ok(k):
        return prime(k)-prime(k-1) == prime(k+2)-prime(k+1)
    print([prime(k) for k in range(2,200) if ok(k)])
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        p, q, r, s = [2, 3, 5, 7]
        while True:
            if q-p == s-r: yield q
            p, q, r, s = q, r, s, nextprime(s)
    print(list(islice(agen(), 60))) # Michael S. Branicky, May 31 2024

Formula

a(n) = A151800(A022885(n)).
Showing 1-3 of 3 results.