A170824 a(n) = product of distinct primes of form 6k+1 that divide n.
1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 13, 7, 1, 1, 1, 1, 19, 1, 7, 1, 1, 1, 1, 13, 1, 7, 1, 1, 31, 1, 1, 1, 7, 1, 37, 19, 13, 1, 1, 7, 43, 1, 1, 1, 1, 1, 7, 1, 1, 13, 1, 1, 1, 7, 19, 1, 1, 1, 61, 31, 7, 1, 13, 1, 67, 1, 1, 7, 1, 1, 73, 37, 1, 19, 7, 13, 79, 1, 1, 1, 1, 7, 1, 43, 1, 1, 1, 1, 91, 1, 31, 1
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10001
Crossrefs
Programs
-
Maple
A170824 := proc(n) a := 1 ; for p in numtheory[factorset](n) do if p mod 6 = 1 then a := a*p ; end if ; end do ; a ; end proc: A140213 := proc(n) a := 1 ; for p in numtheory[divisors](n) do if p mod 6 = 1 then a := a*p ; end if ; end do ; a ; end proc: seq(A170824(n),n=1..120) ; # R. J. Mathar, Jan 21 2010
-
Mathematica
test[p_] := IntegerQ[(p - 1)/6]; a[n_]:= Module[{aux = FactorInteger[n]}, Product[If[test[aux[[i, 1]]],aux[[i, 1]],1],{i, Length[aux]}]]; Table[a[n], {i, 1, 200}] (* Jose Grau, Feb 16 2010 *) Table[Times@@Select[Transpose[FactorInteger[n]][[1]],IntegerQ[(#-1)/6]&],{n,100}] (* Harvey P. Dale, Jul 29 2013 *)
-
PARI
a(n) = my(f=factor(n)); prod(k=1, #f~, if (((p=f[k,1])%6) == 1, p, 1)); \\ Michel Marcus, Jul 10 2017
-
Scheme
(define (A170824 n) (if (= 1 n) n (* (if (= 1 (modulo (A020639 n) 6)) (A020639 n) 1) (A170824 (A028234 n))))) ;; Antti Karttunen, Jul 09 2017
Formula
a(1) = 1; for n > 1, if A020639(n) = 1 (mod 6), a(n) = A020639(n) * a(A028234(n)), otherwise a(n) = a(A028234(n)). - Antti Karttunen, Jul 09 2017
Extensions
More terms from R. J. Mathar, Jan 21 2010