login
Completely multiplicative function with a(prime(k)) = prime(k)*prime(k-1), a(2) = 2.
3

%I #20 Jan 07 2023 04:00:49

%S 1,2,6,4,15,12,35,8,36,30,77,24,143,70,90,16,221,72,323,60,210,154,

%T 437,48,225,286,216,140,667,180,899,32,462,442,525,144,1147,646,858,

%U 120,1517,420,1763,308,540,874,2021,96,1225,450,1326,572,2491,432,1155,280,1938

%N Completely multiplicative function with a(prime(k)) = prime(k)*prime(k-1), a(2) = 2.

%H Antti Karttunen, <a href="/A200746/b200746.txt">Table of n, a(n) for n = 1..10000</a>

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

%F a(n) = n * A064989(n).

%F Sum_{n>=1} 1/a(n) = 2/Product_{k>=1} (1 - 1/(prime(k)*prime(k+1))) = 2.75321091... . - _Amiram Eldar_, Jan 07 2023

%t a200746[n_Integer] := Block[{f, p, a},

%t f[x_] := Transpose@FactorInteger[x];

%t p[x_] := Which[

%t x == 1, 1,

%t x == 2, 2,

%t True, x NextPrime[x, -1]];

%t a[x_] := Times @@ Power[p /@ First[f[x]], Last[f[x]]];

%t a /@ Range[n]]; a200746[57] (* _Michael De Vlieger_, Dec 19 2014 *)

%o (PARI) a(n)=local(fm=factor(n));prod(k=1,matsize(fm)[1],(fm[k,1]*if(fm[k,1]==2,1,precprime(fm[k,1]-1)))^fm[k,2])

%o (Scheme, with memoization-macro definec) (definec (A200746 n) (if (<= n 2) n (* n (A064989 n)))) ;; _Antti Karttunen_, Dec 18 2014

%Y Cf. A064989, A108951, A191002.

%K nonn,mult,look

%O 1,2

%A _Franklin T. Adams-Watters_, Nov 25 2011