A061357
Number of 0
0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 3, 2, 3, 4, 1, 3, 4, 3, 3, 5, 4, 3, 5, 3, 3, 6, 2, 5, 6, 2, 5, 6, 4, 5, 7, 4, 4, 8, 4, 4, 9, 4, 4, 7, 3, 6, 8, 5, 5, 8, 6, 7, 10, 6, 5, 12, 3, 5, 10, 3, 7, 9, 5, 5, 8, 7, 7, 11, 5, 5, 12, 4, 8, 11, 4, 8, 10, 5, 5, 13, 9, 6, 11, 7, 6, 14, 6, 8, 13, 5, 8, 11, 6, 9
Offset: 1
A126204 Least prime representable as the arithmetic mean of two other primes in n different ways.
2, 5, 11, 17, 37, 53, 89, 71, 101, 179, 137, 193, 233, 257, 251, 401, 311, 373, 347, 457, 661, 479, 547, 599, 617, 641, 683, 907, 881, 773, 827, 809, 941, 1033, 977, 1289, 1201, 1187, 1229, 1223, 1277, 1361, 1597, 1493, 1447, 1499, 1451, 1549, 1487, 1709, 1933
Offset: 0
Keywords
Comments
Links
- Robert G. Wilson v, Table of n, a(n) for n = 0..11300
Crossrefs
Cf. A071681.
Programs
-
Mathematica
f[n_] := Block[{c = 0, k = PrimePi@n - 1}, While[k > 0, If[ PrimeQ[2n - Prime@k], c++ ]; k-- ]; c]; t = Table[0, {1000}]; Do[ p = Prime@n; a = f@p; If[a < 1001 && t[[a]] == 0, t[[a]] = p; Print[{a, p}]], {n, 8900}]
Extensions
Start of b-file modified to match sequence by N. J. A. Sloane, Aug 31 2009
A071680 Primes that are the arithmetic mean of their prime predecessor and another prime.
5, 37, 53, 67, 157, 173, 211, 257, 263, 277, 373, 479, 563, 593, 607, 613, 631, 653, 733, 809, 947, 977, 1009, 1103, 1123, 1187, 1223, 1297, 1367, 1471, 1511, 1607, 1663, 1721, 1747, 1753, 1783, 1867, 1901, 1907, 1931, 1993, 2137, 2287, 2377, 2411, 2417
Offset: 1
Keywords
Comments
prime(n) where 2*prime(n) - prime(n-1) is prime. - Robert Israel, Dec 01 2015
Examples
A000040(12) = 37, A000040(12-1) = 31, 37 = (31 + 43)/2, therefore 37 is a term.
Links
- Robert Israel, Table of n, a(n) for n = 1..11000
Programs
-
Maple
Primes:= select(isprime, [2,seq(i,i=1..10^4,2)]): Primes[select(i -> isprime(2*Primes[i]-Primes[i-1]), [$2..nops(Primes)])]; # Robert Israel, Dec 01 2015
-
Mathematica
p = q = 2; lst = {}; Do[q = Prime@n; If[PrimeQ[2q - p], AppendTo[lst, q]]; p = q, {n, 2, 400}]; lst (* Robert G. Wilson v, Mar 22 2007 *)
-
PARI
lista(nn) = {forprime(p=5, nn, if (isprime(2*p-precprime(p-1)), print1(p, ", ")););} \\ Michel Marcus, Dec 01 2015
Extensions
Thanks to Sven Simon for noticing errors in the original version.
A078497 The member r of a triple of primes (p,q,r) in arithmetic progression which sum to 3*prime(n) = A001748(n) = p + q + r.
7, 11, 17, 19, 23, 31, 29, 41, 43, 43, 53, 67, 53, 59, 71, 79, 73, 83, 79, 97, 107, 107, 127, 113, 109, 113, 139, 137, 151, 149, 167, 151, 167, 163, 163, 199, 197, 179, 191, 199, 233, 223, 227, 241, 223, 283, 257, 277, 239, 251, 271, 263, 263, 269, 281, 313
Offset: 3
Keywords
Comments
In case more than one triple of primes p, q=p+d and r=p+2*d exists, we take r=a(n) from the triple with the smallest d. This shows the difference from A092940, which would take the maximum r over all triples. - R. J. Mathar, May 19 2007
Examples
a(1) = 7 because 3+5+7 = 15; a(2) = 11 because 3+7+11 = 21; a(3) = 17 because 5+11+17= 33.
Programs
-
Maple
A078497 := proc(n) local p3, i,d,r,p; p3 := ithprime(n) ; i := n+1 ; while true do r := ithprime(i) ; d := r-p3 ; p := p3-d ; if isprime(p) then RETURN(r) ; fi ; i := i+1 ; od ; RETURN(-1) ; end: for n from 3 to 60 do printf("%d, ",A078497(n)) ; od ; # R. J. Mathar, May 19 2007
-
Mathematica
f[n_] := Block[{p = Prime[n], k}, k = p + 1; While[ !PrimeQ[k] || !PrimeQ[2p - k], k++ ]; k]; Table[ f[n], {n, 3, 60}]
Extensions
Edited and extended by Robert G. Wilson v, Nov 29 2002
Further edited by N. J. A. Sloane, Jul 03 2008 at the suggestion of R. J. Mathar
A116619 a(n) = number of ways of representing 2*prime(n) as the unordered sum of two primes.
1, 1, 2, 2, 3, 3, 4, 2, 4, 4, 3, 5, 5, 5, 5, 6, 6, 4, 6, 8, 6, 5, 6, 7, 7, 9, 7, 8, 7, 7, 9, 9, 11, 7, 11, 9, 9, 7, 11, 9, 10, 8, 10, 12, 11, 7, 11, 12, 12, 9, 13, 11, 11, 15, 14, 15, 14, 10, 11, 14, 13, 13, 15, 17, 12, 14, 14, 15, 19, 14, 19, 15, 15, 18, 15, 17, 15, 17, 16, 17, 17, 18, 17
Offset: 1
Comments
2*prime(n) = A100484(n), the n-th even semiprime.
a(n) = A071681(n) + 1. - Reinhard Zumkeller, Mar 27 2015
Examples
2*prime(23) = 166 can be represented in 6 ways as the unordered sum of two primes: 166 = 3+163 = 17+149 = 29+137 = 53+113 = 59+107 = 83+83, so a(23) = 6. 2*prime(54) = 502 can be represented in 15 ways as the unordered sum of two primes: 502 = 3+499 = 11+491 = 23+479 = 41+461 = 53+449 = 59+443 = 71+431 = 83+419 = 101+401 = 113+389 = 149+353 = 191+311 = 233+269 = 239+263 = 251+251, so a(54) = 15.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a116619 = (+ 1) . a071681 -- Reinhard Zumkeller, Mar 27 2015
-
PARI
{for(n=1,83,c=0;k=2*prime(n);forprime(p=2,prime(n),if(isprime(k-p),c++));print1(c,","))} \\ Klaus Brockhaus, Dec 23 2006
Extensions
Edited, corrected and extended by Klaus Brockhaus, Dec 23 2006
A071704 Number of ways to represent the n-th prime as arithmetic mean of three other odd primes.
0, 0, 0, 2, 5, 7, 10, 14, 16, 24, 29, 31, 42, 40, 43, 52, 62, 70, 75, 87, 82, 96, 102, 112, 127, 137, 136, 142, 154, 154, 186, 199, 204, 215, 233, 248, 250, 262, 272, 284, 309, 324, 344, 334, 348, 358, 406, 414, 430, 446, 441, 489, 486, 511, 508
Offset: 1
Keywords
Examples
a(5)=5 as A000040(5)=11 and there are no more representations not containing 11 than 11 = (3+7+23)/3 = (3+13+17)/3 = (5+5+23)/3 = (7+7+19)/3 = (7+13+13)/3.
Links
- Robert Israel, Table of n, a(n) for n = 1..2000
Programs
-
Haskell
a071704 n = z (us ++ vs) 0 (3 * q) where z _ 3 m = fromEnum (m == 0) z ps'@(p:ps) i m = if m < p then 0 else z ps' (i+1) (m - p) + z ps i m (us, _:vs) = span (< q) a065091_list; q = a000040 n -- Reinhard Zumkeller, May 24 2015
-
Maple
N:= 300: # to get the first A000720(N) terms P:= select(isprime, [seq(i,i=3..3*N,2)]): nP:= nops(P): V:= Vector(N): for i from 1 to nP do for j from i to nP do for k from j to nP while P[i]+P[j]+P[k] <= 3*N do r:= (P[i]+P[j]+P[k])/3; if r::integer and isprime(r) and r <> P[j] and r <= N then V[r]:= V[r]+1 fi od od od: seq(V[ithprime(i)],i=1..numtheory:-pi(N)); # Robert Israel, Aug 09 2018
-
Mathematica
M = 300; (* to get the first A000720(M) *) P = Select[Range[3, 3*M, 2], PrimeQ]; nP = Length[P]; V = Table[0, {M}]; For[i = 1, i <= nP, i++, For[j = i, j <= nP, j++, For[k = j, k <= nP && P[[i]] + P[[j]] + P[[k]] <= 3*M , k++, r = (P[[i]] + P[[j]] + P[[k]])/3; If[IntegerQ[r] && PrimeQ[r] && r != P[[j]] && r <= M, V[[r]] = V[[r]]+1] ]]]; Table[V[[Prime[i]]], {i, 1, PrimePi[M]}] (* Jean-François Alcover, Mar 09 2019, after Robert Israel *)
-
PARI
a(n, p=prime(n))=my(s=0); forprime(q=p+2, 3*p-4, my(t=3*p-q); forprime(r=max(t-q, 3), (3*p-q)\2, if(t!=p+r && isprime(t-r), s++))); s \\ Charles R Greathouse IV, Jun 04 2015
Extensions
Definition corrected by Zak Seidov, May 24 2015
A071703 Number of ways to represent the n-th prime as arithmetic mean of three odd primes.
0, 1, 2, 4, 8, 10, 14, 16, 20, 28, 32, 36, 47, 45, 48, 58, 68, 74, 81, 95, 88, 101, 108, 119, 134, 146, 143, 150, 161, 161, 195, 208, 215, 222, 244, 257, 259, 269, 283, 293, 319, 332, 354, 346, 359, 365, 417, 426, 442, 455, 454, 500, 497, 526
Offset: 1
Keywords
Examples
a(4)=4 as A000040(4)=7 and there are no more representations than 7 = (3+5+13)/3 = (3+7+11)/3 = (5+5+11)/3 = (7+7+7)/3.
Programs
-
Haskell
a071703 = z a065091_list 0 . (* 3) . a000040 where z _ 3 m = fromEnum (m == 0) z ps'@(p:ps) i m = if m < p then 0 else z ps' (i+1) (m - p) + z ps i m -- Reinhard Zumkeller, May 24 2015
Extensions
Definition, initial term and example corrected. Thanks to Zak Seidov, who found the mistake. - Reinhard Zumkeller, May 24 2015
A178953 Indices n such that 2*prime(n) cannot be written as a sum of two distinct prime(n-k) and prime(n+k).
1, 2, 4, 8, 9, 14, 15, 21, 22, 29, 30, 35, 38, 46, 48, 49, 50, 52, 53, 57, 58, 60, 61, 62, 65, 66, 90, 91, 95, 96, 97, 99, 114, 120, 121, 122, 123, 124, 125, 128, 145, 146, 149, 153, 154, 163, 176, 179, 180, 186, 187, 189, 191, 192, 197
Offset: 1
Keywords
Comments
Snapshots: a(1000) = 6922, a(2000) = 16376, a(3000) = 25951, a(4000) = 37266, a(5000) = 51926, a(6000) = 69928. - R. J. Mathar, Jan 08 2011
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..500
Programs
-
Haskell
a178953 n = a178953_list !! (n-1) a178953_list = filter ((== 0) . a178609) [1..] -- Reinhard Zumkeller, Jan 30 2014
-
Maple
A178609 := proc(n) for k from n-1 to 0 by -1 do if ithprime(n-k)+ithprime(n+k)=2*ithprime(n) then return k; end if; end do: end proc: for n from 1 to 200 do if A178609(n) = 0 then printf("%d,",n) ; end if; end do: # R. J. Mathar, Jan 05 2011
-
Mathematica
A178609[n_] := For[k = n-1, k >= 0, k--, If[Prime[n-k] + Prime[n+k] == 2*Prime[n], Return[k]]]; Reap[For[n = 1, n <= 200, n++, If[A178609[n] == 0, Sow[n]]]][[2, 1]] (* Jean-François Alcover, Feb 13 2018, after R. J. Mathar *)
Formula
A178609(a(n))=0.
A137700 Smallest k such that the k-th prime has exactly n distinct representations as arithmetic mean of two primes.
1, 3, 5, 7, 12, 16, 24, 20, 26, 41, 33, 44, 51, 55, 54, 79, 64, 74, 69, 88, 121, 92, 101, 109, 113, 116, 124, 155, 152, 137, 144, 140, 160, 174, 165, 209, 197, 195, 201, 200, 206, 218, 251, 238, 229, 239, 230, 244, 236, 267, 295, 281, 299, 301, 307, 312, 313, 325
Offset: 0
Keywords
Extensions
Corrected description suggested by Zak Seidov, May 16 2008
A253138 Number of ways to represent the n-th prime as the arithmetic mean of two semiprimes.
0, 0, 1, 1, 0, 1, 1, 1, 1, 2, 1, 3, 2, 4, 3, 4, 3, 3, 5, 7, 6, 5, 5, 8, 8, 7, 9, 7, 10, 10, 12, 11, 15, 12, 14, 14, 13, 11, 13, 15, 15, 14, 15, 20, 14, 15, 19, 20, 16, 17, 17, 17, 21, 24, 23, 24, 28, 23, 25, 24, 27, 25, 32, 29, 25, 21, 26, 31, 31, 29, 36, 32
Offset: 1
Keywords
Comments
Conjecture: a(n)>0 for n>5.
Examples
a(12)=3 as prime(12) = 37 = (9+65)/2 = (25+49)/2 =(35+39)/2 where 9, 25, 35, 39, 49 and 65 are semiprime.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..1000
Programs
-
Haskell
a253138 n = sum $ map a064911 $ takeWhile (> 0) $ map (2 * p -) $ dropWhile (< p) a001358_list where p = a000040 n -- Reinhard Zumkeller, Mar 27 2015
-
Maple
with(numtheory):for n from 1 to 100 do:c:=0:p:=ithprime(n):for m from 1 to p-1 do:p1:=p-m:p2:=p+m:if bigomega(p1)=2 and bigomega(p2)=2 then c:=c+1:else fi:od:printf(`%d, `,c):od:
-
Mathematica
Reap[For[n=1, n <= 100, n++, c=0; p = Prime[n]; For[m=1, m <= p-1, m++, p1 = p-m; p2 = p+m; If[PrimeOmega[p1] == 2 && PrimeOmega[p2] == 2 , c = c+1]]; Print[c]; Sow[c]]][[2, 1]] (* Jean-François Alcover, Mar 23 2015, translated from Maple *)
Comments
Examples
Links
Crossrefs
Programs
Haskell
Mathematica
PARI
Python
Formula
Extensions