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

A092663 Number of consecutive prime runs of 10 primes congruent to 1 mod 4 below 10^n.

Original entry on oeis.org

0, 0, 0, 0, 0, 5, 19, 323, 3653, 37544, 381413, 3799344, 37591054
Offset: 1

Views

Author

Enoch Haga, Mar 02 2004

Keywords

Examples

			a(6)=5 because 5 sets of 10 primes occur below 10^6, each run interrupted by a prime congruent to 3 mod 4. These runs start at prime(31798)=373649, prime(41181)=495377, at prime(42241)=509389, at prime(50017)=612109, *not* at prime(61457) which has a larger run length, and at prime(63146)=789097.
		

Crossrefs

Formula

Generate the prime sequence with primes labeled 1 mod 4 or 3 mod 4. Add count of primes to sequence if just 10 primes occur before interruption by a prime congruent to 3 mod 4

Extensions

a(9) and a(10) from Sean A. Irvine, Oct 06 2011
a(11) from Chai Wah Wu, Mar 18 2018
a(12) and a(13) from Lucas A. Brown, Oct 15 2024

A103271 a(n) = (prime(n)+prime(n+1)) mod 4.

Original entry on oeis.org

1, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 2, 2, 0, 2, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Yasutoshi Kohmoto, Jan 27 2005

Keywords

Comments

The number of 2's among the first N terms are: count(10^3) = 381, count (10^4) = 4137, count(10^5) = 42638, count(10^6) = 437423, count(10^7) = 4448503. - M. F. Hasler, Apr 27 2016
In terms of vectors a = (p(n),p(n+1)) mod 4, as considered in the preprint arxiv:1603.03720, the 2's group together the cases a = (1,1) and (3,3) and 0's cumulate cases (1,3) and (3,1). Assuming that the two subcases of each case have roughly the same probabilities, the above counts (i.e., percentage of 44.5% : 55.5% at 10^7) are compatible with the data in the 2nd table on bottom of p.14 where respective percentages vary from 44.8% : 55.1% (at 10^10) to 46% : 54% (at 10^12). I found that at p(n) ~ 10^80, the percentages become closer than 49% : 51%. - M. F. Hasler, May 12 2016

Crossrefs

Programs

  • Maple
    seq(ithprime(n)+ithprime(n+1) mod 4, n=1..150); # Emeric Deutsch, May 31 2005
  • Mathematica
    Table[Mod[Prime@ n + Prime[n + 1], 4], {n, 120}] (* Michael De Vlieger, Apr 27 2016 *)
    Mod[Total[#],4]&/@Partition[Prime[Range[120]],2,1] (* Harvey P. Dale, Mar 16 2025 *)
  • PARI
    a(n) = (prime(n) + prime(n+1)) % 4; \\ Michel Marcus, Apr 14 2016

Formula

a(n) = A001043(n) mod 4. - Michel Marcus, Apr 14 2016

Extensions

More terms from Emeric Deutsch, May 31 2005
Prepended a(1) = 1, Joerg Arndt, Apr 14 2016

A271974 Let p = prime(n): if p mod 4 == 1 then a(n) = (1+p)/2 otherwise if p mod 4 == 3 then a(n) = (1-p)/2.

Original entry on oeis.org

-1, 3, -3, -5, 7, 9, -9, -11, 15, -15, 19, 21, -21, -23, 27, -29, 31, -33, -35, 37, -39, -41, 45, 49, 51, -51, -53, 55, 57, -63, -65, 69, -69, 75, -75, 79, -81, -83, 87, -89, 91, -95, 97, 99, -99, -105, -111, -113, 115, 117, -119, 121, -125, 129, -131, 135, -135, 139, 141, -141, 147, -153, -155, 157, 159, -165, 169, -173, 175, 177, -179, -183, 187, -189, -191, 195, 199, 201, 205
Offset: 2

Views

Author

Dimitris Valianatos, Apr 23 2016

Keywords

Examples

			For n=11, prime(11) = 31, 31 mod 4 == 3 so a(11) = (1-31)/2 = -15.
		

Crossrefs

Programs

  • Mathematica
    If[Mod[#,4]==1,(1+#)/2,(1-#)/2]&/@Prime[Range[2,80]] (* Harvey P. Dale, May 09 2017 *)
  • PARI
    {forstep(n=3,1000,2,if(isprime(n),if(n%4==1,p=(1+n)/2,p=(1-n)/2);print1(n"-> "p", ")));}

Formula

Product_{n>2} (1-1/a(n)) = (1-1/3)*(1-1/(-3))*(1-1/(-5))*(1-1/7)*(1-1/9)*(1-1/(-9))*(1-1/(-11))*(1-1/15)*(1-1/(-15))*... = (2/3)*(4/3)*(6/5)*(6/7)*(8/9)*(10/9)*(12/11)*(14/15)*(16/15)*... = 1.
So Product_{n>2} (1-a(n)^(-1)) = Product_{n>2}(1-a(n)^(-1))^(-1) = (Product_{n>2}(1-a(n)^(-1)))^k = 1, for every k.
Sum_ {n>2} log(1-1/a(n)) = 0.

Extensions

Corrected and extended by Harvey P. Dale, May 09 2017

A180217 a(n) = (n-th prime modulo 3) + (n-th prime modulo 4).

Original entry on oeis.org

4, 3, 3, 4, 5, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 5, 2, 4, 5, 2, 4, 5, 3, 2, 3, 4, 5, 2, 3, 4, 5, 3, 4, 3, 4, 2, 4, 5, 3, 5, 2, 5, 2, 3, 4, 4, 4, 5, 2, 3, 5, 2, 5, 3, 5, 3, 4, 2, 3, 4, 3, 4, 5, 2, 3, 4, 2, 5, 2, 3, 5, 4, 2, 4, 5, 3, 2, 3, 2, 5, 2, 5, 2, 4, 5, 3, 2, 3, 4, 5, 5, 4, 5, 4, 5, 3, 3, 4, 2, 4, 3
Offset: 1

Views

Author

Zak Seidov, Jan 16 2011

Keywords

Comments

a(n) = 2 iff prime(n) == 1 (mod 12); a(n) = 2 for prime(n) = 13, 37, 61, 73, 97, 109, ... (A068228).
a(n) = 5 iff prime(n) == 11 (mod 12); a(n) = 5 for prime(n) = 11, 23, 47, 59, 71, 83, ... (A068231).
For n > 2, a(n) = 3 iff prime(n) == 5 (mod 12); a(n) = 3 for prime(n) = 5, 17, 29, 41, 53, 89, ... (A040117).
For n > 2, a(n) = 4 iff prime(n) == 7 (mod 12); a(n) = 4 for prime(n) = 7, 19, 31, 43, 67, 79, ... (A068229).

Crossrefs

Programs

  • Magma
    A180217:=func< n | p mod 3 + p mod 4 where p is NthPrime(n) >; [ A180217(n): n in [1..105] ]; // Klaus Brockhaus, Jan 18 2011
  • Mathematica
    Mod[#,3]+Mod[#,4]&/@Prime[Range[110]] (* Harvey P. Dale, Nov 09 2011 *)

A267573 a(n) = prime(n) + (prime(n) mod 4).

Original entry on oeis.org

4, 6, 6, 10, 14, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 62, 62, 70, 74, 74, 82, 86, 90, 98, 102, 106, 110, 110, 114, 130, 134, 138, 142, 150, 154, 158, 166, 170, 174, 182, 182, 194, 194, 198, 202, 214, 226, 230, 230, 234, 242, 242, 254, 258, 266, 270
Offset: 1

Views

Author

Emre APARI, Jan 17 2016

Keywords

Comments

The primes corresponding to the cases where a(n) = a(n+1) can be found in A071698. - Michel Marcus, Jan 17 2016

Examples

			p=19; 19 + (19 modulo 4) = 22.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n)+(NthPrime(n) mod 4): n in [1..100]]; // Vincenzo Librandi, Jan 17 2016
    
  • Maple
    A267573:=n->ithprime(n)+(ithprime(n) mod 4): seq(A267573(n), n=1..100); # Wesley Ivan Hurt, Jan 17 2016
  • Mathematica
    Table[Prime[n] + Mod[Prime[n], 4], {n, 60}] (* Vincenzo Librandi, Jan 17 2016 *)
    #+Mod[#,4]&/@Prime[Range[60]] (* Harvey P. Dale, Jun 12 2020 *)
  • PARI
    a(n) = prime(n) + (prime(n) % 4); \\ Michel Marcus, Jan 17 2016
    
  • PARI
    lista(nn) = forprime(p=2, nn, print1(p + p % 4, ", ")); \\ Altug Alkan, Jan 17 2016

Formula

a(n) = A000040(n) + A039702(n).
a(n) = A083220(prime(n)). - Michel Marcus, Jan 17 2016

Extensions

More terms from Vincenzo Librandi, Jan 17 2016

A077008 Legendre symbol (-1,p) where p is the n-th prime.

Original entry on oeis.org

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

Views

Author

Joseph L. Pe, Nov 28 2002

Keywords

Comments

Same as A070750 (where additionally a(1)=0 is included). - Joerg Arndt, Apr 21 2016

Crossrefs

Programs

  • Mathematica
    p = Table[Prime[i], {i, 2, 101}]; Table[JacobiSymbol[p[[j]] - 1, p[[j]]], {j, 1, 100}]
    a[n_] := (-1)^((Prime[n]-1)/2); Table[a[n], {n, 2, 101}] (* Jean-François Alcover, Apr 20 2016 *)
  • PARI
    a(n)=kronecker(-1,prime(n)) \\ Charles R Greathouse IV, Jun 13 2013
    
  • PARI
    a(n)=if(prime(n)%4==1,1,-1) \\ Charles R Greathouse IV, Jun 13 2013

Formula

a(n) = A070750(n). - Joerg Arndt, Apr 21 2016

Extensions

Replaced "(p-1,p)" by "(-1,p)" in name, Joerg Arndt, Apr 21 2016

A202025 Position of second appearance of set of first n terms in the sequence of odd primes modulo 4.

Original entry on oeis.org

3, 4, 8, 16, 16, 19, 60, 221, 654, 654, 654, 654, 654, 30291, 30291, 30291, 30291, 250231, 342916, 342916, 472727, 1934365, 1934365, 11877702, 11877702, 11877702
Offset: 1

Views

Author

Zak Seidov, Dec 09 2011

Keywords

Comments

Next term, a(27) > 3*10^7.

Examples

			Consider the sequence of odd primes modulo 4: S= 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 3, 1,... . Then
a(1)=3 because 2nd appearance of 3 is S(3),
a(2)=4 because 2nd appearance of (3,1) begins at S(4),
a(3)=8 because 2nd appearance of (3,1,3) begins at S(8),
a(4)=16 because 2nd appearance of (3,1,3,3) begins at S(16).
		

Crossrefs

Cf. A039702.

Programs

  • Mathematica
    nn=3*10^7; s=Table[Mod[Prime[n],4], {n,2,nn}]; Reap[k1=2; Do[tn=Take[s,n]; Do[If[tn==Take[s,{k,k+n-1}], Sow[k]; k1=k; Break[]], {k,k1,nn-n-1}], {n,26}]][[2,1]]
Previous Showing 21-27 of 27 results.