login
Compound filter (for counting primes of form 4k+1, 4k+2 and 4k+3): a(n) = 4*A032742(n) + (A020639(n) mod 4), a(1) = 1.
7

%I #13 May 12 2017 18:21:19

%S 1,6,7,10,5,14,7,18,15,22,7,26,5,30,23,34,5,38,7,42,31,46,7,50,21,54,

%T 39,58,5,62,7,66,47,70,29,74,5,78,55,82,5,86,7,90,63,94,7,98,31,102,

%U 71,106,5,110,45,114,79,118,7,122,5,126,87,130,53,134,7,138,95,142,7,146,5,150,103,154,47,158,7,162,111,166,7,170,69,174,119,178,5,182,55

%N Compound filter (for counting primes of form 4k+1, 4k+2 and 4k+3): a(n) = 4*A032742(n) + (A020639(n) mod 4), a(1) = 1.

%C For all i, j: a(i) = a(j) => A079635(i) = A079635(j). This follows because A079635(n) can be computed by recursively invoking a(n), without needing any other information.

%H Antti Karttunen, <a href="/A286473/b286473.txt">Table of n, a(n) for n = 1..10000</a>

%F a(1) = 1, for n > 1, a(n) = 4*A032742(n) + (A020639(n) mod 4).

%t With[{k = 4}, Table[Function[{p, d}, k d + Mod[p, k] - k Boole[n == 1]] @@ {#, n/#} &@ FactorInteger[n][[1, 1]], {n, 91}]] (* _Michael De Vlieger_, May 12 2017 *)

%o (Scheme) (define (A286473 n) (if (= 1 n) n (+ (* 4 (A032742 n)) (modulo (A020639 n) 4))))

%o (Python)

%o from sympy import divisors, primefactors

%o def a(n): return 1 if n==1 else 4*divisors(n)[-2] + (min(primefactors(n))%4) # _Indranil Ghosh_, May 12 2017

%Y Cf. A020639, A032742, A285729, A286472, A286474, A286475, A286476.

%Y Cf. A001511, A007814, A065339, A079635, A083025 (some of the matched sequences).

%K nonn

%O 1,2

%A _Antti Karttunen_, May 11 2017