cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A357630 Skew-alternating sum of the prime indices of n.

Original entry on oeis.org

0, 1, 2, 0, 3, -1, 4, -1, 0, -2, 5, -2, 6, -3, -1, 0, 7, -3, 8, -3, -2, -4, 9, 1, 0, -5, -2, -4, 10, -4, 11, 1, -3, -6, -1, 0, 12, -7, -4, 2, 13, -5, 14, -5, -3, -8, 15, 2, 0, -5, -5, -6, 16, -1, -2, 3, -6, -9, 17, 1, 18, -10, -4, 0, -3, -6, 19, -7, -7, -6, 20
Offset: 1

Views

Author

Gus Wiseman, Oct 09 2022

Keywords

Comments

We define the skew-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.

Examples

			The prime indices of 525 are {2,3,3,4} so a(525) = 2 - 3 - 3 + 4 = 0.
		

Crossrefs

The original alternating sum is A316524, reverse A344616.
The reverse version is A357634.
The half-alternating form is A357629, reverse A357633.
Positions of zeros are A357632, reverse A357636.
The version for standard compositions is A357623, reverse A357624.
These partitions are counted by A357638, half A357637.
A056239 adds up prime indices, row sums of A112798.
A351005 = alternately equal and unequal partitions, compositions A357643.
A351006 = alternately unequal and equal partitions, compositions A357644.
A357641 counts comps w/ half-alt sum 0, partitions A357639, even A357642.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    skats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[(i+1)/2]),{i,Length[f]}];
    Table[skats[primeMS[n]],{n,30}]