login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A074038 If n is the k-th single (i.e., non-twin) prime then a(n) = k, otherwise a(n) = 0. 3

%I #19 Dec 03 2021 10:45:05

%S 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,

%T 0,0,3,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,

%U 0,0,0,0,0,0,0,0,0,0,7,0,0,0,8,0,0,0,0,0,9,0,0,0,0,0,0,0,10,0,0

%N If n is the k-th single (i.e., non-twin) prime then a(n) = k, otherwise a(n) = 0.

%H Antti Karttunen, <a href="/A074038/b074038.txt">Table of n, a(n) for n = 1..65537</a>

%F A007510(a(n)) = n.

%t upto = 100;

%t A074038list[upto_] := Module[{k = 0, v = Table[0, {upto}], n},

%t For[n = 1, n <= upto, n++, If[PrimeQ[n] && (2 == n ||

%t ((!PrimeQ[n-2]) && (!PrimeQ[n+2]))), k++; v[[n]] = k,

%t v[[n]] = 0]]; v];

%t v074038 = A074038list[upto];

%t a[n_] := v074038[[n]];

%t Table[a[n], {n, 1, upto}] (* _Jean-François Alcover_, Dec 03 2021, after PARI code *)

%o (PARI)

%o up_to = 65537;

%o A074038list(up_to) = { my(k=0,v=vector(up_to)); for(n=1,up_to,if(isprime(n)&&(2==n||((!isprime(n-2))&&(!isprime(n+2)))),k++;v[n]=k, v[n] = 0)); (v); };

%o v074038 = A074038list(up_to);

%o A074038(n) = v074038[n];

%Y Cf. A007510, A049084, A074039.

%K nonn

%O 1,23

%A _Reinhard Zumkeller_, Aug 13 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 1 23:54 EDT 2024. Contains 372178 sequences. (Running on oeis4.)