login
Perform one x^2 -> x+1 reduction for the polynomial with nonnegative integer coefficients that is encoded in the prime factorization of n.
6

%I #23 Dec 01 2022 11:01:15

%S 1,2,3,4,6,6,15,8,9,12,35,12,77,30,18,16,143,18,221,24,45,70,323,24,

%T 36,154,27,60,437,36,667,32,105,286,90,36,899,442,231,48,1147,90,1517,

%U 140,54,646,1763,48,225,72,429,308,2021,54,210,120,663,874,2491,72,3127,1334,135,64,462,210,3599,572,969,180,4087,72

%N Perform one x^2 -> x+1 reduction for the polynomial with nonnegative integer coefficients that is encoded in the prime factorization of n.

%C Completely multiplicative with a(2) = 2, a(3) = 3, a(prime(k)) = prime(k-1) * prime(k-2) for k > 2. - _Andrew Howroyd_ & _Antti Karttunen_, Aug 04 2018

%H Antti Karttunen, <a href="/A265398/b265398.txt">Table of n, a(n) for n = 1..10080</a>

%F a(1) = 1; for n > 1, a(n) = A064989(A064989(A065330(n))) * A064989(A065330(n)) * A065331(n).

%F Sum_{k=1..n} a(k) = c * n^3, where c = (1/3) * Product_{p prime} (p^3-p^2)/(p^3-a(p)) = 0.093529982... . - _Amiram Eldar_, Dec 01 2022

%t a[n_] := a[n] = Module[{k, p, e}, Which[n<4, n, PrimeQ[n], k = PrimePi[n]; Prime[k-1] Prime[k-2], True, Product[{p, e} = pe; a[p]^e, {pe, FactorInteger[n]}]]];

%t a /@ Range[1, 72] (* _Jean-François Alcover_, Sep 20 2019 *)

%t f[p_, e_] := If[p < 5, p, NextPrime[p,-1]*NextPrime[p,-2]]^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Dec 01 2022 *)

%o (PARI)

%o A065330(n) = { while(0 == (n%2), n = n/2); while(0 == (n%3), n = n/3); n; }

%o A065331 = n -> n/A065330(n);

%o 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)};

%o A265398(n) = { my(a); if(1 == n, n, a = A064989(A065330(n)); A064989(a)*a*A065331(n)); };

%o (PARI) r(p) = {my(q = precprime(p-1)); q*precprime(q-1)};

%o a(n) = {my(f=factor(n)); prod(i=1, #f~, if(f[i,1]<5, f[i,1], r(f[i,1]))^f[i,2])}; \\ _Amiram Eldar_, Dec 01 2022

%o (Scheme)

%o (definec (A265398 n) (if (= 1 n) n (* (A065331 n) (A064989 (A065330 n)) (A064989 (A064989 (A065330 n))))))

%Y Cf. A064989, A065330, A065331.

%Y Cf. also A192232, A206296, A265399.

%K nonn,mult

%O 1,2

%A _Antti Karttunen_, Dec 15 2015

%E Keyword mult added by _Antti Karttunen_, Aug 04 2018