|
|
A248909
|
|
Completely multiplicative with a(p) = p if p = 6k+1 and a(p) = 1 otherwise.
|
|
6
|
|
|
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, 49, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,7
|
|
COMMENTS
|
To compute a(n) replace primes not of the form 6k+1 in the prime factorization of n by 1.
The first place this sequence differs from A170824 is at n = 49.
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.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(49) = 49 because 49 = 7^2 and 7 = 6*1 + 1.
a(15) = 1 because 15 = 3*5 and neither of these primes is of the form 6k+1.
a(62) = 31 because 62 = 31*2, 31 = 6*5 + 1, and 2 is not of the form 6k+1.
|
|
MAPLE
|
local a, pf;
a := 1 ;
for pf in ifactors(n)[2] do
if modp(op(1, pf), 6) = 1 then
a := a*op(1, pf)^op(2, pf) ;
end if;
end do:
a ;
|
|
MATHEMATICA
|
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 *)
|
|
PROG
|
(Sage)
n=100; sixnplus1Primes=[x for x in primes_first_n(100) if (x-1)%6==0]
[prod([(x^(x in sixnplus1Primes))^y for x, y in factor(n)]) for n in [1..n]]
(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
(Python)
from sympy import factorint
y = 1
for p, e in factorint(n).items():
y *= (1 if (p-1) % 6 else p)**e
|
|
CROSSREFS
|
Equivalent sequence for distinct prime factors: A170824.
|
|
KEYWORD
|
nonn,mult,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|