A286475 Compound filter (for counting primes of form 6k+1, 6k+2, 6k+3 and 6k+5): a(n) = 6*A032742(n) + (A020639(n) mod 6), a(1) = 1.
1, 8, 9, 14, 11, 20, 7, 26, 21, 32, 11, 38, 7, 44, 33, 50, 11, 56, 7, 62, 45, 68, 11, 74, 35, 80, 57, 86, 11, 92, 7, 98, 69, 104, 47, 110, 7, 116, 81, 122, 11, 128, 7, 134, 93, 140, 11, 146, 43, 152, 105, 158, 11, 164, 71, 170, 117, 176, 11, 182, 7, 188, 129, 194, 83, 200, 7, 206, 141, 212, 11, 218, 7, 224, 153, 230, 67, 236, 7, 242, 165, 248, 11, 254, 107
Offset: 1
Keywords
Examples
For n = 55 = 5*11, a(n) = 6*A032742(55) + (5 modulo 6) = 6*11 + 5 = 71. For n = 121 = 11*11, a(n) = 6*A032742(121) + (11 modulo 6) = 6*11 + 1 = 71. For n = 91 = 7*13, a(n) = 6*A032742(91) + (7 modulo 6) = 6*13 + 1 = 79. For n = 169 = 13*13, a(n) = 6*A032742(169) + (13 modulo 6) = 6*13 + 1 = 79.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
With[{k = 6}, Table[Function[{p, d}, k d + Mod[p, k] - k Boole[n == 1]] @@ {#, n/#} &@ FactorInteger[n][[1, 1]], {n, 85}]] (* Michael De Vlieger, May 12 2017 *)
-
Python
from sympy import divisors, primefactors def a(n): return 1 if n==1 else 6*divisors(n)[-2] +(min(primefactors(n))%6) # Indranil Ghosh, May 12 2017
-
Scheme
(define (A286475 n) (if (= 1 n) n (+ (* 6 (A032742 n)) (modulo (A020639 n) 6))))