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.

A269043 a(n) is the number of distinct values that can be expressed as prime(n+k) + prime(n-k) in at least 2 different ways.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 2, 3, 3, 2, 2, 3, 1, 4, 4, 2, 4, 4, 4, 3, 5, 5, 7, 9, 8, 7, 8, 7, 6, 7, 9, 7, 9, 8, 11, 8, 8, 7, 10, 9, 11, 12, 9, 9, 14, 11, 12, 11, 15, 15, 12, 14, 12, 12, 17, 11, 14, 15, 15, 14, 15, 18, 16, 13, 18, 12, 16, 14, 16, 14, 12, 19, 17, 13, 19
Offset: 1

Views

Author

Michel Lagneau, Feb 18 2016

Keywords

Comments

Conjecture: a(n) > 0 for n > 3.

Examples

			a(13) = 3 because:
p(13 + 1)  + p(13 - 1)  = 43 + 37 = 80;
p(13 + 2)  + p(13 - 2)  = 47 + 31 = 78;
p(13 + 3)  + p(13 - 3)  = 53 + 29 = 82;
p(13 + 4)  + p(13 - 4)  = 59 + 23 = 82;
p(13 + 5)  + p(13 - 5)  = 61 + 19 = 80;
p(13 + 6)  + p(13 - 6)  = 67 + 17 = 84;
p(13 + 7)  + p(13 - 7)  = 71 + 13 = 84;
p(13 + 8)  + p(13 - 8)  = 73 + 11 = 84.
p(13 + 9)  + p(13 - 9)  = 79 + 7  = 86;
p(13 + 10) + p(13 - 10) = 83 + 5  = 88;
p(13 + 11) + p(13 - 11) = 89 + 3  = 92;
p(13 + 12) + p(13 - 12) = 97 + 2  = 99.
The 3 distinct values of prime(n+k) + prime(n-k) that are each obtained in at least 2 ways are 80, 82 and 84.
		

Crossrefs

Programs

  • Maple
    for n from 1 to 100 do:
      lst:={}:W:=array(1..n-1):cr:=0:
        for m from n-1 by -1 to 1 do:
          q:=ithprime(n-m)+ithprime(n+m):lst:=lst union {q}:W[m]:=q:
        od:
          n0:=nops(lst):c:=0:U:=array(1..n0):
            for i from 1 to n0 do:
             c1:=0:
             for j from 1 to n-1 do:
              if lst[i]=W[j] then c:=c+1:c1:=c1+1:
              else fi:
             od:
            U[i]:=c1:cr:=cr+1:
           od:
           ct:=0:
           for l from 1 to cr do:
           if U[l]>1 then ct:=ct+1:
           else fi:
           od:
           printf(`%d, `,ct):
    od:
  • PARI
    a(n) = {v = []; for (k=1, n-1, v = concat(v, prime(n+k) + prime(n-k));); vd = vecsort(v,,8); sum(k=1, #vd, #select(x->x==vd[k], v)>1);} \\ Michel Marcus, Mar 13 2016