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

A218561 4-gap primes: Prime p is a term iff there is no prime between 4*p and 4*nextprime(p), where nextprime=A151800.

Original entry on oeis.org

29, 71, 137, 197, 239, 269, 347, 419, 431, 641, 659, 809, 821, 1061, 1091, 1151, 1289, 1489, 1607, 1721, 1783, 1877, 1949, 1993, 2083, 2141, 2267, 2339, 2381, 2389, 2549, 2729, 2801, 2833, 2969, 2999, 3019, 3041, 3217, 3253, 3299, 3329, 3389, 3461
Offset: 1

Views

Author

Keywords

Examples

			29 is in the sequence since there are no primes in the interval(4*29,4*31)=(116,124)
		

Crossrefs

Programs

A340148 a(n) = Product_{distinct primes p dividing n} gcd(q-1, A003961(n)-1), where q = A151800(p), the next prime larger than p.

Original entry on oeis.org

1, 2, 4, 2, 6, 4, 10, 2, 4, 4, 12, 8, 16, 4, 4, 2, 18, 4, 22, 4, 4, 4, 28, 4, 6, 4, 4, 4, 30, 16, 36, 2, 16, 4, 4, 8, 40, 4, 16, 4, 42, 16, 46, 8, 12, 4, 52, 8, 10, 4, 4, 16, 58, 4, 36, 4, 4, 4, 60, 8, 66, 4, 4, 2, 4, 8, 70, 4, 16, 40, 72, 4, 78, 4, 8, 4, 4, 8, 82, 4, 4, 4, 88, 8, 36, 4, 4, 4, 96, 16, 4, 8, 16
Offset: 1

Views

Author

Antti Karttunen, Dec 30 2020

Keywords

Comments

Prime shifted analog of A063994.

Crossrefs

Programs

  • PARI
    A003961(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
    A063994(n) = { my(f=factor(n)[,1]); prod(i=1, #f, gcd(f[i]-1, n-1)); };
    A340148(n) = A063994(A003961(n));
    
  • PARI
    A340148(n) = { my(f=factor(n)[,1], u=A003961(n)); prod(i=1, #f, gcd(nextprime(1+f[i])-1, u-1)); };
    
  • PARI
    A340148(n) = { my(u=A003961(n), f=factor(u)[,1]); prod(i=1, #f, gcd(f[i]-1, u-1)); };

Formula

a(n) = A063994(A003961(n)).
a(n) = A003972(n) / A340147(n).

A379405 a(n) = p((n+1)*p(n)), where p(x) = least prime > x; i.e., p = A151800.

Original entry on oeis.org

3, 5, 11, 23, 29, 43, 53, 89, 101, 113, 127, 157, 173, 239, 257, 277, 293, 347, 367, 461, 487, 509, 541, 701, 727, 757, 787, 821, 853, 937, 967, 1187, 1223, 1259, 1297, 1361, 1373, 1559, 1601, 1657, 1693, 1811, 1861, 2069, 2129, 2179, 2213, 2549, 2609, 2657
Offset: 0

Views

Author

Clark Kimberling, Jan 18 2025

Keywords

Examples

			p(1) = 2, so a(1) = p(2*p(1)) = 5.
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[(n+1)*NextPrime[n]], {n, 0, 80}]
  • PARI
    p(n) = nextprime(n+1);
    a(n) = p((n+1)*p(n)); \\ Michel Marcus, Jan 18 2025
    
  • Python
    from sympy import nextprime
    def A379405(n): return nextprime((n+1)*nextprime(n)) # Chai Wah Wu, Jan 20 2025

Formula

a(n) = A151800(A053024(n+1)). - Alois P. Heinz, Jan 18 2025

A328915 If n = Product (p_j^k_j) then a(n) = Product (nextprime(p_j)), where nextprime = A151800.

Original entry on oeis.org

1, 3, 5, 3, 7, 15, 11, 3, 5, 21, 13, 15, 17, 33, 35, 3, 19, 15, 23, 21, 55, 39, 29, 15, 7, 51, 5, 33, 31, 105, 37, 3, 65, 57, 77, 15, 41, 69, 85, 21, 43, 165, 47, 39, 35, 87, 53, 15, 11, 21, 95, 51, 59, 15, 91, 33, 115, 93, 61, 105, 67, 111, 55, 3, 119, 195, 71, 57, 145, 231
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 30 2019

Keywords

Comments

All terms are odd.

Examples

			a(12) = a(2^2 * 3) = a(prime(1)^2 * prime(2)) = prime(2) * prime(3) = 3 * 5 = 15.
		

Crossrefs

Programs

  • Maple
    a:= n-> mul(nextprime(i[1]), i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 30 2019
  • Mathematica
    a[1] = 1; a[n_] := Times @@ (NextPrime[#[[1]]] & /@ FactorInteger[n]); Table[a[n], {n, 1, 70}]
  • PARI
    a(n) = my(f=factor(n)); prod(k=1, #f~, nextprime(f[k,1]+1)); \\ Michel Marcus, Oct 30 2019

Formula

If n = Product (p_j^k_j) then a(n) = Product (prime(pi(p_j) + 1)), where pi = A000720.
a(n) = A007947(A003961(n)).

A335185 a(n) = nextprime(ceiling(n/2)-1) - prevprime(floor(n/2)+1), where nextprime = A151800 and prevprime = A151799.

Original entry on oeis.org

0, 1, 0, 2, 2, 2, 0, 2, 2, 2, 0, 4, 4, 4, 4, 4, 4, 4, 0, 2, 2, 2, 0, 4, 4, 4, 4, 4, 4, 4, 0, 2, 2, 2, 0, 4, 4, 4, 4, 4, 4, 4, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 2, 2, 2, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 4, 4, 4, 4, 4, 4, 4, 0, 2, 2, 2, 0, 4, 4, 4, 4, 4, 4, 4, 0, 6, 6, 6
Offset: 4

Views

Author

Wesley Ivan Hurt, May 25 2020

Keywords

Comments

a(n) is the difference of the smallest prime appearing among the largest parts of the partitions of n into two parts and the largest prime appearing among the smallest parts of the partitions of n into two parts.
a(n) = 0 if and only if n = 2p, where p is prime. All terms are even except a(5).
The values in the n-th run of positive integers are all equal to the n-th prime gap (A001223).
Each value specifies the run length of the block (of positive integers) in which it appears. If a(n) = 0, then it appears once. If a(n) > 0, it has a run length of 2k - 1.

Examples

			a(5) = 1; n=5 has 2 partitions into two parts: (4,1) and (3,2). Among the largest parts, the smallest prime is 3. Among the smallest parts, 2 is the largest. So a(5) = 3 - 2 = 1.
a(6) = 0; n=6 has 3 partitions into two parts: (5,1), (4,2) and (3,3). Among the largest parts, the smallest prime is 3. Among the smallest parts, the largest prime is 3. So a(6) = 3 - 3 = 0.
a(7) = 2; n=7 has 3 partitions into two parts: (6,1), (5,2) and (4,3). Among the largest parts, 5 is the smallest. Among the smallest parts, 3 is the largest. So a(7) = 5 - 3 = 2.
		

Crossrefs

Cf. A001223 (prime gaps), A151799, A151800, A335186.

Programs

  • Magma
    [NextPrime(Ceiling(n/2)-1) - PreviousPrime(Floor(n/2)+1) : n in [4..100]];
  • Mathematica
    Table[NextPrime[Ceiling[n/2] - 1, 1] - NextPrime[Floor[n/2] + 1, -1], {n, 4, 100}]

Formula

a(n) = A151800(ceiling(n/2)-1) - A151799(floor(n/2)+1).

A335186 a(n) = nextprime(ceiling(n/2)-1) + prevprime(floor(n/2)+1), where nextprime = A151800 and prevprime = A151799.

Original entry on oeis.org

4, 5, 6, 8, 8, 8, 10, 12, 12, 12, 14, 18, 18, 18, 18, 18, 18, 18, 22, 24, 24, 24, 26, 30, 30, 30, 30, 30, 30, 30, 34, 36, 36, 36, 38, 42, 42, 42, 42, 42, 42, 42, 46, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 58, 60, 60, 60, 62, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 74
Offset: 4

Views

Author

Wesley Ivan Hurt, May 25 2020

Keywords

Comments

a(n) is the sum of the smallest prime appearing among the largest parts of the partitions of n into two parts and the largest prime appearing among the smallest parts of the partitions of n into two parts.
If n = 2p where p is prime, then a(n) = n. The converse is not true since a(8) = 8, but n = 2*4 and 4 is not prime.
All terms are even except a(5).

Examples

			a(5) = 5; n=5 has 2 partitions into two parts: (4,1) and (3,2). Among the largest parts, the smallest prime is 3. Among the smallest parts, 2 is the largest. So a(5) = 3 + 2 = 5.
a(6) = 6; n=6 has 3 partitions into two parts: (5,1), (4,2) and (3,3). Among the largest parts, the smallest prime is 3. Among the smallest parts, the largest prime is 3. So a(6) = 3 + 3 = 6.
a(7) = 8; n=7 has 3 partitions into two parts: (6,1), (5,2) and (4,3). Among the largest parts, 5 is the smallest. Among the smallest parts, 3 is the largest. So a(7) = 5 + 3 = 8.
		

Crossrefs

Cf. A001223 (prime gaps), A151799, A151800, A335185.

Programs

  • Magma
    [NextPrime(Ceiling(n/2)-1) + PreviousPrime(Floor(n/2)+1) : n in [4..100]];
  • Mathematica
    Table[NextPrime[Ceiling[n/2] - 1, 1] + NextPrime[Floor[n/2] + 1, -1], {n, 4, 100}]

Formula

a(n) = A151800(ceiling(n/2)-1) + A151799(floor(n/2)+1).

A345161 If n = Product (p_j^k_j) then a(n) = max (nextprime(p_j) - p_j), where nextprime = A151800.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 4, 1, 2, 2, 2, 2, 4, 4, 2, 1, 2, 2, 4, 2, 4, 2, 6, 2, 2, 4, 2, 4, 2, 2, 6, 1, 2, 2, 4, 2, 4, 4, 4, 2, 2, 4, 4, 2, 2, 6, 6, 2, 4, 2, 2, 4, 6, 2, 2, 4, 4, 2, 2, 2, 6, 6, 4, 1, 4, 2, 4, 2, 6, 4, 2, 2, 6, 4, 2, 4, 4, 4, 4, 2, 2, 2, 6, 4, 2, 4, 2, 2, 8, 2
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 26 2021

Keywords

Examples

			a(39) = a(3 * 13) = a(prime(2) * prime(6)), prime(3) - prime(2) = 5 - 3 = 2, prime(7) - prime(6) = 17 - 13 = 4, so a(39) = max(2, 4) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Max @@ (NextPrime[#[[1]]] - #[[1]] & /@ FactorInteger[n]); Table[a[n], {n, 1, 90}]

Formula

If n = Product (p_j^k_j) then a(n) = max (prime(pi(p_j) + 1) - p_j), where pi = A000720.
a(2^j*n) = a(n).
a(n^j) = a(n), j > 0.
a(prime(n)^j) = A001223(n), j > 0.
a(n!) = A327441(n).
a(prime(n)#) = A063095(n).
2 + Sum_{k=1..n-1} a(prime(k)^j) = prime(n), j > 0.
Sum_{d|n} mu(n/d) * a(d) = 0 if n is an even number or an odd number divisible by a square > 1.

A380329 a(n) = A151800((n-1)*A151800(n)).

Original entry on oeis.org

2, 2, 5, 11, 17, 29, 37, 67, 79, 89, 101, 131, 149, 211, 223, 239, 257, 307, 331, 419, 439, 461, 487, 641, 673, 701, 727, 757, 787, 877, 907, 1117, 1151, 1187, 1223, 1259, 1297, 1481, 1523, 1559, 1601, 1721, 1777, 1979, 2027, 2069, 2129, 2441, 2503, 2549, 2609
Offset: 0

Views

Author

Clark Kimberling, Jan 21 2025

Keywords

Examples

			p(1) = 2, so a(1) = p(0*p(1)) = 2.
		

Crossrefs

Programs

  • Maple
    seq(nextprime((n-1)*nextprime(n)), n=0..100); # Robert Israel, Jan 23 2025
  • Mathematica
    Table[NextPrime[(n-1)*NextPrime[n]], {n, 0, 80}]
  • PARI
    p(n) = nextprime(n+1);
    a(n) = p((n-1)*p(n)); \\ Michel Marcus, Jan 23 2025

A308022 a(n) = prevprime(2*n-1) - nextprime(n-1), where prevprime = A151799 and nextprime = A151800.

Original entry on oeis.org

0, 0, 0, 2, 0, 4, 2, 2, 6, 8, 6, 10, 6, 6, 12, 14, 12, 12, 14, 14, 18, 20, 14, 18, 18, 18, 24, 24, 22, 28, 24, 24, 24, 30, 30, 34, 32, 32, 32, 38, 36, 40, 36, 36, 42, 42, 36, 36, 44, 44, 48, 50, 44, 48, 50, 50, 54, 54, 52, 52, 46, 46, 46, 60, 60, 64, 60, 60
Offset: 2

Views

Author

Wesley Ivan Hurt, May 09 2019

Keywords

Comments

a(n) is the difference of the largest and smallest prime(s) in the closed interval [n, 2n-2].
Also, the maximum distance between all pairs of primes (not necessarily distinct) appearing among the largest parts of the partitions of 2n into two parts < 2n-1.

Examples

			a(10) = 6; The primes in the closed interval [10, 18] are 11, 13 and 17. The difference of the largest and smallest primes is 17 - 11 = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[2 n - 1, -1] - NextPrime[n - 1, 1], {n, 2, 100}]

Formula

a(n) = A151799(2*n-1) - A151800(n-1).

A377403 For n >= 2, a(n) is the number of iterations needed for the map: x -> x / A085392(x) if A085392(x) > 1, otherwise x -> x + A151800(x), to (the first occurrence of) 2.

Original entry on oeis.org

0, 3, 1, 3, 1, 3, 2, 4, 1, 4, 2, 3, 1, 4, 3, 4, 2, 3, 2, 4, 1, 3, 3, 4, 1, 5, 2, 4, 2, 3, 4, 4, 1, 4, 3, 3, 1, 4, 3, 4, 2, 4, 2, 5, 1, 4, 4, 4, 2, 4, 2, 5, 3, 4, 3, 4, 1, 5, 3, 7, 1, 5, 5, 4, 2, 3, 2, 4, 2, 6, 4, 4, 1, 5, 2, 4, 2, 5, 4, 6, 1, 3, 3, 4, 1, 4, 3, 3, 3, 4, 2, 4, 1, 4, 5, 4, 2, 5, 3, 4, 2, 4, 3, 5, 1, 6, 4, 3, 2, 4, 4, 6, 2, 4, 2, 5, 1, 4, 4, 5
Offset: 2

Views

Author

Ctibor O. Zizka, Oct 27 2024

Keywords

Comments

Also a(2*k + 1) = A001222(2*k + 1) + 2 + s, where s >= 1 for k = 5, 8, 14, 20, 21, 23, 26, 29, 30, 35, 36, 39, 48, 50, 51, ...

Examples

			n = 3: 3 -> 8 -> 4 -> 2, 3 iterations needed to reach 2, thus a(3) = 3.
n = 9: 9 -> 3 -> 8 -> 4 -> 2, 4 iterations needed to reach 2, thus a(9) = 4.
n = 11: 11 -> 24 -> 8 -> 4 - > 2, 4 iterations needed to reach 2, thus a(11) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[2] = 0; a[n_] := -1 + Length@ NestWhileList[If[CompositeQ[#], #/FactorInteger[#][[-1, 1]], # + NextPrime[#]] &, n, # > 2 &]; Array[a, 120, 2] (* Amiram Eldar, Oct 27 2024 *)

Formula

For n even: a(n) = A001222(n) - 1.
For n odd: a(n) = A001222(n) - 1 + A001222(A013634(A020639(n))).
Previous Showing 11-20 of 263 results. Next