A034962 and A050207 can't both be correct

Joshua Zucker joshua.zucker at gmail.com
Sun Jan 28 05:03:39 CET 2007


On 1/27/07, Artur <grafix at csl.pl> wrote:
> Joshua,
> If you know algorithm which can generated A050207 try expain this subtle
> difference with A034962 which you see and give example mathematical not
> "linguistic"
> ARTUR

OK, I still think it should be "that", not "which", in the name of the
sequence A034962.

Short answer: I just submitted the following.
%I A050207
%S A050207 23 29 41 47 59 97 131 137 223 283 311 317 367 389 457 563
587 607 677 743 839 857 907 929 941 947 1031 1049 1093 1283 1303 1453
1489 1847 1867 1913 1931 1993 2027 2347 2381 2441 2477 2579 2617 2657
2729 2749 2777 2803 2819 2887 2909 3083 3137 3343 3467 3533 3697 3767
3877
%N A050207 Primes of the form p + (smallest prime >= p+1) + (smallest
prime >= p+3).
%C A050207 Originally an erroneous version of A034962
%e A050207 p = 5: 23 = 5 + 7 + 11
p = 7: 29 = 7 + 11 + 11
p = 11: 41 = 11 + 13 + 17
p = 13: 47 = 13 + 17 + 17
p = 17: 59 = 17 + 19 + 23
p = 19: 65 = 19 + 23 + 23 is not prime, so not in the sequence.
p = 17: 59 = 17 + 19 + 23
%Y A050207 A034962
%O A050207 1
%K A050207 ,nonn,
%A A050207 Joshua Zucker (joshua.zucker at stanfordalumni.org), Jan 27 2007


Long answer:
I noticed A050207 has the following PARI code:
(PARI) psumpr3(n) = { c1=0; c2=0; forprime(x=3, n, s =
nextprime(x)+nextprime(x+1)+nextprime(x+3); c1++; if(isprime(s), c2++;
print1(s" ")); ); print(); print(c2/c1+.0) }

which looks like it's finding something about the prime after x, the
prime after x+1, and the prime after x+3 (but often these can all be
the same prime, or two copies of one prime and one of another, no?)
And then I don't understand the incrementing of c1 and c2 and printing
of c2/c1 -- printing s seems to be the sequence, though, so I'll just
hope those are ignorable.  Ah, but now I see that in PARI nextprime(p)
returns p.  OK.

Here's my Scheme code -- I think equivalent to the PARI code above.
(nextprime is a function I wrote that works the same as PARI's
nextprime I think; next-prime on the other hand does NOT return p if
given a prime p as input, but goes on to the next prime.)

(define (sum-three-prime? n)
    (begin
      (cond
        [(prime? n)
         (let ([s (+ (nextprime n)
                     (nextprime (+ n 1))
                     (nextprime (+ n 3)))])
           (cond
             [(prime? s) (display s) (display " ")]))])
      (sum-three-prime? (next-prime n))))

and here's the output:
23 29 41 47 59 97 131 137 223 283 311 317 367 389 457 563 587 607 677
743 839 857 907 929 941 947 1031 1049 1093 1283 1303 1453 1489 1847
1867 1913 1931 1993 2027 2347 2381 2441 2477 2579 2617 2657 2729 2749
2777 2803 2819 2887 2909 3083 3137 3343 3467 3533 3697 3767 3877 3911
3917 3967 4049 4217 4289 4349 4363 4451 4457 4729 4799 4951 5087 5189
5569 5657 5813 5897 5953 5987 6257 6287 6353 6397 6449 6719 6977 7027
7297 7393 7583 7793 7927 8069 8287 8377 8423 8681 8867 8969 9011 9049
9377 9463 9497 9643 9679 9767 9787 9907 ...

OK, looks the same as the (deceased) A050207.
So, new name for A050207:
Primes of the form p + (smallest prime >= p+1) + (smallest prime >= p+3).

Examples:
23 = 5 + 7 + 11
29 = 7 + 11 + 11

--Joshua Zucker





More information about the SeqFan mailing list