OFFSET
1,4
COMMENTS
LINKS
FORMULA
Instead of the equation for a(2n+1) above, we may write a(A003961(n)) = a(n). - Peter Munn, May 21 2022
Other identities. For all n >= 1, the following holds:
For all w >= 0, a(p_{i} * p_{j} * ... * p_{k}) = a(p_{i+w} * p_{j+w} * ... * p_{k+w}).
For all n >= 2, A001222(a(n)) = A001222(n)-1. [a(n) has one less prime factor than n. Thus each semiprime (A001358) is mapped to some prime (A000040), etc.]
a(n) = floor(A348717(n)/2). - Antti Karttunen, Apr 30 2022
If n has prime factorization Product_{i=1..k} prime(x_i), then a(n) = Product_{i=2..k} prime(x_k-x_1+1). The opposite version is A358195, prime indices A358172, even bisection A241916. - Gus Wiseman, Dec 29 2022
MATHEMATICA
a246277[n_Integer] := Module[{f, p, a064989, a},
f[x_] := Transpose@FactorInteger[x];
p[x_] := Which[
x == 1, 1,
x == 2, 1,
True, NextPrime[x, -1]];
a064989[x_] := Times @@ Power[p /@ First[f[x]], Last[f[x]]];
a[1] = 0;
a[x_] := If[EvenQ[x], x/2, NestWhile[a064989, x, OddQ]/2];
a/@Range[n]]; a246277[84] (* Michael De Vlieger, Dec 19 2014 *)
PROG
(PARI)
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
(PARI) A246277(n) = if(1==n, 0, my(f = factor(n), k = primepi(f[1, 1])-1); for (i=1, #f~, f[i, 1] = prime(primepi(f[i, 1])-k)); factorback(f)/2); \\ Antti Karttunen, Apr 30 2022
(Scheme) ;; two different variants, the second one employing memoizing definec-macro)
(Python)
from sympy import factorint, prevprime
from operator import mul
from functools import reduce
def a064989(n):
f=factorint(n)
return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])
def a(n): return 0 if n==1 else n//2 if n%2==0 else a(a064989(n))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
CROSSREFS
Positions of terms 1 .. 8 in this sequence are given by the following sequences: A000040, A001248, A006094, A030078, A090076, A251720, A090090, A030514.
Cf. A000040, A001222, A001358, A003961, A055396, A064989, A064216, A243055, A246272, A249810, A249820, A249735, A252463.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 21 2014
STATUS
editing