login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = prime(n+3) mod prime(n).
1

%I #16 Sep 08 2022 08:46:13

%S 1,2,3,3,8,10,12,12,14,12,12,10,12,16,14,14,12,12,12,12,16,18,18,14,

%T 10,8,10,20,22,24,12,18,14,18,14,16,16,16,14,18,14,16,8,18,26,28,18,

%U 10,12,12,18,18,22,18,14,14,12,12,16,26,28,20,10,20,24,30,18,16,12

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

%H Harvey P. Dale, <a href="/A261469/b261469.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = prime(n+3) mod prime(n).

%e a(3) = 13 mod 5 = 3.

%t a[n_]:=PowerMod[Prime[n + 3], 1, Prime[n]]; Table[a[n], {n, 80}] (* _Vincenzo Librandi_, Aug 20 2015 *)

%t Mod[Last[#],First[#]]&/@Partition[Prime[Range[80]],4,1] (* _Harvey P. Dale_, Jun 23 2017 *)

%o (PARI) first(m)=vector(m,i,prime(i+3)%prime(i)) \\ _Anders Hellström_, Aug 20 2015

%o (Magma) [NthPrime(n+3) mod NthPrime(n): n in [1.. 70]]; // _Vincenzo Librandi_, Aug 20 2015

%Y Cf. A031165.

%K nonn,easy,less

%O 1,2

%A _Altug Alkan_, Aug 20 2015