A003961 Completely multiplicative with a(prime(k)) = prime(k+1).
Examples
a(12) = a(2^2 * 3) = a(prime(1)^2 * prime(2)) = prime(2)^2 * prime(3) = 3^2 * 5 = 45. a(A002110(n)) = A002110(n + 1) / 2.
References
- Richard K. Guy, editor, Problems From Western Number Theory Conferences, Labor Day, 1983, Problem 367 (Proposed by Leroy F. Meyers, The Ohio State U.).
Links
- Indranil Ghosh, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
- Index entries for sequences computed from indices in prime factorization.
- Index entries for sequences related to Heinz numbers.
Crossrefs
Programs
-
Haskell
a003961 1 = 1 a003961 n = product $ map (a000040 . (+ 1) . a049084) $ a027746_row n -- Reinhard Zumkeller, Apr 09 2012, Oct 09 2011 (MIT/GNU Scheme, with Aubrey Jaffer's SLIB Scheme library) (require 'factor) (define (A003961 n) (apply * (map A000040 (map 1+ (map A049084 (factor n)))))) ;; Antti Karttunen, May 20 2014
-
Maple
a:= n-> mul(nextprime(i[1])^i[2], i=ifactors(n)[2]): seq(a(n), n=1..80); # Alois P. Heinz, Sep 13 2017
-
Mathematica
a[p_?PrimeQ] := a[p] = Prime[ PrimePi[p] + 1]; a[1] = 1; a[n_] := a[n] = Times @@ (a[#1]^#2& @@@ FactorInteger[n]); Table[a[n], {n, 1, 65}] (* Jean-François Alcover, Dec 01 2011, updated Sep 20 2019 *) Table[Times @@ Map[#1^#2 & @@ # &, FactorInteger[n] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[n == 1], {n, 65}] (* Michael De Vlieger, Mar 24 2017 *)
-
PARI
a(n)=local(f); if(n<1,0,f=factor(n); prod(k=1,matsize(f)[1],nextprime(1+f[k,1])^f[k,2]))
-
PARI
a(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Michel Marcus, May 17 2014
-
Perl
use ntheory ":all"; sub a003961 { vecprod(map { next_prime($) } factor(shift)); } # _Dana Jacobsen, Mar 06 2016
-
Python
from sympy import factorint, prime, primepi, prod def a(n): f=factorint(n) return 1 if n==1 else prod(prime(primepi(i) + 1)**f[i] for i in f) [a(n) for n in range(1, 11)] # Indranil Ghosh, May 13 2017
Comments