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 21-30 of 34 results. Next

A093868 Smallest prime that differs from a multiple of n by unity.

Original entry on oeis.org

2, 3, 2, 3, 11, 5, 13, 7, 17, 11, 23, 11, 53, 13, 29, 17, 67, 17, 37, 19, 41, 23, 47, 23, 101, 53, 53, 29, 59, 29, 61, 31, 67, 67, 71, 37, 73, 37, 79, 41, 83, 41, 173, 43, 89, 47, 281, 47, 97, 101, 101, 53, 107, 53, 109, 113, 113, 59, 353, 59, 367, 61, 127, 127, 131, 67, 269
Offset: 1

Views

Author

Amarnath Murthy, Apr 20 2004

Keywords

Comments

Numbers n such that a(n-1)=a(n+1)=n are A025584 (primes p such that p-2 is not a prime). - Rick L. Shepherd, Aug 23 2004

Crossrefs

Cf. A093869.
Cf. A034694 (Smallest prime == 1 (mod n)), A038700 (Smallest prime == -1 (mod n)).

Programs

  • Maple
    f:= proc(n) local j,k;
      for k from 1 do
        for j in [-1,1] do
          if isprime(k*n+j) then return k*n+j fi
      od od
    end proc:
    map(f, [$1..100]); # Robert Israel, Nov 07 2019
  • Mathematica
    a[n_] := Module[{p}, For[p = 2, True, p = NextPrime[p], If[Divisible[p-1, n] || Divisible[p+1, n], Return[p]]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 04 2023 *)
  • PARI
    a(n) = forprime(p=2, , if (!((p+1) % n) || !((p-1) % n), return (p))); \\ Michel Marcus, Aug 08 2014

Formula

a(n) = min(A034694(n), A038700(n)) for all n >= 1. - Rick L. Shepherd, Aug 23 2004

Extensions

More terms from Rick L. Shepherd, Aug 23 2004

A067830 Primes p such that sigma(p-4) < p.

Original entry on oeis.org

5, 7, 11, 17, 23, 41, 47, 71, 83, 101, 107, 113, 131, 167, 197, 227, 233, 281, 311, 317, 353, 383, 401, 443, 461, 467, 491, 503, 617, 647, 677, 743, 761, 773, 827, 857, 863, 881, 887, 911, 941, 971, 1013, 1091, 1097, 1217, 1283, 1301, 1307, 1427, 1433, 1451
Offset: 1

Views

Author

Benoit Cloitre, Feb 08 2002

Keywords

Comments

Except for the first term, terms are primes of the form p+4 with p prime, i.e., the sequence is essentially A031505, A046132. In other words, the solutions to sigma(x) < x + 4 are 1,2,4 and the odd primes. - Ralf Stephan, Feb 09 2004

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[3, 230]], DivisorSigma[1, #-4] < # &] (* Amiram Eldar, Apr 25 2025 *)
  • PARI
    isok(p) = isprime(p) && (p>4) && (sigma(p-4) < p); \\ Michel Marcus, Feb 15 2021

Extensions

Edited by Charles R Greathouse IV, Mar 19 2010

A373826 Sorted positions of first appearances in the run-lengths (differing by 0) of the antirun-lengths (differing by > 2) of the odd primes.

Original entry on oeis.org

1, 4, 38, 6781, 23238, 26100
Offset: 1

Views

Author

Gus Wiseman, Jun 22 2024

Keywords

Comments

Sorted positions of first appearances in A373820 (run-lengths of A027833 with 1 prepended).

Examples

			The odd primes begin:
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, ...
with antiruns (differing by > 2):
(3), (5), (7,11), (13,17), (19,23,29), (31,37,41), (43,47,53,59), ...
with lengths:
1, 1, 2, 2, 3, 3, 4, 3, 6, 2, 5, 2, 6, 2, 2, 4, 3, 5, 3, 4, 5, 12, ...
which have runs:
(1,1), (2,2), (3,3), (4), (3), (6), (2), (5), (2), (6), (2,2), (4), ...
with lengths:
2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
with sorted positions of first appearances a(n).
		

Crossrefs

Sorted positions of first appearances in A373820, cf. A027833.
For runs we have A373824 (unsorted A373825), sorted firsts of A373819.
The unsorted version is A373827.
A000040 lists the primes.
A001223 gives differences of consecutive primes, run-lengths A333254, run-lengths of run-lengths A373821.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.

Programs

  • Mathematica
    t=Length/@Split[Length /@ Split[Select[Range[3,10000],PrimeQ],#1+2!=#2&]];
    Select[Range[Length[t]],FreeQ[Take[t,#-1],t[[#]]]&]

A373827 Position of first appearance of n in the run-lengths (differing by 0) of the antirun-lengths (differing by > 2) of the odd primes.

Original entry on oeis.org

4, 1, 38, 6781, 26100, 23238
Offset: 1

Views

Author

Gus Wiseman, Jun 22 2024

Keywords

Comments

Positions of first appearances in A373820 (run-lengths of A027833 with 1 prepended).

Examples

			The odd primes begin:
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, ...
with antiruns (differing by > 2):
(3), (5), (7,11), (13,17), (19,23,29), (31,37,41), (43,47,53,59), ...
with lengths:
1, 1, 2, 2, 3, 3, 4, 3, 6, 2, 5, 2, 6, 2, 2, 4, 3, 5, 3, 4, 5, 12, ...
which have runs:
(1,1), (2,2), (3,3), (4), (3), (6), (2), (5), (2), (6), (2,2), (4), ...
with lengths:
2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
with positions of first appearances a(n).
		

Crossrefs

Positions of first appearances in A373820.
For runs instead of antiruns we have A373825, sorted A373824.
The sorted version is A373826.
A000040 lists the primes.
A001223 gives differences of consecutive primes, run-lengths A333254, run-lengths of run-lengths A373821.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.

Programs

  • Mathematica
    t=Length/@Split[Length /@ Split[Select[Range[3,10000],PrimeQ],#1+2!=#2&]//Most]//Most;
    spna[y_]:=Max@@Select[Range[Length[y]],SubsetQ[t,Range[#1]]&];
    Table[Position[t,k][[1,1]],{k,spna[t]}]

A100319 Even numbers m such that at least one of m-1 and m+1 is composite.

Original entry on oeis.org

8, 10, 14, 16, 20, 22, 24, 26, 28, 32, 34, 36, 38, 40, 44, 46, 48, 50, 52, 54, 56, 58, 62, 64, 66, 68, 70, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 104, 106, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 140, 142, 144, 146, 148
Offset: 1

Views

Author

Rick L. Shepherd, Nov 13 2004

Keywords

Comments

Subsequence of A100318. For each k >= 0, a(k+1) = a(k) + 2 unless a(k) + 1 and a(k) + 3 are twin primes, in which case a(k+1) = a(k) + 4 (as a(k) - 1 and a(k) + 5 are divisible by 3).
The even nonisolated primes(n+1). - Juri-Stepan Gerasimov, Nov 09 2009

Crossrefs

Cf. A100318 (supersequence containing odd and even n), A045718 (n such that at least one of n-1 and n+1 is prime).
Cf. A167692(the even nonisolated nonprimes). - Juri-Stepan Gerasimov, Nov 09 2009
Complement of A014574 (average of twin prime pairs) w.r.t. A005843 (even numbers), except for missing term 2.

Programs

  • Mathematica
    Select[2*Range[100], CompositeQ[#-1] || CompositeQ[#+1] &]  (* G. C. Greubel, Mar 09 2019 *)
  • PARI
    forstep(n=4,300,2,if(isprime(n-1)+isprime(n+1)<=1,print1(n,",")))
    
  • Sage
    [n for n in (3..250) if mod(n,2)==0 and (is_prime(n-1) + is_prime(n+1)) < 2] # G. C. Greubel, Mar 09 2019

Formula

a(n) = A167692(n+1). - Juri-Stepan Gerasimov, Nov 09 2009

A156828 a(1) = 2. a(n) = the smallest prime >= a(n-1) + 4.

Original entry on oeis.org

2, 7, 11, 17, 23, 29, 37, 41, 47, 53, 59, 67, 71, 79, 83, 89, 97, 101, 107, 113, 127, 131, 137, 149, 157, 163, 167, 173, 179, 191, 197, 211, 223, 227, 233, 239, 251, 257, 263, 269, 277, 281, 293, 307, 311, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 389
Offset: 1

Views

Author

Leroy Quet, Feb 16 2009

Keywords

Comments

Apparently a(n) = A025584(n) for all n>2. Verified for indices n <= 100000. - R. J. Mathar, Mar 01 2010
Assume a(n-1) is in A025584 and greater than 3. Then, if a(n) = a(n-1) + 4, a(n-1) + 2 cannot be prime, and a(n) is in A025584. Otherwise, a(n) must still be in A025584, because if it were not, a(n) would not be the smallest valid prime. - Charlie Neder, Dec 16 2018

Crossrefs

Cf. A156829.

Programs

  • Magma
    [n le 1 select 2 else NextPrime(Self(n-1)+3): n in [1..60]]; // Vincenzo Librandi, Dec 21 2018
  • Maple
    p := 2: for n from 1 to 100 do printf("%d,",p) ; p := nextprime(p+3) ; od: # R. J. Mathar, Feb 21 2009
  • Mathematica
    a[1] = 2; a[n_] := a[n] = NextPrime[a[n - 1] + 3]; Array[a, 60] (* Amiram Eldar, Dec 16 2018 *)
    NestList[NextPrime[#+3]&,2,60] (* Harvey P. Dale, Jan 05 2019 *)

Extensions

More terms from R. J. Mathar, Feb 21 2009

A175073 Primes q with result 1 under iterations of {r mod (max prime p < r)} starting at r = q.

Original entry on oeis.org

3, 11, 17, 23, 29, 37, 41, 47, 53, 59, 67, 71, 79, 83, 89, 97, 101, 107, 113, 127, 131, 137, 149, 157, 163, 167, 173, 179, 191, 197, 211, 223, 227, 233, 239, 251, 257, 263, 269, 277, 281, 293, 307
Offset: 1

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

Subsequence of A175071.
Union of a(n) and A175074 is A175071. - Jaroslav Krizek, Jan 30 2010
The terms in A025584 but not in here are 2, 2999, 3299, 5147, 5981, 8999, 9587, ... , apparently those listed in A175080. - R. J. Mathar, Feb 01 2010
a(n-1)=A156828(n) in the range n=3..348, but afterwards the sequences differ because numbers like 2999 and 3229 are in A156828 but not in here. - R. J. Mathar, Mar 01 2010
Conjecture: under this iteration procedure, all primes eventually will yield either a 2 or a 1. If a 2 results, all subsequent terms are zeros; if a 1 results, all subsequent terms are -1s. The conjecture is true for the first 2 million primes. - Harvey P. Dale, Jan 17 2014

Examples

			Iteration procedure for a(2) = 11: 11 mod 7 = 4, 4 mod 3 = 1.
		

Crossrefs

Note that all three of A025584, A156828, A175073 are different sequences. - N. J. A. Sloane, Apr 10 2011

Programs

  • Maple
    isA175073 := proc(p)
        local r,rold;
        if not isprime(p) then
            return false;
        end if;
        r := p ;
        while true do
            rold :=r ;
            if r = 2 then
                return false ;
            end if;
            r := modp(r,prevprime(r)) ;
            if r = 1 then
                return true;
            elif r= rold then
                return false ;
            end if;
        end do:
    end proc:
    A175073 := proc(n)
        option remember ;
        if n= 1 then
            3;
        else
            for p from procname(n-1)+2 by 2 do
                if isA175073(p) then
                    return p;
                end if;
            end do:
        end if;
    end proc:
    seq(A175073(n),n=1..40) ; # R. J. Mathar, Mar 25 2024
  • Mathematica
    r1Q[n_] := FixedPoint[Mod[#, NextPrime[#, -1]] &, n] == -1; Select[Prime[ Range[70]],r1Q] (* This program relies upon the conjecture described in the comments above *) (* Harvey P. Dale, Jan 17 2014 *)

A373823 Half the sum of the n-th maximal run of first differences of odd primes.

Original entry on oeis.org

2, 2, 1, 2, 1, 2, 3, 1, 3, 2, 1, 2, 6, 1, 3, 2, 1, 3, 2, 3, 4, 2, 1, 2, 1, 2, 7, 2, 3, 1, 5, 1, 6, 2, 6, 1, 5, 1, 2, 1, 12, 2, 1, 2, 3, 1, 5, 9, 1, 3, 2, 1, 5, 7, 2, 1, 2, 7, 3, 5, 1, 2, 3, 4, 6, 2, 3, 4, 2, 4, 5, 1, 5, 1, 3, 2, 3, 4, 2, 1, 2, 6, 4, 2, 4, 2, 3
Offset: 1

Views

Author

Gus Wiseman, Jun 22 2024

Keywords

Comments

Halved run-sums of A001223.

Examples

			The odd primes are:
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, ...
with first differences:
2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, ...
with runs:
(2,2), (4), (2), (4), (2), (4), (6), (2), (6), (4), (2), (4), (6,6), ...
with halved sums a(n).
		

Crossrefs

Halved run-sums of A001223.
For run-lengths we have A333254, run-lengths of run-lengths A373821.
Multiplying by two gives A373822.
A000040 lists the primes.
A027833 gives antirun lengths of odd primes (partial sums A029707).
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
A373820 gives run-lengths of antirun-lengths of odd primes.

Programs

  • Mathematica
    Total/@Split[Differences[Select[Range[3,1000],PrimeQ]]]/2

A062302 Number of ways writing n-th prime as a sum of a prime and a nonprime.

Original entry on oeis.org

0, 1, 0, 1, 4, 3, 6, 5, 8, 9, 8, 11, 12, 11, 14, 15, 16, 15, 18, 19, 18, 21, 22, 23, 24, 25, 24, 27, 26, 29, 30, 31, 32, 31, 34, 33, 36, 37, 38, 39, 40, 39, 42, 41, 44, 43, 46, 47, 48, 47, 50, 51, 50, 53, 54, 55, 56, 55, 58, 59, 58, 61, 62, 63, 62, 65, 66, 67, 68, 67, 70, 71, 72
Offset: 1

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Table[c = 0; Do[i = Prime[k]; If[i + j == Prime[n] && ! PrimeQ[j], c = c + 1], {k, n - 1}, {j, Prime[n] - 1}]; c, {n, 73}] (* Jayanta Basu, Apr 22 2013 *)
    nn = 100; mx = Prime[nn]; ps = Prime[Range[nn]]; notPs = Complement[Range[mx], ps]; t2 = Table[0, {Range[mx]}]; Do[s = i + j; If[s <= mx, t2[[s]]++], {i, ps}, {j, notPs}];  t2[[ps]] (* T. D. Noe, Apr 23 2013 *)

Formula

a(n) = A062602(A000040(n)) = number of [nonprime+prime] partitions of prime(n)

A133410 Least prime p such that p-6*n is prime.

Original entry on oeis.org

2, 11, 17, 23, 29, 37, 41, 47, 53, 59, 67, 71, 79, 83, 89, 97, 101, 107, 113, 127, 127, 131, 137, 149, 149, 157, 163, 167, 173, 179, 191, 191, 197, 211, 211, 223, 223, 227, 233, 239, 251, 251, 257, 263, 269, 277, 281, 293, 293, 307, 307, 311, 317, 331, 331, 337
Offset: 0

Views

Author

Pierre CAMI, Nov 25 2007

Keywords

Comments

If duplicates are omitted, this is the sequence of primes p such that all p - phi(k) - 1 are composite for 1 <= phi(k)-1 < p. - Michel Lagneau, Sep 14 2012
If duplicates are omitted, the given entries equal A025584 (p: p-2 is not a prime) except A025584 includes 3 (since 1 is not prime). - Harry G. Coin, Nov 29 2015

Crossrefs

Cf. A025584, A067829 (complement w.r.t. primes), A133387.

Programs

  • Maple
    Primes:= select(isprime,{2,seq(i,i=3..10^4,2)}):
    seq(min(Primes intersect map(`+`,Primes,6*n)),n=0..1000); # Robert Israel, Nov 30 2015
  • Mathematica
    a={};Do[i=6*n+1; While[Not[PrimeQ[i]&&PrimeQ[i-6*n]],i++ ];AppendTo[a,i],{n,0,60}]; a (* Stefan Steinerberger, Nov 26 2007 *)
    Table[Module[{p=NextPrime[6n]},While[!PrimeQ[p-6n],p=NextPrime[p]];p],{n,0,60}] (* Harvey P. Dale, Apr 07 2025 *)
  • PARI
    a(n) = {k=1; while(k, if(ispseudoprime(prime(k)-6*n), return(prime(k))); k++)} \\ Altug Alkan, Dec 04 2015

Extensions

More terms from Stefan Steinerberger, Nov 26 2007
Previous Showing 21-30 of 34 results. Next