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 if n is thrice a prime power congruent to 1 (mod 3), otherwise 0.
3

%I #9 Jun 16 2022 10:26:43

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

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

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

%N a(n) = 1 if n is thrice a prime power congruent to 1 (mod 3), otherwise 0.

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

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

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

%o (PARI) A354983(n) = ((3==(n%9)) && isprimepower(n/3));

%Y Characteristic function of A354984.

%Y Cf. A354982.

%K nonn

%O 1

%A _Antti Karttunen_, Jun 15 2022