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-2 of 2 results.

A260580 Table read by rows: n-th row contains numbers not occurring earlier, that can be written as (p+q)/2 where p is the n-th odd prime, q <= p.

Original entry on oeis.org

3, 4, 5, 6, 7, 8, 9, 11, 10, 12, 13, 14, 15, 17, 16, 18, 19, 20, 21, 23, 24, 26, 29, 22, 25, 27, 30, 31, 28, 33, 34, 37, 32, 35, 36, 39, 41, 40, 42, 43, 38, 44, 45, 47, 48, 50, 53, 51, 56, 59, 46, 49, 52, 54, 57, 60, 61, 55, 63, 64, 67, 62, 65, 66, 69, 71
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 11 2015

Keywords

Comments

Length of n-th row = A105047(n+1);
T(n,1) = A260485(n);
T(n,A105047(n)) = A065091(n).

Examples

			Let p(n) = A065091(n) = prime(n+1):
.   n | p(n) | T(n,*)
. ----+------+----------------- ------------------------------------------
.   1 |    3 | [3]              3
.   2 |    5 | [4,5]            (5+3)/2,5
.   3 |    7 | [6,7]            (7+5)/2,7
.   4 |   11 | [8,9,11]         (11+5)/2,(11+7)/2,11
.   5 |   13 | [10,12,13]       (13+7)/2,(13+11)/2,13
.   6 |   17 | [14,15,17]       (17+11)/2,(17+13)/2,17
.   7 |   19 | [16,18,19]       (19+13)/2,(19+17)/2,19
.   8 |   23 | [20,21,23]       (23+17)/2,(23+19)/2,23
.   9 |   29 | [24,26,29]       (29+19)/2,(29+17)/2,29
.  10 |   31 | [22,25,27,30,31] (31+13)/2,(31+19)/2,(31+23)/2,(31+29)/2,31
.  11 |   37 | [28,33,34,37]    (37+19)/2,(37+29)/2,(37+31)/2,37
.  12 |   41 | [32,35,36,39,41] (41+23)/2,(41+29)/2,(41+31)/2,(41+37)/2,41
		

Crossrefs

Programs

  • Haskell
    import Data.List.Ordered (union); import Data.List ((\\))
    a260580 n k = a260580_tabf !! (n-1) !! (k-1)
    a260580_row n = a260580_tabf !! (n-1)
    a260580_tabf = zipWith (\\) (tail zss) zss where
                                zss = scanl union [] a065305_tabl

A102696 Number of positive even integers that can be written as the sum of 2 of the first n odd primes (not necessarily distinct).

Original entry on oeis.org

1, 3, 5, 8, 11, 14, 17, 20, 23, 28, 32, 37, 40, 44, 47, 50, 57, 61, 66, 70, 73, 78, 83, 89, 94, 99, 103, 107, 110, 117, 122, 127, 134, 139, 144, 150, 154, 160, 165, 170, 177, 181, 187, 192, 196, 202, 207, 215, 220, 227, 231, 236, 242, 247, 250, 253, 261, 269, 274, 278
Offset: 1

Views

Author

Gabriel Cunningham (gcasey(AT)mit.edu), Feb 04 2005

Keywords

Comments

A105047(n+2) = a(n+1) - a(n). - Reinhard Zumkeller, Aug 11 2015

Examples

			a(3) = 5 because with the primes {3, 5, 7} one can write 6 = 3+3, 8 = 3+5, 10 = 5+5, 12 = 5+7 and 14 = 7+7, for a total of 5 even numbers.
a(3) = 5 because with the primes {3, 5, 7} one can write 6 = 3+3, 8 = 3+5, 10 = 5+5 & 3+7, 12 = 5+7 and 14 = 7+7, for a total of 5 even numbers.
		

Crossrefs

Cf. A105047 (first differences).

Programs

  • Haskell
    import Data.List (nub)
    a102696 n = length $ nub
       [p + q | p <- take n a065091_list, q <- takeWhile (<= p) a065091_list]
    -- Reinhard Zumkeller, Aug 11 2015
  • Maple
    N:= 1000: # to get first N terms
    Primes:= {seq(ithprime(i),i=2..N+1)}:
    S:= {}:
    for n from 1 to N do
    S:= S union map(`+`,Primes[1..n],Primes[n]);
    A[n]:= nops(S);
    od:
    seq(A[n],n=1..N); # Robert Israel, Sep 03 2014
  • Mathematica
    f[n_] := Block[{tp = Table[ Prime[i], {i, 2, n + 1}]}, Length[ Union[ Flatten[ Table[tp[[i]] + tp[[j]], {i, n}, {j, i}]] ]]]; Table[ f[n], {n, 60}] (* Robert G. Wilson v, Feb 05 2005 *)
  • PARI
    a(n)=my(P=prime(n+1),s); forstep(k=6,2*P,2, forprime(p=max(k-P,3), min(P,k/2), if(isprime(k-p), s++; break))); s \\ Charles R Greathouse IV, Sep 04 2014
    
  • PARI
    list(n)=my(P=prime(n+1),u=vectorsmall(P),v=vector(n),k); forprime(p=3,P, forprime(q=3,p,u[(p+q)/2]=1); v[k++]=sum(i=1,p,u[i])); v \\ Charles R Greathouse IV, Sep 04 2014
    

Extensions

More terms from Robert G. Wilson v, Feb 05 2005
Showing 1-2 of 2 results.