login
Numerators of rational valued sequence whose Dirichlet convolution with itself yields A078898 (the ordinal transform of A020639, the smallest prime factor of n).
5

%I #15 Dec 19 2021 04:34:23

%S 1,1,1,7,1,5,1,25,7,9,1,31,1,13,5,363,1,55,1,55,7,21,1,101,7,25,33,79,

%T 1,41,1,1335,11,33,5,305,1,37,13,177,1,59,1,127,47,45,1,1371,7,175,17,

%U 151,1,309,7,253,19,57,1,187,1,61,67,9923,9,95,1,199,23,113,1,927,1,73,87,223,5,113,1,2379,715,81,1,265,11

%N Numerators of rational valued sequence whose Dirichlet convolution with itself yields A078898 (the ordinal transform of A020639, the smallest prime factor of n).

%C The first negative term is a(840) = -445.

%H Antti Karttunen, <a href="/A317833/b317833.txt">Table of n, a(n) for n = 1..16384</a>

%F a(n) = numerator of f(n), where f(1) = 1, f(n) = (1/2) * (A078898(n) - Sum_{d|n, d>1, d<n} f(d) * f(n/d)) for n > 1.

%t lpf[n_] := If[n == 1, 1, FactorInteger[n][[1, 1]]];

%t b[_] = 1;

%t A078898[n_] := A078898[n] = If[n == 0, 0, With[{t = lpf[n]}, b[t]++]];

%t f[n_] := f[n] = If[n == 1, 1, (1/2)(A078898[n] - Sum[If[1 < d < n, f[d]*f[n/d], 0], {d, Divisors[n]}])]

%t a[n_] := Numerator[f[n]];

%t Array[a, 100] (* _Jean-François Alcover_, Dec 19 2021 *)

%o (PARI)

%o up_to = 16384;

%o ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };

%o A020639(n) = if(n>1, if(n>n=factor(n, 0)[1, 1], n, factor(n)[1, 1]), 1); \\ From A020639

%o v078898 = ordinal_transform(vector(up_to,n,A020639(n)));

%o A078898(n) = v078898[n];

%o A317833aux(n) = if(1==n,n,(A078898(n)-sumdiv(n,d,if((d>1)&&(d<n),A317833aux(d)*A317833aux(n/d),0)))/2);

%o A317833(n) = numerator(A317833aux(n));

%Y Cf. A046644, A078898.

%Y Cf. also A305798, A305803, A305804, A317830, A317834.

%K sign,frac

%O 1,4

%A _Antti Karttunen_, Aug 10 2018