login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = 1 if n = 2 * p^k, with p an odd prime and k >= 1, otherwise 0.
1

%I #15 Sep 18 2023 19:41:59

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

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

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

%N a(n) = 1 if n = 2 * p^k, with p an odd prime and k >= 1, otherwise 0.

%H Antti Karttunen, <a href="/A354981/b354981.txt">Table of n, a(n) for n = 1..100000</a>

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

%F a(n) = [n == 2 (mod 4)] * A069513(n/2), where [ ] is the Iverson bracket.

%F For n > 4, a(n) = A211487(n) - A174275(n).

%t a[n_] := If[IntegerExponent[n, 2] == 1 && PrimePowerQ[n/2], 1, 0]; Array[a, 100] ( * _Amiram Eldar_, Jun 15 2022 *)

%t Module[{nn=150,c},c=Union[Flatten[Table[2 p^k,{p,Prime[Range[2,35]]},{k,5}]]];Table[If[ MemberQ[ c,k],1,0],{k,nn}]] (* _Harvey P. Dale_, Sep 18 2023 *)

%o (PARI) A354981(n) = (2==(n%4) && isprimepower(n/2));

%Y Characteristic function of A278568 \ {2}.

%Y Cf. A069513, A174275, A211487, A354108.

%K nonn

%O 1

%A _Antti Karttunen_, Jun 15 2022