cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A302047 a(n) = 1 if n = prime(k)*prime(2+k) for some k, otherwise 0.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Antti Karttunen, Apr 24 2018

Keywords

Comments

Characteristic function for prime(n)*prime(n+2) (A090076).

Crossrefs

Programs

  • Mathematica
    Array[Boole@ And[Length@ # == 2, Max@ #[[All, -1]] == 1, Subtract @@ PrimePi[#[[All, 1]]] == -2 ] &@ FactorInteger@ # &, 120] (* or *)
    With[{s = Array[Prime[#] Prime[# + 2] &, 5]}, ReplacePart[ConstantArray[0, Max@ s], Map[# -> 1 &, s] ] ] (* Michael De Vlieger, Apr 27 2018 *)
    Module[{pp2=Table[Prime[n]Prime[n+2],{n,5}],nn},nn=Max[pp2];Table[ If[ MemberQ[ pp2,k],1,0],{k,nn}]] (* Harvey P. Dale, Dec 13 2021 *)
  • PARI
    A302047(n) = if((2!=bigomega(n))||(2!=omega(n)),0,my(f=factor(n)); (f[2,1] == nextprime(1+nextprime(1+f[1,1]))));

Formula

a(n) = A185015(A246277(n)).