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.

A195324 Even numbers that cannot be represented as the sum of an odd prime and a safe prime (A005385).

This page as a plain text file.
%I A195324 #15 Aug 03 2014 14:01:33
%S A195324 2,4,6,32,56,92,98,122,128,140,152,176,194,212,224,242,254,260,272,
%T A195324 296,302,308,326,332,368,392,398,410,422,434,452,458,476,488,500,512,
%U A195324 518,524,536,542,560,572,596,602,632,644,656,662,674,686,692,704,710,728
%N A195324 Even numbers that cannot be represented as the sum of an odd prime and a safe prime (A005385).
%H A195324 Reinhard Zumkeller, <a href="/A195324/b195324.txt">Table of n, a(n) for n = 1..10000</a>
%H A195324 StackExchange, <a href="http://math.stackexchange.com/questions/64109/even-numbers-greater-than-6-as-sum-of-two-specific-primes/64111#64111">Even numbers greater than 6 as sum of two specific primes</a>
%t A195324 mx = 1000; safe = Select[Prime[Range[PrimePi[mx]]], PrimeQ[(# - 1)/2] &]; p = Prime[Range[2, PrimePi[mx]]]; Complement[Range[2, mx, 2], Union[Flatten[Outer[Plus, p, t]]]] (* _T. D. Noe_, Sep 15 2011 *)
%o A195324 #!/usr/bin/perl
%o A195324 $| = 1;
%o A195324 sub is_prime {
%o A195324   my $n = shift;
%o A195324   return 0 if $n < 2;
%o A195324   return 1 if $n == 2;
%o A195324   return 0 unless $n % 2;
%o A195324   my $sn = int(sqrt($n));
%o A195324   for (my $j = 3; $j <= $sn; $j += 2) {
%o A195324     return 0 if $n % $j == 0;
%o A195324   }
%o A195324   return 1;
%o A195324 }
%o A195324 my $n = 0;
%o A195324 while (1) {
%o A195324   ++$n;
%o A195324   next if $n % 2;
%o A195324   my $found = 0;
%o A195324   for my $p (3 .. $n) {
%o A195324     next unless $p % 2;
%o A195324     my $q = $n - $p;
%o A195324     next unless $q % 2;
%o A195324     next unless is_prime($p);
%o A195324     next unless is_prime($q);
%o A195324     next unless is_prime(($p - 1) / 2) || is_prime(($q - 1) / 2);
%o A195324     $found = 1;
%o A195324     last;
%o A195324   }
%o A195324   print "$n\n" unless $found;
%o A195324 }
%o A195324 (Haskell)
%o A195324 a195324 n = a195324_list !! (n-1)
%o A195324 a195324_list = filter p [2,4..] where
%o A195324    p n = all ((== 0) . a010051) $ takeWhile (> 1) $ map (n -) a005385_list
%o A195324 -- _Reinhard Zumkeller_, Sep 18 2011
%Y A195324 Cf. A000040 (primes), A005385 (safe primes).
%K A195324 nonn
%O A195324 1,1
%A A195324 _Dan Brumleve_, Sep 15 2011