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.

A258263 First differences of A258233.

Original entry on oeis.org

1, 0, 2, 3, 1, 4, 4, 1, 9, 5, 2, 10, -2, 4, 8, 11, 8, 5, 11, -5, 15, 5, 11, 14, 10, -1, 7, 11, 0, 32, 14, 4, 11, 19, 15, 2, 11, 10, 12, 25, 15, 21, -11, 15, 10, 47, 8, 17, 16, -6, 48, -2, 24, -3, 24, 28, 8, 10, 41, -27, 33, 49, 25, -11, 15, 73, 1, 31, 23, -8, 42, 13, 13, 67, -23, 56, 5, 30, 33, 41, 14, 49, -34, 42, -6, 64, 13, 21
Offset: 1

Views

Author

Zak Seidov, May 24 2015

Keywords

Crossrefs

Cf. A258233.

Formula

a(n) = A258233(n+1)-A258233(n).

A071704 Number of ways to represent the n-th prime as arithmetic mean of three other odd primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 03 2002

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.
		

Crossrefs

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

A258261 Primes p such that 3p - 4 is also prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 19, 29, 31, 37, 47, 59, 61, 67, 79, 89, 107, 131, 149, 151, 157, 191, 197, 199, 227, 229, 241, 271, 277, 281, 311, 317, 367, 389, 397, 409, 421, 431, 457, 479, 499, 509, 521, 541, 547, 557, 571, 617, 631, 659, 661, 677, 691, 701, 719
Offset: 1

Views

Author

Zak Seidov, May 24 2015

Keywords

Comments

This sequence is interesting because of the comments in A258233: for n > 1, if 3 * prime(n) - 4 is prime then A258233(n) = 1 + A071704(n), otherwise A258233 (n) = A071704(n). - Zak Seidov, Jun 04 2015
Subsequence of primes of A228121. - Michel Marcus, May 30 2015

Examples

			3 * 2 - 4 = 2, 3 * 3 - 4 = 5, 3 * 5 - 4 = 11, 3 * 7 - 4 = 17, 3 * 11 - 4 = 29 are all prime, so 2, 3, 5, 7, 11 are all in the sequence.
3 * 13 - 4 = 35 = 5 * 7, so 13 is not in the sequence.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(1000) | IsPrime(3*p-4)]; // Vincenzo Librandi, May 25 2015
    
  • Mathematica
    Select[Prime[Range[200]], PrimeQ[3# - 4] &]
  • PARI
    forprime(p=1,10^3,if(isprime(3*p-4),print1(p,", "))) \\ Derek Orr, May 27 2015
Showing 1-3 of 3 results.