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-3 of 3 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

A185934 Lesser of two consecutive primes which both equal 1 (mod 3).

Original entry on oeis.org

31, 61, 73, 151, 157, 199, 211, 271, 331, 367, 373, 433, 523, 541, 571, 601, 607, 619, 661, 727, 733, 751, 991, 997, 1033, 1063, 1069, 1117, 1123, 1201, 1231, 1237, 1291, 1321, 1381, 1453, 1459, 1531, 1543, 1621, 1657, 1669, 1741, 1747, 1753, 1759, 1777, 1789, 1861, 1987, 2011, 2131, 2161, 2179, 2281, 2287, 2341, 2371
Offset: 1

Views

Author

M. F. Hasler, Feb 06 2011

Keywords

Comments

Or, primes of the form 6k+1 such that the next prime is again of the form 6k'+1.

Examples

			The smallest prime of the form 6k+1 such that the next larger prime differs by a multiple of 3 (and thus a multiple of 6), is a(1) = 31, the following prime being 31+6 = 37.
Note that the next larger prime may also differ by 12 (as is the case for 199,211,619,661,997,1201,1237,1459,1531,1789,3049,...), or by 18 (as it is the case for 523,1069,1381,1759,2161,2503,3889,...), etc.
		

Crossrefs

Programs

  • Haskell
    a185934 n = a185934_list !! (n-1)
    a185934_list = map (a000040 . (+ 1)) $
       elemIndices 1 $ zipWith (*) a039701_list $ tail a039701_list
    -- Reinhard Zumkeller, Nov 16 2012
  • Mathematica
    With[{p = Prime[Range[350]]}, ind = Position[Mod[p, 3], 1] // Flatten; p[[ind[[Position[Differences[ind], 1] // Flatten]]]]] (* Amiram Eldar, Apr 12 2025 *)
  • PARI
    forprime( p=1,1e4, (o+0-o=p)%3==0 & o%3==1 & print1( precprime(p-1)","))
    

Formula

a(n) = A217659(n) - 6*A219244(n); A217659(n) = A151800(a(n)). - Reinhard Zumkeller, Nov 16 2012

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 *)
Showing 1-3 of 3 results.