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.

A039701 a(n) = n-th prime modulo 3.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

If n > 2 and prime(n) is a Mersenne prime then a(n) = 1. Proof: prime(n) = 2^p - 1 for some odd prime p, so prime(n) = 2*4^((p-1)/2) - 1 == 2 - 1 = 1 (mod 3). - Santi Spadaro, May 03 2002; corrected and simplified by Dean Hickerson, Apr 20 2003
Except for n = 2, a(n) is the smallest number k > 0 such that 3 divides prime(n)^k - 1. - T. D. Noe, Apr 17 2003
a(n) <> 0 for n <> 2; a(A049084(A003627(n))) = 2; a(A049084(A002476(n))) = 1; A134323(n) = (1 - 0^a(n)) * (-1)^(a(n)+1). - Reinhard Zumkeller, Oct 21 2007
Probability of finding 1 (or 2) in this sequence is 1/2. This follows from the Prime Number Theorem in arithmetic progressions. Examples: There are 4995 1's in terms (10^9 +1) to (10^9+10^4); there are 10^9/2-1926 1's in the first 10^9 terms. - Jerzy R Borysowicz, Mar 06 2022

Crossrefs

Cf. A091178 (indices of 1's), A091177 (indices of 2's).
Cf. A120326 (partial sums).
Cf. A010872.

Programs

Formula

Sum_k={1..n} a(k) ~ (3/2)*n. - Amiram Eldar, Dec 11 2024

A030459 Prime p concatenated with next prime is also prime.

Original entry on oeis.org

2, 31, 83, 151, 157, 167, 199, 233, 251, 257, 263, 271, 331, 353, 373, 433, 467, 509, 523, 541, 601, 653, 661, 677, 727, 941, 971, 1013, 1033, 1181, 1187, 1201, 1223, 1259, 1367, 1453, 1459, 1657, 1669, 1709, 1741, 1861, 1973, 2069, 2161
Offset: 1

Views

Author

Keywords

Comments

Terms 157, 257, 263, 541, 1187, 1459, 2179 also belong to A030460. - Carmine Suriano, Jan 27 2011
All terms, except for the first one, must be either in A185934 or in A185935, i.e., have the same residue (mod 6) as the subsequent prime. - M. F. Hasler, Feb 06 2011

Crossrefs

See A030461 for the concatenated primes.

Programs

  • Mathematica
    Select[Prime[Range[500]],PrimeQ[FromDigits[Join[IntegerDigits[#], IntegerDigits[ NextPrime[#]]]]]&] (* Harvey P. Dale, Jun 20 2011 *)
  • PARI
    o=2;forprime(p=3,1e4, isprime(eval(Str(o,o=p))) & print1(precprime(p-1)","))  \\ M. F. Hasler, Feb 06 2011

Formula

a(n) = A151799(A030460(n)).
A030461(n) = concat(a(n), A030460(n)) = A045533(A000720(a(n))).

A030461 Primes that are concatenations of two consecutive primes.

Original entry on oeis.org

23, 3137, 8389, 151157, 157163, 167173, 199211, 233239, 251257, 257263, 263269, 271277, 331337, 353359, 373379, 433439, 467479, 509521, 523541, 541547, 601607, 653659, 661673, 677683, 727733, 941947, 971977, 10131019
Offset: 1

Views

Author

Keywords

Comments

Any term in the sequence (apart from the first) must be a concatenation of consecutive primes differing by a multiple of 6. - Francis J. McDonnell, Jun 26 2005

Examples

			a(2) is 3137 because 31 and 37 are consecutive primes and after concatenation 3137 is also prime. - _Enoch Haga_, Sep 30 2007
		

Crossrefs

Cf. A030459.
Subsequence of A045533.

Programs

  • Haskell
    a030461 n = a030461_list !! (n-1)
    a030461_list = filter ((== 1) . a010051') a045533_list
    -- Reinhard Zumkeller, Apr 20 2012
    
  • Magma
    [Seqint( Intseq(NthPrime(n+1)) cat Intseq(NthPrime(n)) ): n in [1..200 ]| IsPrime(Seqint( Intseq(NthPrime(n+1)) cat Intseq(NthPrime(n)) )) ]; // Marius A. Burtea, Mar 21 2019
  • Maple
    conc:=proc(a,b) local bb: bb:=convert(b,base,10): 10^nops(bb)*a+b end: p:=proc(n) local w: w:=conc(ithprime(n),ithprime(n+1)): if isprime(w)=true then w else fi end: seq(p(n),n=1..250); # Emeric Deutsch
  • Mathematica
    Select[Table[p=Prime[n]; FromDigits[Join[Flatten[IntegerDigits[{p,NextPrime[p]}]]]],{n,170}],PrimeQ] (* Jayanta Basu, May 16 2013 *)
  • PARI
    {digits(n) = if(n==0,[0],u=[];while(n>0,d=divrem(n,10);n=d[1];u=concat(d[2],u));u)} {m=1185;p=2;while(pKlaus Brockhaus
    
  • PARI
    o=2;forprime(p=3,1e4, isprime(eval(Str(o,o=p))) & print1(precprime(p-1),p",")) \\ M. F. Hasler, Feb 06 2011
    

Formula

A030461(n) = concat(A030459(n),A030460(n)) = A045533( A000720( A030459(n))). - M. F. Hasler, Feb 06 2011

Extensions

Edited by N. J. A. Sloane, Apr 19 2009 at the suggestion of Zak Seidov

A217659 Larger of two consecutive primes which both equal 1 (mod 3).

Original entry on oeis.org

37, 67, 79, 157, 163, 211, 223, 277, 337, 373, 379, 439, 541, 547, 577, 607, 613, 631, 673, 733, 739, 757, 997, 1009, 1039, 1069, 1087, 1123, 1129, 1213, 1237, 1249, 1297, 1327, 1399, 1459, 1471, 1543, 1549, 1627, 1663, 1693, 1747, 1753, 1759, 1777, 1783
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 16 2012

Keywords

Crossrefs

Programs

  • Haskell
    a217659 = a151800 . fromInteger . a185934
  • Mathematica
    With[{p = Prime[Range[350]]}, ind = Position[Mod[p, 3], 1] // Flatten; p[[1 + ind[[Position[Differences[ind], 1] // Flatten]]]]] (* Amiram Eldar, Apr 12 2025 *)

Formula

a(n) = A151800(A185934(n)) = 6*A219244(n) + A185934(n).

A185936 First of a run of 3 or more consecutive primes which all equal 1 (mod 3).

Original entry on oeis.org

151, 199, 367, 523, 601, 727, 991, 1063, 1117, 1231, 1453, 1531, 1741, 1747, 1753, 1759, 2161, 2281, 2671, 3049, 3061, 3169, 3301, 3307, 3499, 3631, 3727, 4093, 4159, 4423, 4549, 4591, 4597, 4651, 4987, 5101, 5107, 5197, 5419, 5557, 5743, 5821, 6067, 6361, 6367, 6397, 6607, 6661, 7351, 7369, 7393, 7951, 8179, 8311
Offset: 1

Views

Author

M. F. Hasler, Feb 06 2011

Keywords

Crossrefs

A subsequence of A185934.

Programs

  • Mathematica
    Select[Partition[Prime[Range[1500]], 3, 1], Mod[#, 3] == {1, 1, 1} &][[All, 1]] (* Paolo Xausa, Mar 07 2025 *)
  • PARI
    s=Mod([1,1,1],3); o=vector(3); i=0; forprime( p=1,1e4, o[i++%3+1]=p; o-s || print1( o[(i+1)%3+1]","))

A219244 Differences of two consecutive primes which both equal 1 modulo 3, divided by 6.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 16 2012

Keywords

Comments

a(n) = (A217659(n) - A185934(n)) / 6.

Crossrefs

Programs

  • Haskell
    a219244 n = a219244_list !! (n-1)
    a219244_list = map (`div`  6) $ zipWith (-) a217659_list a185934_list
  • Mathematica
    (Last[#]-First[#])/6&/@Select[Partition[Prime[Range[800]],2,1], Mod[First[#],3] == Mod[Last[#],3]==1&] (* Harvey P. Dale, Feb 26 2013 *)

A185942 First of a run of 4 or more consecutive primes which all equal 1 (mod 3).

Original entry on oeis.org

1741, 1747, 1753, 3049, 3301, 4591, 5101, 6361, 7351, 7369, 8311, 8707, 8713, 8887, 9067, 9091, 9103, 9631, 10639, 11287, 12577, 12823, 12829, 13267, 15187, 15583, 15817, 15889, 15901, 16363, 16369, 16561, 16729, 16981, 17041, 17419, 17431, 17839, 18199, 18211, 19213, 19219, 19471, 19477, 19483, 19489, 20071
Offset: 1

Views

Author

M. F. Hasler, Feb 06 2011

Keywords

Comments

Subsequence of terms of A185936 such that A185936(k+1) = nextprime(A185936(k)).

Crossrefs

Programs

  • Mathematica
    mod3Q[l_]:=Union[Mod[#,3]&/@l]=={1}
    Transpose[Select[Partition[Prime[Range[2500]],4,1],mod3Q]][[1]]  (* Harvey P. Dale, Feb 16 2011 *)
  • PARI
    s=Mod([1,1,1,1],3);o=vector(#s);i=0;forprime(p=1,3e4,o[i++%#o+1]=p;o-s|print1(o[(i+1)%#o+1]","))
Showing 1-7 of 7 results.