The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A248909 Completely multiplicative with a(p) = p if p = 6k+1 and a(p) = 1 otherwise. 6

%I

%S 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,

%T 1,1,7,1,37,19,13,1,1,7,43,1,1,1,1,1,49,1,1,13,1,1,1,7,19,1,1,1,61,31,

%U 7,1,13,1,67,1,1,7,1,1,73,37,1,19,7,13,79,1,1

%N Completely multiplicative with a(p) = p if p = 6k+1 and a(p) = 1 otherwise.

%C To compute a(n) replace primes not of the form 6k+1 in the prime factorization of n by 1.

%C The first place this sequence differs from A170824 is at n = 49.

%C For p prime, a(p) = p if p is a term in A002476 and a(p) = 1 if p = 2, p = 3 or p is a term in A007528.

%C a(n) is the largest term of A004611 that divides n. - _Peter Munn_, Mar 06 2021

%H Chai Wah Wu, <a href="/A248909/b248909.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Di#divseq">Index to divisibility sequences</a>

%F a(1) = 1; for n > 1, if A020639(n) = 1 (mod 6), a(n) = A020639(n) * a(A032742(n)), otherwise a(n) = a(A028234(n)). - _Antti Karttunen_, Jul 09 2017

%F a(n) = a(A065330(n)). - _Peter Munn_, Mar 06 2021

%e a(49) = 49 because 49 = 7^2 and 7 = 6*1 + 1.

%e a(15) = 1 because 15 = 3*5 and neither of these primes is of the form 6k+1.

%e a(62) = 31 because 62 = 31*2, 31 = 6*5 + 1, and 2 is not of the form 6k+1.

%p A248909 := proc(n)

%p local a,pf;

%p a := 1 ;

%p for pf in ifactors(n)[2] do

%p if modp(op(1,pf),6) = 1 then

%p a := a*op(1,pf)^op(2,pf) ;

%p end if;

%p end do:

%p a ;

%p end proc: # _R. J. Mathar_, Mar 14 2015

%t f[p_, e_] := If[Mod[p, 6] == 1, p^e, 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Sep 19 2020 *)

%o (Sage)

%o n=100; sixnplus1Primes=[x for x in primes_first_n(100) if (x-1)%6==0]

%o [prod([(x^(x in sixnplus1Primes))^y for x,y in factor(n)]) for n in [1..n]]

%o (PARI) a(n) = {my(f = factor(n)); for (i=1, #f~, if ((f[i,1] - 1) % 6, f[i, 1] = 1);); factorback(f);} \\ _Michel Marcus_, Mar 11 2015

%o (Python)

%o from sympy import factorint

%o def A248909(n):

%o y = 1

%o for p,e in factorint(n).items():

%o y *= (1 if (p-1) % 6 else p)**e

%o return y # _Chai Wah Wu_, Mar 15 2015

%o (Scheme) (define (A248909 n) (if (= 1 n) n (* (if (= 1 (modulo (A020639 n) 6)) (A020639 n) 1) (A248909 (A032742 n))))) ;; _Antti Karttunen_, Jul 09 2017

%Y Sequences used in a definition of this sequence: A002476, A004611, A007528, A020639, A028234, A032742.

%Y Cf. A065330, A170824.

%K nonn,mult,easy

%O 1,7

%A _Tom Edgar_, Mar 06 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified July 24 04:25 EDT 2021. Contains 346273 sequences. (Running on oeis4.)