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

A227878 Primes occurring twice in A051701.

Original entry on oeis.org

3, 19, 41, 43, 71, 83, 101, 109, 151, 167, 199, 227, 229, 257, 281, 283, 311, 313, 349, 383, 401, 443, 461, 463, 487, 503, 571, 601, 617, 641, 643, 677, 727, 757, 829, 857, 859, 881, 883, 911, 937, 941, 971, 1033, 1063, 1091, 1093, 1123, 1187, 1217, 1231
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 25 2013

Keywords

Comments

Consider five consecutive primes p1..p5: (p3 is a term of this sequence) iff (p2-p1 > p3-p2 and p5-p4 > p4-p3).

Programs

  • Haskell
    a227878 n = a227878_list !! (n-1)
    a227878_list = f a051701_list where
       f (p:ps@(:p':)) = if p == p' then p : f ps else f ps

A053607 Primes p such that a pure prime power occurs between p and the next prime.

Original entry on oeis.org

3, 7, 13, 23, 31, 47, 61, 79, 113, 127, 167, 241, 251, 283, 337, 359, 509, 523, 619, 727, 839, 953, 1021, 1327, 1367, 1669, 1847, 2039, 2179, 2207, 2399, 2803, 3121, 3469, 3719, 4093, 4483, 4909, 5039, 5323, 6229, 6553, 6857, 6883, 7919, 8191, 9403, 10193
Offset: 1

Views

Author

Labos Elemer, Feb 09 2000

Keywords

Examples

			127 belongs here because 128 = 2^7 occurs between 127 and 131.
		

Crossrefs

Programs

  • Mathematica
    lim = 10^4; pwrs = Sort[Flatten[Table[Prime[n]^i, {n, 1, PrimePi[Sqrt[lim]]}, {i, 2, Log[Prime[n], lim]}]]]; Union[NextPrime[pwrs, -1]] (* T. D. Noe, Mar 11 2013 *)

A116946 Closest semiprime to n-th semiprime S that is different from S (break ties by taking the smaller semiprime).

Original entry on oeis.org

6, 4, 10, 9, 15, 14, 22, 21, 26, 25, 34, 33, 34, 39, 38, 49, 51, 49, 57, 58, 57, 65, 62, 65, 77, 74, 85, 86, 85, 86, 93, 94, 93, 94, 111, 115, 118, 119, 118, 122, 121, 122, 133, 134, 133, 142, 141, 142, 146, 145, 158, 159, 158, 159, 169, 166, 178, 177, 185
Offset: 1

Views

Author

Jonathan Vos Post, Mar 25 2006

Keywords

Examples

			Closest semiprimes to 4, 6, 9, 10, 14, 15, 21 are 6, 4, 10, 9, 15, 14, 22.
		

Crossrefs

Cf. A001358 (semiprimes), A051701 (analog for primes).

Programs

  • Mathematica
    csp[{a_,b_,c_}]:=If[c-bHarvey P. Dale, May 06 2014 *)
  • Python
    from sympy import factorint
    def semiprime(n): return sum(e for e in factorint(n).values()) == 2
    def nextsemiprime(n):
      nxt = n + 1
      while not semiprime(nxt): nxt += 1
      return nxt
    def aupton(terms):
      prv, cur, nxt, alst = 0, 4, 6, []
      while len(alst) < terms:
        alst.append(prv if 2*cur - prv <= nxt else nxt)
        prv, cur, nxt = cur, nxt, nextsemiprime(nxt)
      return alst
    print(aupton(59)) # Michael S. Branicky, Jun 04 2021

Extensions

Corrected by Harvey P. Dale, May 06 2014

A053708 Nearest prime to n! (but not equal to n!).

Original entry on oeis.org

2, 3, 5, 23, 113, 719, 5039, 40343, 362867, 3628789, 39916801, 479001599, 6227020777, 87178291199, 1307674368043, 20922789888023, 355687428096031, 6402373705728037, 121645100408832089, 2432902008176640029, 51090942171709439969, 1124000727777607680031, 25852016738884976639911
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

If n! is the average of its closest prime neighbors then the smaller prime is to be chosen (as in A051701).

Examples

			For 8! = 40320 the closest upper and lower primes are 40289 and 40343 with d = 31 and d = 23, so 40343 is closer to 8! than the lower neighbor.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Module[{nf=n!,s,l},s=NextPrime[nf,-1];l=NextPrime[nf];If[nf-s>l-nf,l,s]]
    Table[f[i],{i,25}] (* Harvey P. Dale, Dec 08 2010 *)

Extensions

Corrected by Rick L. Shepherd, Jan 11 2006
a(21)-a(23) from Amiram Eldar, Mar 10 2025
Showing 1-4 of 4 results.