login
Remainder when 2nd order prime pp(n) = A006450(n) is divided by n-th prime = A000040(n).
6

%I #17 Mar 25 2017 19:24:06

%S 1,2,1,3,9,2,8,10,14,22,3,9,15,19,23,29,41,39,63,69,2,6,16,16,24,42,

%T 48,52,54,52,74,84,88,102,114,122,134,152,156,166,168,1,7,13,19,23,31,

%U 71,71,73,73,65,77,91,79,91,109,115,125,137,149,155,185,197,203,197,235

%N Remainder when 2nd order prime pp(n) = A006450(n) is divided by n-th prime = A000040(n).

%H Alois P. Heinz, <a href="/A076240/b076240.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = prime^2(n) mod prime(n) = A006450(n) mod A000040(n).

%e a(4) = 3 since prime(prime(4)) (mod prime(4)) = prime(7) (mod 7) = 17 (mod 7) = 3. - _Michael De Vlieger_, Mar 25 2017

%p a:= n-> (p-> irem(ithprime(p), p))(ithprime(n)):

%p seq(a(n), n=1..70); # _Alois P. Heinz_, Oct 09 2015

%t Table[Mod @@ Map[Nest[Prime, n, #] &, {2, 1}], {n, 65}] (* _Michael De Vlieger_, Mar 25 2017 *)

%o (PARI) a(n) = prime(prime(n)) % prime(n); \\ _Michel Marcus_, Mar 25 2017

%Y Cf. A006450, A038580, A049090, A049203, A049202, A057809, A076241, A076242, A076243.

%K nonn,look

%O 1,2

%A _Labos Elemer_, Oct 08 2002