login
a(n) = prime(n) + prime(prime(n)).
3

%I #20 May 08 2021 07:42:00

%S 5,8,16,24,42,54,76,86,106,138,158,194,220,234,258,294,336,344,398,

%T 424,440,480,514,550,606,648,666,694,708,730,836,870,910,936,1008,

%U 1028,1076,1130,1158,1204,1242,1268,1344,1364,1398,1416,1508,1632,1660,1676,1704

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

%H Michael S. Branicky, <a href="/A073136/b073136.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Harvey P. Dale)

%e For n = 5, prime(5) = 11 and prime(11) = 31, so a(5) = 11 + 31 = 42.

%t pp[n_]:=Module[{p1=Prime[n]},p1+Prime[p1]]; Array[pp,50] (* _Harvey P. Dale_, Feb 19 2014 *)

%t a[n_] := Prime[n] + Prime[Prime[n]]; Table[a[n], {n, 50}] (* _Carlos Eduardo Olivieri_, Dec 18 2014 *)

%o (PARI) a(n) = prime(n) + prime(prime(n)) \\ _Michel Marcus_, Jun 26 2013

%o (Python)

%o from sympy import prime, sieve

%o def aupton(terms):

%o p = [None] + list(sieve.primerange(1, prime(prime(terms))+1))

%o return [p[n] + p[p[n]] for n in range(1, terms+1)]

%o print(aupton(51)) # _Michael S. Branicky_, May 08 2021

%Y Cf. A000040, A073065.

%K easy,nonn

%O 1,1

%A Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 22 2002

%E Corrected and extended by _Michel Marcus_, Jun 26 2013