%I #66 Nov 10 2025 02:36:56
%S 1,8,27,8,125,259,343,8,27,1111,1331,259,2197,2955,3616,8,4913,259,
%T 6859,1111,9724,11155,12167,259,125,18279,27,2955,24389,37300,29791,8,
%U 37060,40495,44136,259,50653,56355,60880,1111,68921,98238,79507,11155,3616,99499
%N a(n) is the arithmetic mean of all multiplicative arithmetic functions f(n) with f(p^e) returning a monic degree 3 Littlewood polynomial of p.
%C The eight monic degree 3 Littlewood polynomials are x^3+x^2+x+1, x^3+x^2+x-1, x^3+x^2-x+1, x^3+x^2-x-1, x^3-x^2+x+1, x^3-x^2+x-1, x^3-x^2-x+1, and x^3-x^2-x-1.
%C The sum of these functions is always divisible by 8, so a(n) is always an integer.
%C a(n) is not multiplicative, however all of the involved functions are.
%C Where a(n) sums over degree 3 polynomials, A389978(n) sums over degree 2.
%H Aloe Poliszuk, <a href="/A386704/b386704.txt">Table of n, a(n) for n = 1..10000</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Littlewood_polynomial">Littlewood polynomial</a>.
%F Since the multiplicity of all involved sequences does not involve the exponent e, a(n) = a(rad(n)), where rad = A007947.
%F a(p) = p^3 for prime p.
%F a(p1*p2) = (p1*p2)^3 + (p1*p2)^2 + p1*p2 + 1 for primes p1,p2.
%F Sum_{k=1..n} a(k) ~ c * n^4, where c = (1 + zeta(4) * (Product_{p prime} (1 - 2/p^2 - 1/p^4 + 2/p^5) + Product_{p prime} (1 - 2/p^2 + 1/p^4) + Product_{p prime} (1 - 2/p^2 + 2/p^3 - 3/p^4 + 2/p^5) + Product_{p prime} (1 - 2/p^2 + 2/p^3 - 1/p^4) + Product_{p prime} (1 - 2/p^3 - 1/p^4 + 2/p^5) + Product_{p prime} (1 - 2/p^3 + 1/p^4) + Product_{p prime} (1 - 3/p^4 + 2/p^5))) / 32 = 0.16245695613418854481... . - _Amiram Eldar_, Nov 04 2025
%e a(2) = (15 + 13 + 11 + 9 + 7 + 5 + 3 + 1) / 8 = 8.
%t f[p_, e_] := (Prepend[#, 1].{p^3, p^2, p, 1}) & /@ Tuples[{-1, 1}, 3]; a[1] = 1; a[n_] := Total[Times @@ f @@@ FactorInteger[n]] / 8; Array[a, 50] (* _Amiram Eldar_, Nov 04 2025 *)
%o (PARI)
%o part(S,ind,k) = prod(X=1,#S,S[X]^k + sum(Y=0,k-1,(-1)^(ind\(2^Y))*S[X]^Y));
%o seq(n,m) = my(fac=factorint(n)); sum(Z=1,2^m,part(fac[,1],Z,m))/(2^m);
%o a(n) = seq(n,3);
%o (Python)
%o from itertools import product
%o from math import prod
%o from sympy import primefactors
%o def A386704(n):
%o pf = primefactors(n)
%o return sum(prod(p*(p*(p+a)+b)+c for p in pf) for a, b, c in product((-1,1),repeat=3))>>3 # _Chai Wah Wu_, Nov 09 2025
%Y Cf. A007947 (rad), A389978.
%Y Related polynomials: A053698, A155120, A100109, A152619, A188377, A062158, A152618, A083074.
%K nonn
%O 1,2
%A _Aloe Poliszuk_, Oct 30 2025