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.

Showing 1-8 of 8 results.

A195017 If n = Product_{k >= 1} (p_k)^(c_k) where p_k is k-th prime and c_k >= 0 then a(n) = Sum_{k >= 1} c_k*((-1)^(k-1)).

Original entry on oeis.org

0, 1, -1, 2, 1, 0, -1, 3, -2, 2, 1, 1, -1, 0, 0, 4, 1, -1, -1, 3, -2, 2, 1, 2, 2, 0, -3, 1, -1, 1, 1, 5, 0, 2, 0, 0, -1, 0, -2, 4, 1, -1, -1, 3, -1, 2, 1, 3, -2, 3, 0, 1, -1, -2, 2, 2, -2, 0, 1, 2, -1, 2, -3, 6, 0, 1, 1, 3, 0, 1, -1, 1, 1, 0, 1, 1, 0, -1, -1, 5, -4, 2, 1, 0, 2, 0, -2, 4, -1, 0, -2, 3, 0, 2, 0, 4, 1, -1, -1, 4, -1, 1, 1, 2, -1
Offset: 1

Views

Author

Clark Kimberling, Feb 06 2012

Keywords

Comments

Let p(n,x) be the completely additive polynomial-valued function such that p(1,x) = 0 and p(prime(n),x) = x^(n-1), like is defined in A206284 (although here we are not limited to just irreducible polynomials). Then a(n) is the value of the polynomial encoded in such a manner by n, when it is evaluated at x=-1. - The original definition rewritten and clarified by Antti Karttunen, Oct 03 2018
Positions of 0 give the values of n for which the polynomial p(n,x) is divisible by x+1. For related sequences, see the Mathematica section.
Also the number of odd prime indices of n minus the number of even prime indices of n (both counted with multiplicity), where 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. - Gus Wiseman, Oct 24 2023

Examples

			The sequence can be read from a list of the polynomials:
  p(n,x)      with x = -1, gives a(n)
------------------------------------------
  p(1,x) = 0           0
  p(2,x) = 1x^0        1
  p(3,x) = x          -1
  p(4,x) = 2x^0        2
  p(5,x) = x^2         1
  p(6,x) = 1+x         0
  p(7,x) = x^3        -1
  p(8,x) = 3x^0        3
  p(9,x) = 2x         -2
  p(10,x) = x^2 + 1    2.
(The list runs through all the polynomials whose coefficients are nonnegative integers.)
		

Crossrefs

For other evaluation functions of such encoded polynomials, see A001222, A048675, A056239, A090880, A248663.
Zeros are A325698, distinct A325700.
For sum instead of count we have A366749 = A366531 - A366528.
A000009 counts partitions into odd parts, ranked by A066208.
A035363 counts partitions into even parts, ranked by A066207.
A112798 lists prime indices, reverse A296150, sum A056239.
A257991 counts odd prime indices, even A257992.
A300061 lists numbers with even sum of prime indices, odd A300063.

Programs

  • Mathematica
    b[n_] := Table[x^k, {k, 0, n}];
    f[n_] := f[n] = FactorInteger[n]; z = 200;
    t[n_, m_, k_] := If[PrimeQ[f[n][[m, 1]]] && f[n][[m, 1]]
    == Prime[k], f[n][[m, 2]], 0];
    u = Table[Apply[Plus,
        Table[Table[t[n, m, k], {k, 1, PrimePi[n]}], {m, 1,
          Length[f[n]]}]], {n, 1, z}];
    p[n_, x_] := u[[n]].b[-1 + Length[u[[n]]]]
    Table[p[n, x] /. x -> 0, {n, 1, z/2}]   (* A007814 *)
    Table[p[2 n, x] /. x -> 0, {n, 1, z/2}] (* A001511 *)
    Table[p[n, x] /. x -> 1, {n, 1, z}]     (* A001222 *)
    Table[p[n, x] /. x -> 2, {n, 1, z}]     (* A048675 *)
    Table[p[n, x] /. x -> 3, {n, 1, z}]     (* A090880 *)
    Table[p[n, x] /. x -> -1, {n, 1, z}]    (* A195017 *)
    z = 100; Sum[-(-1)^k IntegerExponent[Range[z], Prime[k]], {k, 1, PrimePi[z]}] (* Friedjof Tellkamp, Aug 05 2024 *)
  • PARI
    A195017(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * (-1)^(1+primepi(f[i,1])))); } \\ Antti Karttunen, Oct 03 2018

Formula

Totally additive with a(p^e) = e * (-1)^(1+PrimePi(p)), where PrimePi(n) = A000720(n). - Antti Karttunen, Oct 03 2018
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{p prime} = (-1)^(primepi(p)+1)/(p-1) = Sum_{k>=1} (-1)^(k+1)/A006093(k) = A078437 + Sum_{k>=1} (-1)^(k+1)/A036689(k) = 0.6339266524059... . - Amiram Eldar, Sep 29 2023
a(n) = A257991(n) - A257992(n). - Gus Wiseman, Oct 24 2023
a(n) = -Sum_{k=1..pi(n)} (-1)^k * valuation(n, prime(k)). - Friedjof Tellkamp, Aug 05 2024

Extensions

More terms, name changed and example-section edited by Antti Karttunen, Oct 03 2018

A380955 Sum of prime indices of n (with multiplicity) minus sum of distinct prime indices of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 2, 2, 0, 0, 1, 0, 0, 0, 3, 0, 2, 0, 1, 0, 0, 0, 2, 3, 0, 4, 1, 0, 0, 0, 4, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 1, 2, 0, 0, 3, 4, 3, 0, 1, 0, 4, 0, 2, 0, 0, 0, 1, 0, 0, 2, 5, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 3, 1, 0, 0, 0, 3, 6, 0, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Feb 11 2025

Keywords

Comments

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 96 are {1,1,1,1,1,2}, with sum 7, and with distinct prime indices {1,2}, with sum 3, so a(96) = 7 - 3 = 4.
		

Crossrefs

Positions of 0's are A005117, complement A013929.
For length instead of sum we have A046660.
Positions of 1's are A081770.
For factors instead of indices we have A280292, firsts A280286 (sorted A381075).
A multiplicative version is A290106.
Counting partitions by this statistic gives A364916.
Dominates A374248.
Positions of first appearances are A380956, sorted A380957.
For prime multiplicities instead of prime indices we have A380958.
For product instead of sum we have A380986.
A000040 lists the primes, differences A001223.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, length A001222.
A304038 lists distinct prime indices, sum A066328, length A001221.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Total[prix[n]]-Total[Union[prix[n]]],{n,100}]

Formula

a(n) = A056239(n) - A066328(n).
Additive: a(m*n) = a(m) + a(n) if gcd(m,n) = 1.

A380956 Position of first appearance of n in A380955 (sum of prime indices minus sum of distinct prime indices).

Original entry on oeis.org

1, 4, 8, 16, 27, 64, 81, 256, 243, 529, 729, 961, 1369, 1681, 1849, 2209, 2809, 3481, 3721, 4489, 5041, 5329, 6241, 6889, 7921, 9409, 10201, 10609, 11449, 11881, 12769, 16129, 17161, 18769, 19321, 22201, 22801, 24649, 26569, 27889, 29929, 32041, 32761, 36481
Offset: 0

Views

Author

Gus Wiseman, Feb 12 2025

Keywords

Comments

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.
Also the position of first appearance of n in A374248.

Examples

			The terms together with their prime indices begin:
     1: {}
     4: {1,1}
     8: {1,1,1}
    16: {1,1,1,1}
    27: {2,2,2}
    64: {1,1,1,1,1,1}
    81: {2,2,2,2}
   256: {1,1,1,1,1,1,1,1}
   243: {2,2,2,2,2}
   529: {9,9}
   729: {2,2,2,2,2,2}
   961: {11,11}
  1369: {12,12}
  1681: {13,13}
  1849: {14,14}
  2209: {15,15}
		

Crossrefs

For length instead of sum we have A151821.
For factors instead of indices we have A280286 (sorted A381075), firsts of A280292.
Counting partitions by this statistic gives A364916.
Positions of first appearances in A380955.
The sorted version is A380957.
For product instead of sum we have firsts of A380986.
A multiplicative version is A380987 (sorted A380988), firsts of A290106.
For prime multiplicities instead of prime indices we have A380989, firsts of A380958.
A000040 lists the primes, differences A001223.
A005117 lists squarefree numbers, complement A013929.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, length A001222.
A304038 lists distinct prime indices, sum A066328, length A001221.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    q=Table[Total[prix[n]]-Total[Union[prix[n]]],{n,1000}];
    Table[Position[q,k][[1,1]],{k,0,mnrm[q+1]-1}]

Formula

After a(12) = 961, this appears to converge to prime(n)^2.

A380957 Sorted positions of first appearances in A380955 (sum of prime indices minus sum of distinct prime indices).

Original entry on oeis.org

1, 4, 8, 16, 27, 64, 81, 243, 256, 529, 729, 961, 1369, 1681, 1849, 2209, 2809, 3481, 3721, 4489, 5041, 5329, 6241, 6889, 7921, 9409, 10201, 10609, 11449, 11881, 12769, 16129, 17161, 18769, 19321, 22201, 22801, 24649, 26569, 27889, 29929, 32041, 32761, 36481
Offset: 1

Views

Author

Gus Wiseman, Feb 13 2025

Keywords

Comments

Also appears to be sorted firsts of A374248.

Crossrefs

For length instead of sum we have A151821.
Counting partitions by this statistic (sum minus sum of distinct parts) gives A364916.
Sorted positions of first appearances in A380955.
The unsorted version is A380956.
For product instead of sum we have sorted firsts of A380986.
The multiplicative version is A380988, unsorted A380987, firsts of A290106.
For prime multiplicities instead of prime indices we have A380989, firsts of A380958.
For factors instead of indices we have A381075, see A280286, A280292.
A000040 lists the primes, differences A001223.
A005117 lists squarefree numbers, complement A013929.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, counted by A001222.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    q=Table[Total[prix[n]]-Total[Union[prix[n]]],{n,1000}];
    Select[Range[Length[q]],FreeQ[Take[q,#-1],q[[#]]]&]

A019507 Droll numbers: numbers > 1 whose sum of even prime factors equals the sum of odd prime factors.

Original entry on oeis.org

72, 240, 672, 800, 2240, 4224, 5184, 6272, 9984, 14080, 17280, 33280, 39424, 48384, 52224, 57600, 93184, 116736, 161280, 174080, 192000, 247808, 304128, 373248, 389120, 451584, 487424, 537600, 565248, 585728, 640000, 718848, 1013760, 1089536, 1244160, 1384448
Offset: 1

Views

Author

Mario Velucchi (mathchess(AT)velucchi.it)

Keywords

Examples

			6272 = 2*2*2*2*2*2*2*7*7 is droll since 2+2+2+2+2+2+2 = 14 = 7+7.
		

Crossrefs

For count instead of sum we have A072978.
Partitions of this type are counted by A239261, without zero terms A249914.
For prime indices instead of factors we have A366748, zeros of A366749.
The LHS is A366839 with alternating zeros, for indices A366531, triangle A113686.
The RHS is A366840, for indices A366528, triangle A113685.
A000009 counts partitions into odd parts, ranks A066208.
A035363 counts partitions into even parts, ranks A066207.
A112798 lists prime indices, length A001222, sum A056239.
A257991 counts odd prime indices, even A257992.
A300061 lists numbers with even sum of prime indices, odd A300063.

Programs

  • Maple
    f:= proc(k, m) # numbers whose sum of prime factors >= m is k; m is prime
       local S,p,j;
       option remember;
       if k = 0 then return [1]
       elif m > k then return []
       fi;
       S:= NULL:
       p:= nextprime(m);
       for j from k by -m to 0 do
         S:= S, op(map(`*`,  procname(j,p) , m^((k-j)/m)))
       od;
       [S]
    end proc:
    g:= proc(N) local m,R;
      R:= NULL;
      for m from 1 while 2^m < N do
       R:= R, op(map(`*`,select(`<=`,f(2*m,3), N/2^m),2^m));
      od;
      sort([R])
    end proc:
    g(10^8); # Robert Israel, Feb 20 2025
  • Mathematica
    Select[Range[2, 2*10^6, 2], First[#] == Total[Rest[#]] & [Times @@@ FactorInteger[#]] &] (* Paolo Xausa, Feb 19 2025 *)
  • PARI
    isok(n) = {if (n % 2, return (0)); f = factor(n); return (2*f[1,2] == sum(i=2, #f~, f[i,1]*f[i,2]));} \\ Michel Marcus, Jun 21 2013

Formula

These are even numbers k such that A366839(k/2) = A366840(k). - Gus Wiseman, Oct 25 2023 (corrected Feb 19 2025)

Extensions

Name edited by Paolo Xausa, Feb 19 2025

A366748 Numbers k such that (sum of odd prime indices of k) = (sum of even prime indices of k).

Original entry on oeis.org

1, 12, 70, 90, 112, 144, 286, 325, 462, 520, 525, 594, 646, 675, 832, 840, 1045, 1080, 1326, 1334, 1344, 1666, 1672, 1728, 1900, 2142, 2145, 2294, 2465, 2622, 2695, 2754, 3040, 3432, 3465, 3509, 3526, 3900, 3944, 4186, 4255, 4312, 4455, 4845, 4864, 4900, 4982
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2023

Keywords

Comments

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 terms together with their prime indices begin:
     1: {}
    12: {1,1,2}
    70: {1,3,4}
    90: {1,2,2,3}
   112: {1,1,1,1,4}
   144: {1,1,1,1,2,2}
   286: {1,5,6}
   325: {3,3,6}
   462: {1,2,4,5}
   520: {1,1,1,3,6}
   525: {2,3,3,4}
   594: {1,2,2,2,5}
   646: {1,7,8}
   675: {2,2,2,3,3}
   832: {1,1,1,1,1,1,6}
   840: {1,1,1,2,3,4}
For example, 525 has prime indices {2,3,3,4}, and 3+3 = 2+4, so 525 is in the sequence.
		

Crossrefs

For prime factors instead of indices we have A019507.
Partitions of this type are counted by A239261.
For count instead of sum we have A325698, distinct A325700.
The LHS (sum of odd prime indices) is A366528, triangle A113685.
The RHS (sum of even prime indices) is A366531, triangle A113686.
These are the positions of zeros in A366749.
A000009 counts partitions into odd parts, ranked by A066208.
A035363 counts partitions into even parts, ranked by A066207.
A112798 lists prime indices, reverse A296150, length A001222, sum A056239.
A257991 counts odd prime indices, even A257992.
A300061 lists numbers with even sum of prime indices, odd A300063.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n], {p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[1000], Total[Select[prix[#],OddQ]]==Total[Select[prix[#],EvenQ]]&]

Formula

These are numbers k such that A346697(k) = A346698(k).

A382331 If n = Product (p_j^k_j) then a(n) = -Sum ((-1)^k_j * p_j).

Original entry on oeis.org

0, 2, 3, -2, 5, 5, 7, 2, -3, 7, 11, 1, 13, 9, 8, -2, 17, -1, 19, 3, 10, 13, 23, 5, -5, 15, 3, 5, 29, 10, 31, 2, 14, 19, 12, -5, 37, 21, 16, 7, 41, 12, 43, 9, 2, 25, 47, 1, -7, -3, 20, 11, 53, 5, 16, 9, 22, 31, 59, 6, 61, 33, 4, -2, 18, 16, 67, 15, 26, 14, 71, -1, 73, 39, -2
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 22 2025

Keywords

Examples

			a(72) = a(2^3*3^2) = 2 - 3 = -1.
		

Crossrefs

Programs

  • Mathematica
    Join[{0}, Table[-Plus @@ ((-1)^#[[2]] #[[1]] & /@ FactorInteger[n]), {n, 2, 75}]]
  • PARI
    a(n) = my(f=factor(n)); -sum(i=1, #f~, (-1)^f[i,2]*f[i,1]); \\ Michel Marcus, Mar 22 2025

Formula

Additive with a(p^e) = (-1)^(e+1) * p.

A382477 If n = Product (p_j^k_j) then a(n) = -Sum ((-1)^k_j * k_j * p_j).

Original entry on oeis.org

0, 2, 3, -4, 5, 5, 7, 6, -6, 7, 11, -1, 13, 9, 8, -8, 17, -4, 19, 1, 10, 13, 23, 9, -10, 15, 9, 3, 29, 10, 31, 10, 14, 19, 12, -10, 37, 21, 16, 11, 41, 12, 43, 7, -1, 25, 47, -5, -14, -8, 20, 9, 53, 11, 16, 13, 22, 31, 59, 4, 61, 33, 1, -12, 18, 16, 67, 13, 26, 14, 71, 0, 73, 39, -7
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 10 2025

Keywords

Examples

			a(72) = a(2^3*3^2) = 3*2 - 2*3 = 0.
		

Crossrefs

Programs

  • Mathematica
    Join[{0}, Table[-Plus @@ ((-1)^#[[2]] #[[2]] #[[1]] & /@ FactorInteger[n]), {n, 2, 75}]]
  • PARI
    a(n) = my(f=factor(n)); -sum(k=1, #f~, (-1)^f[k,2]*f[k,2]*f[k,1]); \\ Michel Marcus, Apr 17 2025
Showing 1-8 of 8 results.