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

A005383 Primes p such that (p+1)/2 is prime.

Original entry on oeis.org

3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253
Offset: 1

Views

Author

Keywords

Comments

Also, n such that sigma(n)/2 is prime. - Joseph L. Pe, Dec 10 2001; confirmed by Vladeta Jovovic, Dec 12 2002
Primes that are followed by twice a prime, i.e., are followed by a semiprime. (For primes followed by two semiprimes, see A036570.) - Zak Seidov, Aug 03 2013, Dec 31 2015
If A005382(n) is in A168421 then a(n) is a twin prime with a Ramanujan prime, A104272(k) = a(n) - 2. - John W. Nicholson, Jan 07 2016
Starting with 13 all terms are congruent to 1 mod 12. - Zak Seidov, Feb 16 2017
Numbers n such that both n and n+12 are terms are 61, 661, 1201, 4261, 5101, 6121, 6361 (all congruent to 1 mod 60). - Zak Seidov, Mar 16 2017
Primes p for which there exists a prime q < p such that 2q == 1 (mod p). Proof: q = (p + 1)/2. - David James Sycamore, Nov 10 2018
Prime numbers n such that phi(sigma(2n)) = phi(2n), excluding n=3 and n=5; as well as phi(sigma(3n)) = phi(3n), excluding n=3 only. - Richard R. Forberg, Dec 22 2020

Examples

			Both 3 and (3+1)/2 = 2 are primes, both 5 and (5+1)/2 = 3 are primes. - _Zak Seidov_, Nov 19 2012
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A subsequence of A000040 which has A036570 as subsequence.

Programs

  • Haskell
    a005383 n = a005383_list !! (n-1)
    a005383_list = [p | p <- a065091_list, a010051 ((p + 1) `div` 2) == 1]
    -- Reinhard Zumkeller, Nov 06 2012
    
  • MATLAB
    LIMIT = 8000 % Find all members of A005383 less than LIMIT A = primes(LIMIT); n = length(A); %n is number of primes less than LIMIT B = 2*A - 1; C = ones(n, 1)*A; %C is an n X n matrix, with C(i, j) = j-th prime D = B'*ones(1, n); %D is an n X n matrix, with D(i, j) = (i-th prime)*2 - 1 [i, j] = find(C == D); A(j)
    
  • Magma
    [n: n in [1..3300] | IsPrime(n) and IsPrime((n+1) div 2) ]; // Vincenzo Librandi, Sep 25 2012
    
  • Maple
    for n to 300 do
      X := ithprime(n);
    Y := ithprime(n+1);
    Z := 1/2 mod Y;
      if isprime(Z) then print(Y);
    end if:
    end do:
    # David James Sycamore, Nov 11 2018
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[(# + 1)/2] &] (* Zak Seidov, Nov 19 2012 *)
  • PARI
    A005383_list(n) = select(m->isprime(m\2+1),primes(n)[2..n]) \\ Charles R Greathouse IV, Sep 25 2012
    
  • Python
    from sympy import isprime
    [n for n in range(3, 5000) if isprime(n) and isprime((n + 1)//2)]
    # Indranil Ghosh, Mar 17 2017
    
  • Sage
    [n for n in prime_range(3, 1000) if is_prime((n + 1) // 2)]
    # F. Chapoton, Dec 17 2019

Formula

a(n) = A129521(n)/A005382(n). - Reinhard Zumkeller, Apr 19 2007
A000035(a(n))*A010051(a(n))*A010051((a(n)+1)/2) = 1. - Reinhard Zumkeller, Nov 06 2012
a(n) = 2*A005382(n) - 1. - Zak Seidov, Nov 19 2012
a(n) = A005382(n) + phi(A005382(n)) = A005382(n) + A000010(A005382(n)). - Torlach Rush, Mar 10 2014

Extensions

More terms from David Wasserman, Jan 18 2002
Name changed by Jianing Song, Nov 27 2021

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

A373403 Length of the n-th maximal antirun of composite numbers differing by more than one.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

This antirun ranges from A005381 (with 4 prepended) to A068780, with sum A373404.
An antirun of a sequence (in this case A002808) is an interval of positions such that consecutive terms differ by more than one.

Examples

			Row-lengths of:
   4   6   8
   9
  10  12  14
  15
  16  18  20
  21
  22  24
  25
  26
  27
  28  30  32
  33
  34
  35
  36  38
  39
  40  42  44
		

Crossrefs

Functional neighbors: A005381, A027833 (partial sums A029707), A068780, A176246 (rest of A046933, firsts A073051), A373127, A373404, A373409.
A000040 lists the primes, differences A001223.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    Length/@Split[Select[Range[100],CompositeQ],#1+1!=#2&]//Most

Formula

a(2n) = 1.
a(2n - 1) = A196274(n) for n > 1.

A068780 Composite numbers n such that n+1 is also composite.

Original entry on oeis.org

8, 9, 14, 15, 20, 21, 24, 25, 26, 27, 32, 33, 34, 35, 38, 39, 44, 45, 48, 49, 50, 51, 54, 55, 56, 57, 62, 63, 64, 65, 68, 69, 74, 75, 76, 77, 80, 81, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 98, 99, 104, 105, 110, 111, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124
Offset: 1

Views

Author

Robert G. Wilson v, Mar 04 2002

Keywords

Comments

For all primes p, neither p nor p-1 is in the sequence. - Jon Perry, Oct 12 2014

Crossrefs

Cf. A001359.
Equals A005381(n) - 1.

Programs

  • Magma
    [n: n in [1..200] | not IsPrime(n) and not IsPrime(n+1)]; // Vincenzo Librandi, Oct 17 2014
    
  • Maple
    q:= n-> andmap(not isprime, [n, n+1]):
    select(q, [$1..150])[];  # Alois P. Heinz, Jun 24 2021
  • Mathematica
    Select[ Range[2, 200], !PrimeQ[ # ] && !PrimeQ[ # + 1] &]
    SequencePosition[Table[If[CompositeQ[n],1,0],{n,150}],{1,1}][[;;,1]] (* Harvey P. Dale, Feb 01 2025 *)
  • PARI
    is(n)=!isprime(n) && !isprime(n+1) \\ Charles R Greathouse IV, Dec 19 2018

Formula

There are x - 2x/log x + O(x/log^2 x) members up to x. The coefficient of the next asymptotic term depends on the quantitative version of the twin prime conjecture (though it can be bounded between -0.6796763684 and 2.4885722184, with the former conjectured to be the case). - Charles R Greathouse IV, Dec 19 2018

Extensions

Definition reworded by N. J. A. Sloane, Aug 24 2012

A072055 a(n) = 2*prime(n)+1.

Original entry on oeis.org

5, 7, 11, 15, 23, 27, 35, 39, 47, 59, 63, 75, 83, 87, 95, 107, 119, 123, 135, 143, 147, 159, 167, 179, 195, 203, 207, 215, 219, 227, 255, 263, 275, 279, 299, 303, 315, 327, 335, 347, 359, 363, 383, 387, 395, 399, 423, 447, 455, 459, 467, 479
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 11 2002

Keywords

Crossrefs

One less than A089241. After the initial term equal to A166496.
Row 4 of A286625, column 4 of A286623.

Programs

Formula

a(n) = A089241(n)-1.

A073051 Least k such that Sum_{i=1..k} (prime(i) + prime(i+2) - 2*prime(i+1)) = 2n + 1.

Original entry on oeis.org

1, 3, 8, 23, 33, 45, 29, 281, 98, 153, 188, 262, 366, 428, 589, 737, 216, 1182, 3301, 2190, 1878, 1830, 7969, 3076, 3426, 2224, 3792, 8027, 4611, 4521, 3643, 8687, 14861, 12541, 15782, 3384, 34201, 19025, 17005, 44772, 23282, 38589, 14356
Offset: 1

Views

Author

Robert G. Wilson v, Aug 15 2002

Keywords

Comments

Also, least k such that 2n = A001223(k-1) = prime(k+1) - prime(k), where prime(k) = A001223(n). - Alexander Adamchuk, Jul 30 2006
Also the least number k>0 such that the k-th maximal run of composite numbers has length 2n-1. For example, the 8th such run (24,25,26,27,28) is the first of length 2(3)-1, so a(3) = 8. Also positions of first appearances in A176246 (A046933 without first term). - Gus Wiseman, Jun 12 2024

Examples

			a(3) = 8 because 1+0+2-2+2-2+2+2 = 5 and (5+1)/2 = 3.
		

Crossrefs

Position of first appearance of 2n+1 in A176246.
For nonsquarefree runs we have a bisection of A373199.
A000040 lists the primes, first differences A001223.
A002808 lists the composite numbers, differences A073783, sums A053767.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    NextPrim[n_Integer] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = Table[0, {50}]; s = 0; k = 1; p = 0; q = 2; r = 3; While[k < 10^6, p = q; q = r; r = NextPrim[q]; s = s + p + r - 2q; If[s < 101 && a[[(s + 1)/2]] == 0, a[[(s + 1)/2]] = k]; k++ ]; a
  • PARI
    a001223(n) = prime(n+1) - prime(n);
    a(n) = {my(k = 1); while(2*n != A001223(k+1), k++); k;} \\ Michel Marcus, Nov 20 2016

Formula

a(n) = A038664(n) - 1. - Filip Zaludek, Nov 19 2016

A373673 First element of each maximal run of powers of primes (including 1).

Original entry on oeis.org

1, 7, 11, 13, 16, 19, 23, 25, 27, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 125, 127, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239
Offset: 1

Views

Author

Gus Wiseman, Jun 15 2024

Keywords

Comments

A run of a sequence (in this case A000961) is an interval of positions at which consecutive terms differ by one.
The last element of the same run is A373674.
Consists of all powers of primes k such that k-1 is not a power of primes.

Examples

			The maximal runs of powers of primes begin:
   1   2   3   4   5
   7   8   9
  11
  13
  16  17
  19
  23
  25
  27
  29
  31  32
  37
  41
  43
  47
  49
		

Crossrefs

For composite antiruns we have A005381, max A068780, length A373403.
For prime antiruns we have A006512, max A001359, length A027833.
For composite runs we have A008864, max A006093, length A176246.
For prime runs we have A025584, max A067774, length A251092 or A175632.
For runs of prime-powers:
- length A174965
- min A373673 (this sequence)
- max A373674
- sum A373675
For runs of non-prime-powers:
- length A110969 (firsts A373669, sorted A373670)
- min A373676
- max A373677
- sum A373678
For antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
- sum A373576
For antiruns of non-prime-powers:
- length A373672
- min A373575
- max A255346
- sum A373679
A000961 lists all powers of primes (A246655 if not including 1).
A025528 counts prime-powers up to n.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A361102 lists all non-prime-powers (A024619 if not including 1).

Programs

  • Mathematica
    pripow[n_]:=n==1||PrimePowerQ[n];
    Min/@Split[Select[Range[100],pripow],#1+1==#2&]//Most

A373677 Last element of each maximal run of non-prime-powers.

Original entry on oeis.org

1, 6, 10, 12, 15, 18, 22, 24, 26, 28, 30, 36, 40, 42, 46, 48, 52, 58, 60, 63, 66, 70, 72, 78, 80, 82, 88, 96, 100, 102, 106, 108, 112, 120, 124, 126, 130, 136, 138, 148, 150, 156, 162, 166, 168, 172, 178, 180, 190, 192, 196, 198, 210, 222, 226, 228, 232, 238
Offset: 1

Views

Author

Gus Wiseman, Jun 16 2024

Keywords

Comments

We consider 1 to be a power of a prime and a non-prime-power, but not a prime-power.
A run of a sequence (in this case A000961) is an interval of positions at which consecutive terms differ by one.
The first element of the same run is A373676.
Consists of all non-prime-powers k such that k+1 is a prime-power.

Examples

			The maximal runs of non-prime-powers begin:
   1
   6
  10
  12
  14  15
  18
  20  21  22
  24
  26
  28
  30
  33  34  35  36
  38  39  40
  42
  44  45  46
  48
  50  51  52
  54  55  56  57  58
  60
		

Crossrefs

See link for prime, composite, squarefree, and nonsquarefree runs/antiruns.
For runs of powers of primes:
- length A174965
- min A373673
- max A373674
- sum A373675
For runs of non-prime-powers:
- length A110969 (firsts A373669, sorted A373670)
- min A373676
- max A373677 (this sequence)
- sum A373678
For antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
- sum A373576
For antiruns of non-prime-powers:
- length A373672
- min A373575
- max A255346
- sum A373679
A000961 lists all powers of primes. A246655 is just prime-powers so lacks 1.
A025528 counts prime-powers up to n.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A361102 lists all non-prime-powers (A024619 if not including 1).

Programs

  • Mathematica
    Select[Range[100],!PrimePowerQ[#]&&PrimePowerQ[#+1]&]

A373674 Last element of each maximal run of powers of primes (including 1).

Original entry on oeis.org

5, 9, 11, 13, 17, 19, 23, 25, 27, 29, 32, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 125, 128, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239
Offset: 1

Views

Author

Gus Wiseman, Jun 16 2024

Keywords

Comments

A run of a sequence (in this case A000961) is an interval of positions at which consecutive terms differ by one.
The first element of the same run is A373673.
Consists of all powers of primes k such that k+1 is not a power of primes.

Examples

			The maximal runs of powers of primes begin:
   1   2   3   4   5
   7   8   9
  11
  13
  16  17
  19
  23
  25
  27
  29
  31  32
  37
  41
  43
  47
  49
		

Crossrefs

For prime antiruns we have A001359, min A006512, length A027833.
For composite runs we have A006093, min A008864, length A176246.
For prime runs we have A067774, min A025584, length A251092 or A175632.
For squarefree runs we have A373415, min A072284, length A120992.
For nonsquarefree runs we have min A053806, length A053797.
For runs of prime-powers:
- length A174965
- min A373673
- max A373674 (this sequence)
- sum A373675
For runs of non-prime-powers:
- length A110969 (firsts A373669, sorted A373670)
- min A373676
- max A373677
- sum A373678
For antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
- sum A373576
For antiruns of non-prime-powers:
- length A373672
- min A373575
- max A255346
- sum A373679
A000961 lists all powers of primes (A246655 if not including 1).
A025528 counts prime-powers up to n.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A361102 lists all non-prime-powers (A024619 if not including 1).

Programs

  • Mathematica
    pripow[n_]:=n==1||PrimePowerQ[n];
    Max/@Split[Select[Range[nn],pripow],#1+1==#2&]//Most

A066872 a(n) = prime(n)^2 + 1.

Original entry on oeis.org

5, 10, 26, 50, 122, 170, 290, 362, 530, 842, 962, 1370, 1682, 1850, 2210, 2810, 3482, 3722, 4490, 5042, 5330, 6242, 6890, 7922, 9410, 10202, 10610, 11450, 11882, 12770, 16130, 17162, 18770, 19322, 22202, 22802, 24650, 26570, 27890, 29930, 32042
Offset: 1

Views

Author

Joseph L. Pe, Jan 21 2002

Keywords

Comments

From R. J. Mathar, Aug 28 2011: (Start)
There are at least three "natural" embeddings of this function into multiplicative functions b(n), c(n) and d(n):
(i) The first is b(n) = 1, 5, 10, 0, 26, 0, 50, ... (n>=1) with b(p) = p^2+1, b(p^e)=0 if e>=2, substituting zero for all composite n.
(ii) The second is c(n) = 1, 5, 10, 9, 26, 50, 50, 17, 28, 130, ... (n>=1) with c(p^e)= p^(e+1)+1.
(iii) The third is d(n) = 1, 5, 10, 5, 26, 50, 50, 5, 10, 130, ... (n>=1) with d(p^e) = p^2+1 if e>=1. (End)
For n > 1, a(n)/2 is of the form 4*k+1. - Altug Alkan, Apr 08 2016

Crossrefs

Programs

Formula

a(n) = A002522(A000040(n)). - Altug Alkan, Apr 08 2016
a(n) = A000010(A000040(n)^2) + A323599(A000040(n)^2). - Torlach Rush, Jan 25 2019
Product_{n>=1} (1 - 1/a(n)) = Pi^2/15 (A182448). - Amiram Eldar, Nov 07 2022
From Antti Karttunen, Dec 24 2024: (Start)
a(n) = 1 + A001248(n).
a(n) = A000203(A000040(n)^3) / A000203(A000040(n)). (End)
Previous Showing 11-20 of 46 results. Next