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.

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

This page as a plain text file.
%I A102696 #50 Oct 12 2018 20:18:47
%S A102696 1,3,5,8,11,14,17,20,23,28,32,37,40,44,47,50,57,61,66,70,73,78,83,89,
%T A102696 94,99,103,107,110,117,122,127,134,139,144,150,154,160,165,170,177,
%U A102696 181,187,192,196,202,207,215,220,227,231,236,242,247,250,253,261,269,274,278
%N A102696 Number of positive even integers that can be written as the sum of 2 of the first n odd primes (not necessarily distinct).
%C A102696 A105047(n+2) = a(n+1) - a(n). - _Reinhard Zumkeller_, Aug 11 2015
%H A102696 Robert Israel, <a href="/A102696/b102696.txt">Table of n, a(n) for n = 1..10000</a>
%e A102696 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.
%e A102696 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.
%p A102696 N:= 1000: # to get first N terms
%p A102696 Primes:= {seq(ithprime(i),i=2..N+1)}:
%p A102696 S:= {}:
%p A102696 for n from 1 to N do
%p A102696 S:= S union map(`+`,Primes[1..n],Primes[n]);
%p A102696 A[n]:= nops(S);
%p A102696 od:
%p A102696 seq(A[n],n=1..N); # _Robert Israel_, Sep 03 2014
%t A102696 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 *)
%o A102696 (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
%o A102696 (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
%o A102696 (Haskell)
%o A102696 import Data.List (nub)
%o A102696 a102696 n = length $ nub
%o A102696    [p + q | p <- take n a065091_list, q <- takeWhile (<= p) a065091_list]
%o A102696 -- _Reinhard Zumkeller_, Aug 11 2015
%Y A102696 Cf. A105047 (first differences).
%K A102696 easy,nonn
%O A102696 1,2
%A A102696 Gabriel Cunningham (gcasey(AT)mit.edu), Feb 04 2005
%E A102696 More terms from _Robert G. Wilson v_, Feb 05 2005