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-10 of 132 results. Next

A249666 Numbers n such that the sum of n and the largest primeA151799(n)) is prime.

Original entry on oeis.org

3, 4, 6, 10, 12, 16, 22, 24, 30, 36, 42, 46, 50, 54, 56, 66, 70, 76, 78, 84, 90, 92, 100, 114, 116, 120, 126, 130, 132, 142, 144, 156, 160, 170, 174, 176, 180, 186, 192, 196, 202, 210, 220, 222, 226, 232, 234, 240, 246, 250, 252, 276, 280, 282, 286, 288, 294, 300, 306, 310, 324
Offset: 1

Views

Author

Antonio Roldán, Dec 03 2014

Keywords

Examples

			66 is in the sequence because A151799(66)=61, and 66+61=127 is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[400],PrimeQ[#+NextPrime[#,-1]]&] (* Harvey P. Dale, Aug 04 2019 *)
  • PARI
    {for(i=3,10^3,k=i+precprime(i-1);if(isprime(k),print1(i,", ")))}

A249676 Terms k of A249667 such that k-A151799(k) = A151800(k)-k.

Original entry on oeis.org

6, 30, 50, 144, 300, 560, 610, 650, 660, 714, 780, 810, 816, 870, 1120, 1176, 1190, 1806, 2130, 2470, 2490, 2550, 2922, 3030, 3240, 3330, 3390, 3480, 3600, 3620, 3840, 4266, 4368, 5796, 5850, 6270, 6786, 6954, 7074, 7710, 8280, 9400, 9990, 10146, 10350, 10380, 10530, 10660, 11064
Offset: 1

Views

Author

Antonio Roldán, Dec 03 2014

Keywords

Examples

			610 is in A249667: the least prime>610 is 613, and 610+613=1223 is prime; the largest prime<610 is 607, and 610+607=1217 is prime. Also, 613-610=610-607=3, then 610 is in the current sequence.
		

Crossrefs

Programs

  • PARI
    {for(i=3,2*10^4,m=nextprime(i+1);k=i+m;n=precprime(i-1);q=i+n;if(isprime(k)&&isprime(q)&&m-i==i-n,print1(i,", ")))}

A286208 Greater of Wilson's pseudo-twin primes: primes q such that p! == 1 (mod q), where p=A151799(q) is the previous prime before q, and q-p>2.

Original entry on oeis.org

7853, 594278556271609021, 4259842839142238791410741595983041626644087509
Offset: 1

Views

Author

Max Alekseyev and Thomas Ordowski, May 04 2017

Keywords

Comments

By Wilson's theorem, p! == 1 (mod p+2) whenever (p,p+2) are twin primes. This sequence and A286181 concern consecutive primes (p,q) satisfying p! = 1 (mod q), where d = q-p > 2.
It follows that (d-1)! == 1 (mod q). Listed terms correspond to d = 12, 30, 76 (cf. A286230). Further terms should have d>=140.
Also, primes q=prime(n) such that A275111(n-1)=1, and (prime(n-1),prime(n)) are not twin primes (i.e., q is not a term of A006512).

Crossrefs

Subsequence of A166864.

A340707 a(n) = (prevprime(2^n) + nextprime(2^n))/2 - 2^n where prevprime(n) = A151799(n) and nextprime(n) = A151800(n).

Original entry on oeis.org

0, 1, -1, 2, 0, 1, -2, 3, 2, -2, 0, 8, 12, -8, -7, 14, -1, 10, 2, 4, 6, -3, 20, -2, 5, -5, -27, 4, -16, 5, 5, 4, -8, 11, 13, -8, -19, 8, -36, 3, 2, -14, -5, 2, -3, -55, -19, -6, 14, -54, -13, -53, 63, -26, 38, -2, 21, 38, -30, 7, 39, 2, -23, 41, 2, -8, 5, 5, -5, -110
Offset: 2

Views

Author

Hugo Pfoertner, Jan 29 2021

Keywords

Comments

a(n) > 0 if the difference nextprime(2^n) - 2^n = A013597(n) is greater than the difference 2^n - previousprime(2^n) = A013603(n).

Examples

			a(4) = -1: 2^4 = 16, (13 + 17 - 32)/2 = -1;
a(5) = 2: 2^5 = 32, (31 + 37 - 64)/2 = 2;
a(6) = 0: 2^6 = 64, (61 + 67 - 128)/2 = 0.
		

Crossrefs

Programs

  • Maple
    a:= (p-> (nextprime(p)+prevprime(p))/2-p)(2^n):
    seq(a(n), n=2..75);  # Alois P. Heinz, Jan 29 2021
  • Mathematica
    Array[(NextPrime[2^#] + NextPrime[2^#, -1] - 2^(# + 1))/2 &, 60, 2] (* Michael De Vlieger, Aug 07 2022 *)
  • PARI
    for(k=2,71,my(p2=2^k,pp=precprime(p2),pn=nextprime(p2));if(print1((pp+pn-2*p2)/2", ")))

Formula

a(n) = (A013597(n) - A013603(n))/2.
a(A226178(n)) = 0.

Extensions

Name made more precise by Peter Luschny, Aug 08 2022

A357362 Primes q such that either p^(q-1) == 1 (mod q^2) or q^(p-1) == 1 (mod p^2), where p = A151799(q).

Original entry on oeis.org

7, 53, 59, 151057, 240733, 911135857
Offset: 1

Views

Author

Felix Fröhlich, Sep 25 2022

Keywords

Crossrefs

Programs

  • PARI
    is(n) = my(b=precprime(n-1)); Mod(b, n^2)^(n-1)==1 || Mod(n, b^2)^(b-1)==1
    forprime(p=3, , if(is(p), print1(p, ", ")))
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen():
        p, q = 2, 3
        while True:
            if pow(p, q-1, q*q) == 1 or pow(q, p-1, p*p) == 1: yield q
            p, q = q, nextprime(q)
    print(list(islice(agen(), 5))) # Michael S. Branicky, Sep 30 2022

Extensions

a(6) from Michael S. Branicky, Sep 26 2022

A357365 Primes q such that either p^(q-1) == 1 (mod q^2) or q^(p-1) == 1 (mod p^2), where p = A151799(A151799(A151799(A151799(q)))).

Original entry on oeis.org

19, 67, 349, 2011, 22307, 13699249, 2018905087, 9809844767
Offset: 1

Views

Author

Felix Fröhlich, Sep 25 2022

Keywords

Crossrefs

Programs

  • PARI
    is(n) = my(b=precprime(precprime(precprime(precprime(n-1)-1)-1)-1)); Mod(b, n^2)^(n-1)==1 || Mod(n, b^2)^(b-1)==1
    forprime(p=11, , if(is(p), print1(p, ", ")))
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen():
        p, m1, m2, m3, q = 2, 3, 5, 7, 11
        while True:
            if pow(p, q-1, q*q) == 1 or pow(q, p-1, p*p) == 1: yield q
            p, m1, m2, m3, q = m1, m2, m3, q, nextprime(q)
    print(list(islice(agen(), 5))) # Michael S. Branicky, Sep 30 2022

Extensions

a(7)-a(8) from Michael S. Branicky, Sep 26 2022

A035031 For n >= 7, max(A151799(n), 2*A151799(floor((n-1)/2))).

Original entry on oeis.org

1, 2, 2, 3, 3, 5, 5, 7, 7, 7, 7, 11, 11, 13, 13, 13, 14, 17, 17, 19, 19, 19, 19, 23, 23, 23, 23, 23, 26, 29, 29, 31, 31, 31, 31, 31, 34, 37, 37, 37, 38, 41, 41, 43, 43, 43, 43, 47, 47, 47, 47, 47, 47, 53, 53, 53, 53, 53
Offset: 1

Views

Author

Keywords

References

  • S. K. Stein and S. Szabo, Algebra and Tiling, MAA Carus Monograph 25, 1994, page 104.

Crossrefs

Programs

  • Maple
    f:= proc(n) max(prevprime(n), 2*prevprime(floor((n-1)/2))) end proc:
    for i from 1 to 6 do f(i):= [1, 2, 2, 3, 3, 5, 5][i] od:
    map(f, [$1..100]); # Robert Israel, Dec 15 2023
  • Mathematica
    Join[{1,2},Table[Max[NextPrime[n,-1],2NextPrime[Floor[(n-1)/2],-1]],{n,3,70}]] (* Harvey P. Dale, Mar 12 2022 *)

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).

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).
Showing 1-10 of 132 results. Next