OFFSET
1,2
COMMENTS
We define the half-alternating sum of a sequence (A, B, C, D, E, F, G, ...) to be A + B - C - D + E + F - G - ...
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
If k is a term, then so is m^4 * k for any m >= 1. - Robert Israel, Oct 10 2023
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The terms together with their prime indices begin:
1: {}
12: {1,1,2}
16: {1,1,1,1}
30: {1,2,3}
63: {2,2,4}
70: {1,3,4}
81: {2,2,2,2}
108: {1,1,2,2,2}
154: {1,4,5}
165: {2,3,5}
192: {1,1,1,1,1,1,2}
256: {1,1,1,1,1,1,1,1}
273: {2,4,6}
286: {1,5,6}
300: {1,1,2,3,3}
MAPLE
f:= proc(n) local F, Q, i;
F:= sort(ifactors(n)[2], (s, t) -> s[1]<t[1]);
F:= map(t -> numtheory:-pi(t[1])$t[2], F);
Q:= [-1, 1, 1, -1];
add(Q[i mod 4 + 1]*F[i], i=1..nops(F))
end proc:
select(f=0, [$1..10000]); # Robert Israel, Oct 10 2023
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
halfats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[i/2]), {i, Length[f]}];
Select[Range[1000], halfats[primeMS[#]]==0&]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 09 2022
STATUS
approved