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) = -1 iff n is prime, a(n) = 1 iff n is not squarefree, otherwise (n is nonprime and squarefree) a(n) = 0.
1

%I #11 May 21 2017 18:27:47

%S 0,-1,-1,1,-1,0,-1,1,1,0,-1,1,-1,0,0,1,-1,1,-1,1,0,0,-1,1,1,0,1,1,-1,

%T 0,-1,1,0,0,0,1,-1,0,0,1,-1,0,-1,1,1,0,-1,1,1,1,0,1,-1,1,0,1,0,0,-1,1,

%U -1,0,1,1,0,0,-1,1,0,0,-1,1,-1,0,1,1,0,0,-1,1,1,0,-1,1,0,0,0,1,-1,1,0,1,0,0,0,1,-1,1,1,1,-1,0,-1,1,0

%N a(n) = -1 iff n is prime, a(n) = 1 iff n is not squarefree, otherwise (n is nonprime and squarefree) a(n) = 0.

%H G. C. Greubel, <a href="/A106743/b106743.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = 1 - 0^(A001222(n)-A001221(n)) - 0^(A001222(n)-1), for n>1. - _Reinhard Zumkeller_, May 23 2005

%t Table[Which[PrimeQ[n],-1,SquareFreeQ[n],0,True,1],{n,110}] (* _Harvey P. Dale_, Aug 30 2015 *)

%o (PARI) for(n=1,105,print1(if(!issquarefree(n),1,if(isprime(n),-1,0)),","))

%Y Cf. A000040 (prime), A013929 (not squarefree), A000469 (nonprime and squarefree), A082926.

%K sign

%O 1,1

%A _Giovanni Teofilatto_, May 16 2005

%E Edited and extended by _Klaus Brockhaus_, May 16 2005