login
a(n) = prime(n)+(prime(n) modulo 6).
1

%I #11 Jul 18 2018 23:44:49

%S 4,6,10,8,16,14,22,20,28,34,32,38,46,44,52,58,64,62,68,76,74,80,88,94,

%T 98,106,104,112,110,118,128,136,142,140,154,152,158,164,172,178,184,

%U 182,196,194,202,200,212,224,232,230,238,244,242,256,262,268,274,272,278,286,284,298,308,316,314

%N a(n) = prime(n)+(prime(n) modulo 6).

%C For n>2, a(n)-a(n+1)=2 iff prime(n) and prime(n+1) are twin primes; e.g., a(3)-a(4)=10-8=2 and prime(3)=5 and prime(4)=7 are twin primes.

%H Robert Israel, <a href="/A263483/b263483.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A000040(n) + A039704(n). - _Michel Marcus_, Oct 27 2015

%p p:= 1:

%p for n from 1 to 100 do

%p p:= nextprime(p);

%p A[n]:= p + (p mod 6);

%p od:

%p seq(A[n],n=1..100); # _Robert Israel_, Jul 18 2018

%t Table[(p=Prime[n])+Mod[p,6],{n,100}]

%o (PARI) a(n) = apply(x->(x + x%6), prime(n)); \\ _Michel Marcus_, Oct 27 2015

%Y Cf. A000040, A039704.

%K nonn

%O 1,1

%A _Zak Seidov_, Oct 19 2015