A286473 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.
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, 39, 58, 5, 62, 7, 66, 47, 70, 29, 74, 5, 78, 55, 82, 5, 86, 7, 90, 63, 94, 7, 98, 31, 102, 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
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
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 *)
-
Python
from sympy import divisors, primefactors def a(n): return 1 if n==1 else 4*divisors(n)[-2] + (min(primefactors(n))%4) # Indranil Ghosh, May 12 2017
-
Scheme
(define (A286473 n) (if (= 1 n) n (+ (* 4 (A032742 n)) (modulo (A020639 n) 4))))
Comments