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!)
A268340 Characteristic function of the prime powers p^k, k >= 2. 6

%I #29 Mar 31 2023 14:14:51

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

%T 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,1,0,0,0,0,

%U 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,0,0,0,0,1

%N Characteristic function of the prime powers p^k, k >= 2.

%C Mobius transform of A046660. - _Isaac Saffold_, Dec 14 2017

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

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>

%F a(n) = Sum_{d|n} (mobius(n/d)*(bigomega(d) - omega(d))) - _Isaac Saffold_, Dec 14 2017

%p N:= 1000: # to get a(1)...a(N)

%p V:= Vector(N):

%p for p in select(isprime, [2,seq(i,i=3..isqrt(N),2)]) do

%p for k from 2 to floor(log[p](N)) do

%p V[p^k]:= 1

%p od od:

%p convert(V,list); # _Robert Israel_, Dec 14 2017

%t Table[Boole@ And[PrimePowerQ@ n, ! PrimeQ@ n], {n, 105}] (* _Michael De Vlieger_, Feb 02 2016 *)

%t Table[If[!PrimeQ[n]&&PrimePowerQ[n],1,0],{n,130}] (* _Harvey P. Dale_, Jan 20 2019 *)

%o (PARI) a(n)=my(b);ispower(n,,&b)&&isprime(b)

%o (PARI) first(n) = my(res = vector(n)); forprime(p = 2, sqrtint(n), for(i = 2, logint(n, p), res[p^i] = 1)); res \\ _David A. Corneth_, Nov 03 2017

%o (Python)

%o from sympy import primefactors

%o def A268340(n): return int(len(s:=primefactors(n)) == 1 and n>s[0]) # _Chai Wah Wu_, Mar 31 2023

%Y Characteristic function of A246547.

%Y Cf. A069513, A010055, A075802, A112526.

%K nonn,easy

%O 1

%A _Jeppe Stig Nielsen_, Feb 02 2016

%E More terms from _Antti Karttunen_, Nov 03 2017

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 April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)