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.

A103790 a(n) = the minimum k that makes prime(n)+A019565(k) prime.

This page as a plain text file.
%I A103790 #3 Mar 31 2012 10:23:47
%S A103790 0,1,1,3,1,3,1,5,3,1,3,3,1,5,3,3,1,3,3,1,3,5,3,9,3,1,3,1,7,9,5,3,1,5,
%T A103790 1,3,3,5,3,3,1,5,1,3,1,7,7,3,1,5,3,1,5,3,3,3,1,3,3,1,5,9,3,1,13,7,3,5,
%U A103790 1,5,3,7,3,3,5,3,7,11,7,5,1,5,1,3,5,3,7,3,1,15,11,7,13,7,5,3,9,1,13,3,5,3,3
%N A103790 a(n) = the minimum k that makes prime(n)+A019565(k) prime.
%C A103790 All elements except the first one are odd. This suggests a new way looking for large primes candidates.
%e A103790 Prime(1)+A019565(0)=2+1=3 is prime, so a(1)=0;
%e A103790 Prime(4)+A019565(3)=7+6=13 is prime, so a(4)=3;
%t A103790 A019565 = Function[tn, k1 = tn; o = 1; tt = 1; While[k1 > 0, k2 = Mod[k1, 2]; If[k2 == 1, tt = tt*Prime[o]]; k1 = (k1 - k2)/2; o = o + 1]; tt]; Do[npd = Prime[n]; ts = 1; tt = ts; cp = npd + A019565[tt]; While[ ! (PrimeQ[cp]), ts = ts + 1; tt = ts; cp = npd + A019565[ tt]]; Print[ts], {n, 3, 200} ]
%Y A103790 Cf. A019565.
%K A103790 easy,nonn
%O A103790 1,4
%A A103790 _Lei Zhou_, Feb 16 2005