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

A239261 Number of partitions of n having (sum of odd parts) = (sum of even parts).

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 12, 0, 0, 0, 30, 0, 0, 0, 70, 0, 0, 0, 165, 0, 0, 0, 330, 0, 0, 0, 704, 0, 0, 0, 1380, 0, 0, 0, 2688, 0, 0, 0, 4984, 0, 0, 0, 9394, 0, 0, 0, 16665, 0, 0, 0, 29970, 0, 0, 0, 52096, 0, 0, 0, 90090, 0, 0, 0, 152064, 0, 0, 0
Offset: 0

Views

Author

Clark Kimberling, Mar 13 2014

Keywords

Examples

			a(8) counts these 4 partitions:  431, 41111, 3221, 221111.
From _Gus Wiseman_, Oct 24 2023: (Start)
The a(0) = 1 through a(12) = 12 partitions:
  ()  .  .  .  (211)  .  .  .  (431)     .  .  .  (633)
                               (3221)             (651)
                               (41111)            (4332)
                               (221111)           (5421)
                                                  (33222)
                                                  (52221)
                                                  (63111)
                                                  (432111)
                                                  (3222111)
                                                  (6111111)
                                                  (42111111)
                                                  (222111111)
(End)
		

Crossrefs

The LHS (sum of odd parts) is counted by A113685.
The RHS (sum of even parts) is counted by A113686.
Without all the zeros we have a(4n) = A249914(n).
The strict case (without zeros) is A255001.
The Heinz numbers of these partitions are A366748, see also A019507.
A000009 counts partitions into odd parts, ranks A066208.
A035363 counts partitions into even parts, ranks A066207.

Programs

  • Mathematica
    z = 40; p[n_] := p[n] = IntegerPartitions[n]; f[t_] := f[t] = Length[t]
    t1 = Table[f[Select[p[n], 2 Total[Select[#, OddQ]] < n &]], {n, z}] (* A239259 *)
    t2 = Table[f[Select[p[n], 2 Total[Select[#, OddQ]] <= n &]], {n, z}] (* A239260 *)
    t3 = Table[f[Select[p[n], 2 Total[Select[#, OddQ]] == n &]], {n, z}] (* A239261 *)
    t4 = Table[f[Select[p[n], 2 Total[Select[#, OddQ]] > n &]], {n, z}] (* A239262 *)
    t5 = Table[f[Select[p[n], 2 Total[Select[#, OddQ]] >= n &]], {n, z}] (* A239263 *)
    (* Peter J. C. Moses, Mar 12 2014 *)

Formula

A239260(n) + a(n) + A239262(n) = A000041(n).
From David A. Corneth, Oct 25 2023: (Start)
a(4*n) = A000009(2*n) * A000041(n) for n >= 0.
a(4*n + r) = 0 for n >= 0 and r in {1, 2, 3}. (End)

Extensions

More terms from Alois P. Heinz, Mar 15 2014

A366749 Self-signed alternating sum of the prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 23 2023

Keywords

Comments

We define the self-signed alternating sum of a multiset y to be Sum_{k in y} k*(-1)^k.
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.

Crossrefs

With summands of 2^(n-1) we get A048675.
With summands of (-1)^k we get A195017.
The version for alternating prime indices is A346697 - A346698 = A316524.
Positions of zeros are A366748, counted by A239261.
A112798 lists prime indices, length A001222, sum A056239, reverse A296150.
A300061 lists numbers with even sum of prime indices, odd A300063.
A366528 adds up odd prime indices, counted by A113685.
A366531 adds up even prime indices, counted by A113686.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    asum[y_]:=Sum[x*(-1)^x,{x,y}];
    Table[asum[prix[n]],{n,100}]

Formula

a(n) = Sum_{k in A112798(n)} k*(-1)^k.
a(n) = A366531(n) - A366528(n).

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).

A046385 Smallest palindrome with exactly n palindromic prime factors (counted with multiplicity), and no other prime factors.

Original entry on oeis.org

1, 2, 4, 8, 88, 252, 2772, 82728, 2112, 4224, 8448, 236989632, 48384, 2977792
Offset: 0

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Comments

Initial terms of sequences A046376-A046384.
Note that 48384 (k=12) is a 'Droll' number: see A019507.
There are 3 more known terms: a(15)=405504, a(16)=40955904, a(20)=677707776. Any other terms would have at least 18 decimal digits. Conjecture: The sequence is finite and has no other terms than those shown here. - Hugo Pfoertner, Aug 13 2019

Examples

			a(7) = 82728 because it is the smallest palindrome with 7 palindromic and no other prime factors: 82728 = 2^3 * 3^3 * 383. If other prime factors are not excluded, A309565(7) = 29792 =  2^5 * 7^2 * 19 also has exactly 7 palindromic factors and the additional factor 19.
		

Crossrefs

Cf. A309565 (additional non-palindromic prime factors allowed).

Programs

  • PARI
    is_A002113(n)={Vecrev(n=digits(n))==n}; \\ M. F. Hasler in A002113
    arepalf(nf,x)={forstep(j=nf,1,-1,if(is_A002113(x[j,1]),,return(0)));return(1)};
    md=[0,1,2,3,4,5,6,7,8,9]; \\ Middle digits in odd length palindromes
    a=vector(64);a[1]=2;a[2]=4;a[3]=8;
    for(d=2,11,print("Digits: ",d);if(d%2==0,for(k=10^((d-2)/2),10*10^((d-2)/2)-1,my(dv=digits(k));P=fromdigits(concat(dv,Vecrev(dv)));x=factor(P);bigom=vecsum(x[,2]);nf=#x[,2];for(j=1,#a,if(a[j],,if(j==bigom,if(arepalf(nf,x),print("a(",j,")=",a[j]=P)))))),for(k=10^((d-3)/2),10*10^((d-3)/2)-1,my(dv=digits(k));for(m=1,10,P=fromdigits(concat(concat(dv,md[m]),Vecrev(dv)));x=factor(P);bigom=vecsum(x[,2]);nf=#x[,2];for(j=1,#a,if(a[j],,if(j==bigom,if(arepalf(nf,x),print("a(",j,")=",a[j]=P)))))))));a \\ Hugo Pfoertner, Aug 13 2019

Extensions

Definition clarified by Hugo Pfoertner, Aug 08 2019

A366839 Sum of even prime factors of 2n, counted with multiplicity.

Original entry on oeis.org

2, 4, 2, 6, 2, 4, 2, 8, 2, 4, 2, 6, 2, 4, 2, 10, 2, 4, 2, 6, 2, 4, 2, 8, 2, 4, 2, 6, 2, 4, 2, 12, 2, 4, 2, 6, 2, 4, 2, 8, 2, 4, 2, 6, 2, 4, 2, 10, 2, 4, 2, 6, 2, 4, 2, 8, 2, 4, 2, 6, 2, 4, 2, 14, 2, 4, 2, 6, 2, 4, 2, 8, 2, 4, 2, 6, 2, 4, 2, 10, 2, 4, 2, 6, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2023

Keywords

Examples

			The prime factors of 2*60 are {2,2,2,3,5}, of which the even factors are {2,2,2}, so a(60) = 6.
		

Crossrefs

A compound version is A001414, triangle A331416.
Dividing by 2 gives A001511.
Positions of 2's are A005408.
For count instead of sum we have A007814, odd version A087436.
The partition triangle for this statistic is A116598 aerated.
For indices we have A366531, halved A366533, triangle A113686/A174713.
The odd version is A366840.
A019507 lists numbers with (even factor sum) = (odd factor sum).
A066207 lists numbers with all even prime indices, counted by A035363.
A112798 lists prime indices, reverse A296150, length A001222, sum A056239.
A162641 counts even prime exponents, odd A162642.
A239261 counts partitions with (sum of odd parts) = (sum of even parts).
A257992 counts even prime indices, odd A257991.
A366528 adds up odd prime indices, triangle A113685 (without zeros A365067).

Programs

  • Mathematica
    Table[2*Length[NestWhileList[#/2&,n,EvenQ]],{n,100}]
  • PARI
    a(n) = 2 * valuation(n, 2) + 2; \\ Amiram Eldar, Sep 13 2024

Formula

a(n) = 2*A001511(n).
a(n) = A100006(n) - A366840(2n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 4. - Amiram Eldar, Sep 13 2024

A366840 Sum of odd prime factors of n, counted with multiplicity.

Original entry on oeis.org

0, 0, 3, 0, 5, 3, 7, 0, 6, 5, 11, 3, 13, 7, 8, 0, 17, 6, 19, 5, 10, 11, 23, 3, 10, 13, 9, 7, 29, 8, 31, 0, 14, 17, 12, 6, 37, 19, 16, 5, 41, 10, 43, 11, 11, 23, 47, 3, 14, 10, 20, 13, 53, 9, 16, 7, 22, 29, 59, 8, 61, 31, 13, 0, 18, 14, 67, 17, 26, 12, 71, 6
Offset: 1

Views

Author

Gus Wiseman, Oct 27 2023

Keywords

Comments

Contains all positive integers except 1, 2, 4.

Examples

			The prime factors of 60 are {2,2,2,3,5}, of which the odd factors are {3,5}, so a(60) = 8.
		

Crossrefs

The compound version is A001414, triangle A331416.
For count instead of sum we have A087436, even version A007814.
Odd-indexed terms are A100005.
Positions of odd terms are A335657, even A036349.
For prime indices we have A366528, triangle A113685 (without zeros A365067)
The even version is A366839 = 2*A001511.
The partition triangle for this statistic is A366851, even version A116598.
A019507 lists numbers with (even factor sum) = (odd factor sum).
A066207 lists numbers with all even prime indices, counted by A035363.
A112798 lists prime indices, reverse A296150, length A001222, sum A056239.
A162641 counts even prime exponents, odd A162642.
A239261 counts partitions with (sum of odd parts) = (sum of even parts).
A257992 counts even prime indices, odd A257991.

Programs

  • Mathematica
    Table[Total[Times@@@DeleteCases[If[n==1,{}, FactorInteger[n]],{2,_}]],{n,100}]
  • PARI
    a(n) = my(f=factor(n), j=if(n%2, 1, 2)); sum(i=j, #f~, f[i,1]*f[i,2]); \\ Michel Marcus, Oct 30 2023

Formula

a(n) = A100006(n) - A366839(n).
a(2n) = a(n).
a(2n-1) = A001414(2n-1) = A100005(n).
Completely additive with a(2^e) = 0 and a(p^e) = e*p for an odd prime p. - Amiram Eldar, Nov 03 2023

A366841 Least positive integer whose odd prime factors sum to n, starting with n = 5.

Original entry on oeis.org

5, 9, 7, 15, 27, 21, 11, 35, 13, 33, 105, 39, 17, 65, 19, 51, 195, 57, 23, 95, 171, 69, 285, 115, 29, 161, 31, 87, 483, 93, 261, 155, 37, 217, 465, 111, 41, 185, 43, 123, 555, 129, 47, 215, 387, 141, 645, 235, 53, 329, 705, 159, 987, 265, 59, 371, 61, 177
Offset: 5

Views

Author

Gus Wiseman, Oct 27 2023

Keywords

Comments

All terms are odd.
It seems that all composite terms not divisible by 3 form a supersequence of A292081. - Ivan N. Ianakiev, Oct 30 2023

Examples

			The terms together with their prime factors (which sum to n) begin:
    5 = 5
    9 = 3*3
    7 = 7
   15 = 3*5
   27 = 3*3*3
   21 = 3*7
   11 = 11
   35 = 5*7
   13 = 13
   33 = 3*11
  105 = 3*5*7
		

Crossrefs

This is the odd case of A056240.
Positions of first appearances in A366840 (sum of odd prime factors).
The partition triangle for this statistic is A366851, even A116598.
A001414 adds up prime factors, triangle A331416.
A019507 lists numbers with (even factor sum) = (odd factor sum).
A027746 lists prime factors, length A001222.
A087436 counts odd prime factors, even A007814.
A366528 adds up odd prime indices, triangle A113685 (without zeros A365067).

Programs

  • Mathematica
    nn=1000;
    w=Table[Total[Times@@@DeleteCases[If[n==1,{},FactorInteger[n]],{2,_}]],{n,nn}];
    spnm[y_]:=Max@@Select[Union[y],Function[i,Union[Select[y,#<=i&]]==Range[i]]];
    Table[Position[w,k][[1,1]],{k,5,spnm[Join[{1,2,3,4},Take[w,nn]/.(0->1)]]}]
  • PARI
    f(n) = my(f=factor(n), j=if (n%2, 1, 2)); sum(i=j, #f~, f[i,1]*f[i,2]); \\ A366840
    a(n) = my(k=1); while (f(k) != n, k++); k; \\ Michel Marcus, Nov 02 2023
Showing 1-8 of 8 results.