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

A029707 Numbers n such that the n-th and the (n+1)-st primes are twin primes.

Original entry on oeis.org

2, 3, 5, 7, 10, 13, 17, 20, 26, 28, 33, 35, 41, 43, 45, 49, 52, 57, 60, 64, 69, 81, 83, 89, 98, 104, 109, 113, 116, 120, 140, 142, 144, 148, 152, 171, 173, 176, 178, 182, 190, 201, 206, 209, 212, 215, 225, 230, 234, 236, 253, 256, 262, 265, 268, 277
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Numbers m such that prime(m)^2 == 1 mod (prime(m) + prime(m + 1)). - Zak Seidov, Sep 18 2013
First differences are A027833. The complement is A049579. - Gus Wiseman, Dec 03 2024

Crossrefs

Cf. A014574, A027833 (first differences), A007508. Equals PrimePi(A001359) (cf. A000720).
The complement is A049579, first differences A251092 except first term.
Lengths of runs of terms differing by 2 are A179067.
The first differences have run-lengths A373820 except first term.
A000040 lists the primes, differences A001223 (run-lengths A333254, A373821).
A038664 finds the first prime gap of 2n.
A046933 counts composite numbers between primes.
For prime runs: A005381, A006512, A025584, A067774.

Programs

  • Maple
    A029707 := proc(n)
        numtheory[pi](A001359(n)) ;
    end proc:
    seq(A029707(n),n=1..30); # R. J. Mathar, Feb 19 2017
  • Mathematica
    Select[ Range@300, PrimeQ[ Prime@# + 2] &] (* Robert G. Wilson v, Mar 11 2007 *)
    Flatten[Position[Flatten[Differences/@Partition[Prime[Range[100]],2,1]], 2]](* Harvey P. Dale, Jun 05 2014 *)
  • Sage
    def A029707(n) :
       a = [ ]
       for i in (1..n) :
          if (nth_prime(i+1)-nth_prime(i) == 2) :
             a.append(i)
       return(a)
    A029707(277) # Jani Melik, May 15 2014

Formula

a(n) = A107770(n) - 1. - Juri-Stepan Gerasimov, Dec 16 2009

A373820 Run-lengths (differing by 0) of antirun-lengths (differing by > 2) of odd primes.

Original entry on oeis.org

2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1
Offset: 1

Views

Author

Gus Wiseman, Jun 22 2024

Keywords

Comments

Run-lengths of the version of A027833 with 1 prepended.

Examples

			The antiruns of odd primes (differing by > 2) begin:
   3
   5
   7  11
  13  17
  19  23  29
  31  37  41
  43  47  53  59
  61  67  71
  73  79  83  89  97 101
 103 107
 109 113 127 131 137
 139 149
 151 157 163 167 173 179
 181 191
 193 197
 199 211 223 227
 229 233 239
 241 251 257 263 269
 271 277 281
with lengths:
1, 1, 2, 2, 3, 3, 4, 3, 6, 2, 5, 2, 6, 2, 2, ...
with runs:
  1  1
  2  2
  3  3
  4
  3
  6
  2
  5
  2
  6
  2  2
  4
  3
  5
  3
  4
with lengths a(n).
		

Crossrefs

Run-lengths of A027833 (if we prepend 1), partial sums A029707.
For runs we have A373819, run-lengths of A251092.
Positions of first appearances are A373827, sorted 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.
For composite runs: A005381, A054265, A068780, A373403, A373404.

Programs

  • Mathematica
    Length/@Split[Length/@Split[Select[Range[3,1000],PrimeQ],#2-#1>2&]//Most]//Most

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

Original entry on oeis.org

1, 2, 13, 11, 105, 57, 33, 69, 59, 29, 227, 129, 211, 341, 75, 321, 51, 45, 407, 313, 459, 301, 767, 1829, 413, 537, 447, 1113, 1301, 1411, 1405, 2865, 1709, 1429, 3471, 709, 2543, 5231, 1923, 679, 3301, 2791, 6555, 5181, 6345, 11475, 2491, 10633
Offset: 1

Views

Author

Gus Wiseman, Jun 21 2024

Keywords

Comments

Positions of first appearances in A373819.

Examples

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

Crossrefs

Firsts of A373819 (run-lengths of A251092).
For antiruns we have A373827 (sorted A373826), firsts of A373820, run-lengths of A027833 (partial sums A029707, firsts A373401, sorted A373402).
The sorted version is A373824.
A000040 lists the primes.
A001223 gives differences of consecutive primes (firsts A073051), run-lengths A333254 (firsts A335406), 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.
For composite runs: A005381, A054265, A068780, A176246, A373403, A373404.

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]}]

A049579 Numbers k such that prime(k)+2 divides (prime(k)-1)!.

Original entry on oeis.org

4, 6, 8, 9, 11, 12, 14, 15, 16, 18, 19, 21, 22, 23, 24, 25, 27, 29, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 46, 47, 48, 50, 51, 53, 54, 55, 56, 58, 59, 61, 62, 63, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that prime(k+1) - prime(k) does not divide prime(k+1) + prime(k). These are the numbers k for which prime(k+1) - prime(k) > 2. - Thomas Ordowski, Mar 31 2022
If we prepend 1, the first differences are A251092 (see also A175632). The complement is A029707. - Gus Wiseman, Dec 03 2024

Examples

			prime(4) = 7, 6!+1 = 721 gives residue 1 when divided by prime(4)+2 = 9.
		

Crossrefs

The first differences are A251092 except first term, run-lengths A373819.
The complement is A029707.
Runs of terms differing by one have lengths A027833, min A107770, max A155752.
A000040 lists the primes, differences A001223 (run-lengths A333254, A373821).
A038664 finds the first prime gap of difference 2n.
A046933 counts composite numbers between primes.
A071148 gives partial sums of odd primes.

Programs

  • Mathematica
    pnmQ[n_]:=Module[{p=Prime[n]},Mod[(p-1)!+1,p+2]==1]; Select[Range[ 100],pnmQ] (* Harvey P. Dale, Jun 24 2017 *)
  • PARI
    isok(n) = (((prime(n)-1)! + 1) % (prime(n)+2)) == 1; \\ Michel Marcus, Dec 31 2013

Extensions

Definition edited by Thomas Ordowski, Mar 31 2022

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

Original entry on oeis.org

1, 2, 11, 13, 29, 33, 45, 51, 57, 59, 69, 75, 105, 129, 211, 227, 301, 313, 321, 341, 407, 413, 447, 459, 537, 679, 709, 767, 1113, 1301, 1405, 1411, 1429, 1439, 1709, 1829, 1923, 2491, 2543, 2791, 2865, 3301, 3471, 3641, 4199, 4611, 5181, 5231, 6345, 6555
Offset: 1

Views

Author

Gus Wiseman, Jun 21 2024

Keywords

Comments

Sorted positions of first appearances in A373819.

Examples

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

Crossrefs

Sorted firsts of A373819 (run-lengths of A251092).
The unsorted version is A373825.
For antiruns we have A373826, unsorted A373827.
A000040 lists the primes.
A001223 gives differences of consecutive primes (firsts A073051), run-lengths A333254 (firsts A335406), 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.
A373820 gives run-lengths of antirun-lengths, run-lengths of A027833.
For composite runs: A005381, A054265, A068780, A373403, A373404.

Programs

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

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[[#]]]&]

A373828 Run-sums (differing by 0) of run-lengths (differing by 2) of odd primes.

Original entry on oeis.org

3, 4, 1, 2, 1, 2, 2, 2, 1, 2, 4, 4, 3, 4, 4, 6, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 3, 2, 10, 4, 4, 2, 7, 2, 4, 2, 3, 2, 2, 2, 1, 2, 2, 2, 18, 6, 2, 2, 2, 2, 17, 4, 1, 4, 2, 2, 6, 2, 9, 2, 3, 2, 1, 2, 1, 2, 1, 2, 8, 2, 3, 2, 2, 4, 15, 2, 1, 2, 4, 2, 1, 2, 1, 2, 7, 2
Offset: 1

Views

Author

Gus Wiseman, Jun 23 2024

Keywords

Comments

Run-sums of A251092.

Examples

			The odd primes are:
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, ...
with runs:
{3,5,7}, {11,13}, {17,19}, {23}, {29,31}, {37}, {41,43}, {47}, {53}, ...
with lengths:
3, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, ...
with runs:
{3}, {2,2}, {1}, {2}, {1}, {2}, {1,1}, {2}, {1}, {2}, {1,1,1,1}, {2,2}, ...
with sums a(n).
		

Crossrefs

Run-sums of A251092.
The run-lengths (instead of run-sums) are A373819, firsts A373825, A373824.
A000040 lists the primes.
A001223 gives first differences of primes.
A027833 gives antirun-lengths of primes > 3 (prepended run-lengths A373820).
A046933 counts composite numbers between primes.
A071148 gives partial sums of odd primes.
A333254 gives run-lengths of first differences of primes.
A373821 gives run-lengths of run-lengths of first differences of odd primes.

Programs

  • Mathematica
    Total/@Split[Length /@ Split[Select[Range[3,10000],PrimeQ], #1+2==#2&]//Most]//Most
Showing 1-7 of 7 results.