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

A175632 Maximal run length of primes of the form A025584(n), A025584(n)+2, A025584(n)+4, ...

Original entry on oeis.org

1, 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, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Vladislav-Stepan Malakovsky & Juri-Stepan Gerasimov, Jul 31 2010

Keywords

Examples

			a(1)=1 because A025584(1)=2=prime; a(2)=3 because A025584(2)=3=prime, A025584(2)+2=5=prime, A025584(2)+4=7=prime; a(3)=2 because A025584(3)=11=prime, A025584(3)+2=13=prime; a(4)=2 because A025584(4)=17=prime, A025584(4)+2=19=prime.
		

A207820 Let A = A025584. a(n) is the smallest A(m) such that the interval (A(m)*n, A(m+1)*n) contains no primes from A.

Original entry on oeis.org

2, 2, 2, 1783, 967, 1663, 3187, 4813, 13873, 20347, 1783, 2617, 27743, 14533, 54829, 71143, 66169, 46687, 44119, 57787, 79609, 552883, 21397, 297079, 1187107, 89017, 798697, 285763, 761377, 2660587, 812047, 1463257, 2795059, 2816239, 2676727, 3069607, 2500297
Offset: 1

Views

Author

Keywords

Comments

Conjecture. For n>=3, every a(n) is the lesser of a pair of cousin primes p and p+4, cf. A023200.
The limit of a(n) as n goes to infinity is infinity.

Crossrefs

Programs

  • Mathematica
    Table[aPrime[[NestWhile[#1+1&,1,!(nextAPrime[n aPrime[[#1]]]>n aPrime[[#1+1]])&]]],{n,2,20}]
  • PARI
    is_a025584(x) = isprime(x) && !isprime(x-2)
    a025584_next(n) = {local(p); p=n+1; while(!is_a025584(p), p=p+1); p}
    no_a025584(a,b) = {local(x,r); r=1; for(x=a+1, b-1, if(is_a025584(x), r=0)); r}
    a207820(n) = {local(r,rp); rp=2; r=3; while(!no_a025584(n*rp, n*r), rp=r; r=a025584_next(r)); rp} \\ Michael B. Porter, Jan 20 2013

Extensions

a(21)-a(37) from Michael B. Porter, Jan 20 2013

A006512 Greater of twin primes.

Original entry on oeis.org

5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883, 1021, 1033, 1051, 1063, 1093, 1153, 1231, 1279, 1291, 1303, 1321, 1429, 1453, 1483, 1489, 1609
Offset: 1

Views

Author

Keywords

Comments

Also primes that are the sum of two primes (which is possible only if 2 is one of the primes). - Cino Hilliard, Jul 02 2004, edited by M. F. Hasler, Nov 14 2019
The set of greater of twin primes larger than five is a proper subset of the set of primes of the form 3n + 1 (A002476). - Paul Muljadi, Jun 05 2008
Smallest prime > n-th isolated composite. - Juri-Stepan Gerasimov, Nov 07 2009
Subsequence of A175075. Union of a(n) and sequence A175080 is A175075. - Jaroslav Krizek, Jan 30 2010
A164292(a(n))=1; A010051(a(n)+2)=0 for n > 1. - Reinhard Zumkeller, Mar 29 2010
Omega(n) = Omega(n-2); d(n) = d(n-2). - Juri-Stepan Gerasimov, Sep 19 2010
Aside from the first term, all subsequent terms have digital root 1, 4, or 7. - J. W. Helkenberg, Jul 24 2013
Also primes p with property that the sum of the successive gaps between primes <= p is a prime number. - Robert G. Wilson v, Dec 19 2014
The phrase "x is an element of the {primes, positive integers} and there {exist no, exist} elements a,b of {1 and primes, primes}: a+b=x" determines A133410, A067829, A025584, A006512, A166081, A014092, A014091 and A038609 for the first few hundred terms with only de-duplication or omitting/including 3, 4 and 6 in the case of A166081/A014091 and one case of omitting/including 3 given 1 isn't prime. - Harry G. Coin, Nov 25 2015
The yet unproved Twin Prime Conjecture states that this sequence is infinite. - M. F. Hasler, Nov 14 2019

References

  • See A001359 for further references and links.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A139690.
Bisection of A077800.

Programs

  • Haskell
    a006512 = (+ 2) . a001359 -- Reinhard Zumkeller, Feb 10 2015
    
  • Magma
    [n: n in PrimesUpTo(1610)|IsPrime(n-2)]; // Bruno Berselli, Feb 28 2011
    
  • Maple
    for i from 1 to 253 do if ithprime(i+1) = ithprime(i) + 2 then print({ithprime(i+1)}); fi; od; # Zerinvary Lajos, Mar 19 2007
    P := select(isprime,[$1..1609]): select(p->member(p-2,P),P); # Peter Luschny, Mar 03 2011
    A006512 := proc(n)
        2+A001359(n) ;
    end proc: # R. J. Mathar, Nov 26 2014
  • Mathematica
    Select[Prime[Range[254]], PrimeQ[# - 2] &] (* Robert G. Wilson v, Jun 09 2005 *)
    Transpose[Select[Partition[Prime[Range[300]], 2, 1], Last[#] - First[#] == 2 &]][[2]] (* Harvey P. Dale, Nov 02 2011 *)
    Cases[Prime[Range[500]] + 2, ?PrimeQ] (* _Fred Patrick Doty, Aug 23 2017 *)
  • PARI
    select(p->isprime(p-2),primes(1000))
    
  • PARI
    a(n)=p=3; while(p+2 < (p=nextprime(p+1)) || n-->0, ); p
    vector(100, n, a(n)) \\ Altug Alkan, Dec 04 2015
    
  • Python
    from sympy import primerange, isprime
    print([n for n in primerange(1, 2001) if isprime(n - 2)]) # Indranil Ghosh, Jul 20 2017

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

A061358 Number of ways of writing n = p+q with p, q primes and p >= q.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Apr 28 2001

Keywords

Comments

For an odd number n, a(n) = 0 if n-2 is not a prime, otherwise a(n) = 1.
For n > 1, a(2n) is at least 1, according to Goldbach's conjecture.
a(A014092(n)) = 0; a(A014091(n)) > 0; a(A067187(n)) = 1. - Reinhard Zumkeller, Nov 22 2004
Number of partitions of n into two primes.
Number of unordered ways of writing n as the sum of two primes.
a(2*n) = A068307(2*n+2). - Reinhard Zumkeller, Aug 08 2009
4*a(n) is the total number of divisors of all primes p and q such that n = p+q and p >= q. - Wesley Ivan Hurt, Mar 05 2016
Indices where a(n) = 0 correspond to A164376 UNION A025584. - Bill McEachen, Jan 31 2024

Examples

			a(22) = 3 because 22 can be written as 3+19, 5+17 and 11+11.
		

Crossrefs

Programs

  • Magma
    [#RestrictedPartitions(n,2,{p:p in PrimesUpTo(1000)}):n in [0..100] ] // Marius A. Burtea, Jan 19 2019
  • Maple
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j),j=1..30): gser:=series(g,x=0,110): seq(coeff(gser,x,n),n=0..105); # Emeric Deutsch, Apr 03 2006
  • Mathematica
    a[n_] := Length[Select[n - Prime[Range[PrimePi[n/2]]], PrimeQ]]; Table[a[n], {n, 0, 100}] (* Paul Abbott, Jan 11 2005 *)
    With[{nn=110},CoefficientList[Series[Sum[x^(Prime[i]+Prime[j]),{j,nn},{i,j}],{x,0,nn}],x]] (* Harvey P. Dale, Aug 17 2017 *)
    Table[Count[IntegerPartitions[n,{2}],?(AllTrue[#,PrimeQ]&)],{n,0,110}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale, Jul 03 2021 *)
  • PARI
    a(n)=my(s);forprime(q=2,n\2,s+=isprime(n-q));s \\ Charles R Greathouse IV, Mar 21 2013
    
  • Python
    from sympy import primerange, isprime, floor
    def a(n):
        s=0
        for q in primerange(2, n//2 + 1): s+=isprime(n - q)
        return s
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 30 2017
    

Formula

G.f.: Sum_{j>0} Sum_{i=1..j} x^(p(i)+p(j)), where p(k) is the k-th prime. - Emeric Deutsch, Apr 03 2006
A065577(n) = a(10^n).
From Wesley Ivan Hurt, Jan 04 2013: (Start)
a(n) = Sum_{i=1..floor(n/2)} A010051(i) * A010051(n-i).
a(n) = Sum_{i=1..floor(n/2)} floor((A010051(i) + A010051(n-i))/2). (End)
a(n) + A062610(n) + A062602(n) = A004526(n). - R. J. Mathar, Sep 10 2021
a(n) = Sum_{k=floor((n-1)^2/4)+1..floor(n^2/4)} c(A339399(2k-1)) * c(A339399(2k)), where c = A010051. - Wesley Ivan Hurt, Jan 19 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001
Comments edited by Zak Seidov, May 28 2014

A067774 Primes p such that p+2 is not a prime.

Original entry on oeis.org

2, 7, 13, 19, 23, 31, 37, 43, 47, 53, 61, 67, 73, 79, 83, 89, 97, 103, 109, 113, 127, 131, 139, 151, 157, 163, 167, 173, 181, 193, 199, 211, 223, 229, 233, 241, 251, 257, 263, 271, 277, 283, 293, 307, 313, 317, 331, 337, 349, 353, 359, 367, 373, 379, 383, 389
Offset: 1

Views

Author

Benoit Cloitre, Feb 06 2002

Keywords

Comments

Primes n such that n!*B(n+1) is an integer where B(k) are the Bernoulli numbers.
All primes except for the lower members of twin primes - i.e. remove 3, 5, 11, 17, 29, 41, 59, 71, 101, 107, 137, ... - Gerard Schildberger, Feb 13 2005

Crossrefs

Cf. A049591.
Complement of A001359 in A000040, A025584, A007510.

Programs

Formula

Except for a(1)=2, a(n+1)=A049591(n).
a(n) ~ n log n. - Charles R Greathouse IV, Jul 01 2013

Extensions

Better description from Vladeta Jovovic, Dec 14 2002

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

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

A373821 Run-lengths of run-lengths of first differences of odd primes.

Original entry on oeis.org

1, 11, 1, 19, 1, 1, 1, 5, 1, 6, 1, 16, 1, 27, 1, 3, 1, 1, 1, 6, 1, 9, 1, 29, 1, 2, 1, 18, 1, 1, 1, 5, 1, 3, 1, 17, 1, 19, 1, 30, 1, 17, 1, 46, 1, 17, 1, 27, 1, 30, 1, 5, 1, 36, 1, 41, 1, 10, 1, 31, 1, 44, 1, 4, 1, 14, 1, 6, 1, 2, 1, 32, 1, 13, 1, 17, 1, 5
Offset: 1

Views

Author

Gus Wiseman, Jun 22 2024

Keywords

Comments

Run-lengths of A333254.
The first term other than 1 at an odd positions is at a(101) = 2.
Also run-lengths (differing by 0) of run-lengths (differing by 0) of run-lengths (differing by 1) of composite numbers.

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 run-lengths:
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, ...
with run-lengths a(n).
		

Crossrefs

Run-lengths of run-lengths of A046933(n) = A001223(n) - 1.
Run-lengths of A333254.
A000040 lists the primes.
A001223 gives differences of consecutive primes.
A027833 gives antirun lengths of odd primes (partial sums A029707).
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
A373820 gives run-lengths of antirun-lengths of odd primes.
For prime runs: A001359, A006512, A025584, A067774, A373406.
For composite runs: A005381, A008864, A054265, A176246, A251092, A373403.

Programs

  • Mathematica
    Length/@Split[Length /@ Split[Differences[Select[Range[3,1000],PrimeQ]]]//Most]//Most

A373406 Sum of the n-th maximal run of odd primes differing by two.

Original entry on oeis.org

15, 24, 36, 23, 60, 37, 84, 47, 53, 120, 67, 144, 79, 83, 89, 97, 204, 216, 113, 127, 131, 276, 300, 157, 163, 167, 173, 360, 384, 396, 211, 223, 456, 233, 480, 251, 257, 263, 540, 277, 564, 293, 307, 624, 317, 331, 337, 696, 353, 359, 367, 373, 379, 383
Offset: 1

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

The length of this run is given by A251092.
For this sequence we define a run to be an interval of positions at which consecutive terms differ by two. Normally, a run has consecutive terms differing by one, but odd prime numbers already differ by at least two.
Contains A054735 (sums of twin prime pairs) without its first two terms and A007510 (non-twin primes) as subsequences. - R. J. Mathar, Jun 07 2024

Examples

			Row-sums of:
   3   5   7
  11  13
  17  19
  23
  29  31
  37
  41  43
  47
  53
  59  61
  67
  71  73
  79
  83
  89
  97
		

Crossrefs

The partial sums are a subset of A071148 (partial sums of odd primes).
Functional neighbors: A025584, A054265, A067774, A251092 (or A175632), A373405, A373413, A373414.
A000040 lists the primes, differences A001223.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    Total/@Split[Select[Range[3,100],PrimeQ],#1+2==#2&]//Most
Showing 1-10 of 34 results. Next