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-5 of 5 results.

A056239 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} k*c_k.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Aug 19 2000

Keywords

Comments

A pseudo-logarithmic function in the sense that a(b*c) = a(b)+a(c) and so a(b^c) = c*a(b) and f(n) = k^a(n) is a multiplicative function. [Cf. A248692 for example.] Essentially a function from the positive integers onto the partitions of the nonnegative integers (1->0, 2->1, 3->2, 4->1+1, 5->3, 6->1+2, etc.) so each value a(n) appears A000041(a(n)) times, first with the a(n)-th prime and last with the a(n)-th power of 2. Produces triangular numbers from primorials. - Henry Bottomley, Nov 22 2001
Michael Nyvang writes (May 08 2006) that the Danish composer Karl Aage Rasmussen discovered this sequence in the 1990's: it has excellent musical properties.
All A000041(a(n)) different n's with the same value a(n) are listed in row a(n) of triangle A215366. - Alois P. Heinz, Aug 09 2012
a(n) is the sum of the parts of the partition having Heinz number n. We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product_{j=1..r} (p_j-th prime) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436. Example: a(33) = 7 because the partition with Heinz number 33 = 3 * 11 is [2,5]. - Emeric Deutsch, May 19 2015

Examples

			a(12) = 1*2 + 2*1 = 4, since 12 = 2^2 *3^1 = (p_1)^2 *(p_2)^1.
		

Crossrefs

Programs

  • Haskell
    a056239 n = sum $ zipWith (*) (map a049084 $ a027748_row n) (a124010_row n)
    -- Reinhard Zumkeller, Apr 27 2013
    
  • Maple
    # To get 10000 terms. First make prime table: M:=10000; pl:=array(1..M); for i from 1 to M do pl[i]:=0; od: for i from 1 to M do if ithprime(i) > M then break; fi; pl[ithprime(i)]:=i; od:
    # Decode Maple's amazing syntax for factoring integers: g:=proc(n) local e,p,t1,t2,t3,i,j,k; global pl; t1:=ifactor(n); t2:=nops(t1); if t2 = 2 and whattype(t1) <> `*` then p:=op(1,op(1,t1)); e:=op(2,t1); t3:=pl[p]*e; else
    t3:=0; for i from 1 to t2 do j:=op(i,t1); if nops(j) = 1 then e:=1; p:=op(1,j); else e:=op(2,j); p:=op(1,op(1,j)); fi; t3:=t3+pl[p]*e; od: fi; t3; end; # N. J. A. Sloane, May 10 2006
    A056239 := proc(n) add( numtheory[pi](op(1,p))*op(2,p), p = ifactors(n)[2]) ; end proc: # R. J. Mathar, Apr 20 2010
    # alternative:
    with(numtheory): a := proc (n) local B: B := proc (n) local nn, j, m: nn := op(2, ifactors(n)): for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: add(B(n)[i], i = 1 .. nops(B(n))) end proc: seq(a(n), n = 1 .. 130); # Emeric Deutsch, May 19 2015
  • Mathematica
    a[1] = 0; a[2] = 1; a[p_?PrimeQ] := a[p] = PrimePi[p];
    a[n_] := a[n] = Total[#[[2]]*a[#[[1]]] & /@ FactorInteger[n]]; a /@ Range[91] (* Jean-François Alcover, May 19 2011 *)
    Table[Total[FactorInteger[n] /. {p_, c_} /; p > 0 :> PrimePi[p] c], {n, 91}] (* Michael De Vlieger, Jul 12 2017 *)
  • PARI
    A056239(n) = if(1==n,0,my(f=factor(n)); sum(i=1, #f~, f[i,2] * primepi(f[i,1]))); \\ Antti Karttunen, Oct 26 2014, edited Jan 13 2020
    
  • Python
    from sympy import primepi, factorint
    def A056239(n): return sum(primepi(p)*e for p, e in factorint(n).items()) # Chai Wah Wu, Jan 01 2023
  • Scheme
    (require 'factor) ;; Uses the function factor available in Aubrey Jaffer's SLIB Scheme library.
    (define (A056239 n) (apply + (map A049084 (factor n))))
    ;; Antti Karttunen, Oct 26 2014
    

Formula

Totally additive with a(p) = PrimePi(p), where PrimePi(n) = A000720(n).
a(n) = Sum_{k=1..A001221(n)} A049084(A027748(k))*A124010(k). - Reinhard Zumkeller, Apr 27 2013
From Antti Karttunen, Oct 11 2014: (Start)
a(n) = n - A178503(n).
a(n) = A161511(A156552(n)).
a(n) = A227183(A243354(n)).
For all n >= 0:
a(A002110(n)) = A000217(n). [Cf. Henry Bottomley's comment above.]
a(A005940(n+1)) = A161511(n).
a(A243353(n)) = A227183(n).
Also, for all n >= 1:
a(A241909(n)) = A243503(n).
a(A122111(n)) = a(n).
a(A242424(n)) = a(n).
A248692(n) = 2^a(n). (End)
a(n) < A329605(n), a(n) = A001222(A108951(n)), a(A329902(n)) = A112778(n). - Antti Karttunen, Jan 14 2020

A325276 Irregular triangle read by rows where row n is the omega-sequence of n!.

Original entry on oeis.org

1, 2, 2, 1, 4, 2, 2, 1, 5, 3, 2, 2, 1, 7, 3, 3, 1, 8, 4, 3, 2, 2, 1, 11, 4, 3, 2, 2, 1, 13, 4, 3, 2, 2, 1, 15, 4, 4, 1, 16, 5, 4, 2, 2, 1, 19, 5, 4, 2, 2, 1, 20, 6, 4, 2, 2, 1, 22, 6, 4, 2, 1, 24, 6, 5, 2, 2, 1, 28, 6, 5, 2, 2, 1, 29, 7, 5, 2, 2, 1
Offset: 0

Views

Author

Gus Wiseman, Apr 18 2019

Keywords

Comments

We define the omega-sequence of n (row n of A323023) to have length A323014(n) = adjusted frequency depth of n, and the k-th term is Omega(red^{k-1}(n)), where Omega = A001222 and red^{k} is the k-th functional iteration of red = A181819, defined by red(n = p^i*...*q^j) = prime(i)*...*prime(j) = product of primes indexed by the prime exponents of n. For example, we have 180 -> 18 -> 6 -> 4 -> 3, so the omega-sequence of 180 is (5,3,2,2,1).

Examples

			Triangle begins:
  {}
  {}
   1
   2  2  1
   4  2  2  1
   5  3  2  2  1
   7  3  3  1
   8  4  3  2  2  1
  11  4  3  2  2  1
  13  4  3  2  2  1
  15  4  4  1
  16  5  4  2  2  1
  19  5  4  2  2  1
  20  6  4  2  2  1
  22  6  4  2  1
  24  6  5  2  2  1
  28  6  5  2  2  1
  29  7  5  2  2  1
  32  7  5  2  2  1
  33  8  5  2  2  1
  36  8  5  2  2  1
  38  8  5  2  2  1
  40  8  6  2  2  1
  41  9  6  2  2  1
  45  9  6  2  2  1
  47  9  6  2  2  1
  49  9  6  3  2  2  1
  52  9  6  3  2  2  1
  55  9  6  3  2  2  1
  56 10  6  3  2  2  1
  59 10  6  3  2  2  1
		

Crossrefs

Row lengths are A325272. Row sums are A325274. Row n is row A325275(n) of A112798. Second-to-last column is A325273. Column k = 1 is A022559. Column k = 2 is A000720. Column k = 3 is A071626.
Omega-sequence statistics: A001222 (first omega), A001221 (second omega), A071625 (third omega), A323022 (fourth omega), A304465 (second-to-last omega), A182850 or A323014 (length/frequency depth), A325248 (Heinz number), A325249 (sum).

Programs

  • Mathematica
    omseq[n_Integer]:=If[n<=1,{},Total/@NestWhileList[Sort[Length/@Split[#]]&,Sort[Last/@FactorInteger[n]],Total[#]>1&]];
    Table[omseq[n!],{n,0,30}]

A382774 Number of ways to permute the prime indices of n! so that the run-lengths are all different.

Original entry on oeis.org

1, 1, 1, 0, 2, 0, 6, 0, 0, 0, 96, 0
Offset: 0

Views

Author

Gus Wiseman, Apr 09 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, sum A056239.

Examples

			The prime indices of 24 are {1,1,1,2}, with permutations (1,1,1,2) and (2,1,1,1), so a(4) = 2.
		

Crossrefs

For anti-run permutations we have A335407, see also A335125, A382858.
This is the restriction of A382771 to the factorials A000142, equal A382857.
A022559 counts prime indices of n!, sum A081401.
A044813 lists numbers whose binary expansion has distinct run-lengths, equal A140690.
A056239 adds up prime indices, row sums of A112798.
A098859 counts partitions with distinct multiplicities, ordered A242882.
A239455 counts Look-and-Say partitions, ranks A351294, conjugate A381432.
A328592 lists numbers whose binary form has distinct runs of ones, equal A164707.
A329738 counts compositions with equal run-lengths, ranks A353744.
A329739 counts compositions with distinct run-lengths, ranks A351596.
A351293 counts non-Look-and-Say partitions, ranks A351295, conjugate A381433.

Programs

  • Mathematica
    Table[Length[Select[Permutations[prix[n!]],UnsameQ@@Length/@Split[#]&]],{n,0,6}]

Formula

a(n) = A382771(n!).

A335860 Partial sums of A064097.

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 15, 18, 22, 26, 31, 35, 40, 45, 50, 54, 59, 64, 70, 75, 81, 87, 94, 99, 105, 111, 117, 123, 130, 136, 143, 148, 155, 161, 168, 174, 181, 188, 195, 201, 208, 215, 223, 230, 237, 245, 254, 260, 268, 275, 282, 289, 297, 304, 312, 319, 327, 335
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate@ Nest[Append[#1, #1[[#2 - #2/FactorInteger[#2][[1, 1]]]] + 1] & @@ {#, Length@ # + 1} &, {0}, 57]

Formula

a(n) = A064097(A000142(n)) = A064097(n!).
a(n) = A053044(n) + A335429(n).

A304066 a(n) = Sum_{k=1..n} k*floor(n/prime(k)).

Original entry on oeis.org

0, 1, 3, 4, 7, 10, 14, 15, 17, 21, 26, 29, 35, 40, 45, 46, 53, 56, 64, 68, 74, 80, 89, 92, 95, 102, 104, 109, 119, 125, 136, 137, 144, 152, 159, 162, 174, 183, 191, 195, 208, 215, 229, 235, 240, 250, 265, 268, 272, 276, 285, 292, 308, 311, 319, 324, 334, 345, 362, 368, 386, 398, 404, 405, 414
Offset: 1

Views

Author

Ilya Gutkovskiy, May 05 2018

Keywords

Comments

Partial sums of A066328.

Crossrefs

Programs

  • Maple
    seq(add(k*floor(n/ithprime(k)),k=1..n),n=1..65); # Paolo P. Lava, May 14 2018
  • Mathematica
    Table[Sum[k Floor[n/Prime[k]], {k, n}], {n, 65}]
    nmax = 65; Rest[CoefficientList[Series[1/(1 - x) Sum[k x^Prime[k]/(1 - x^Prime[k]), {k, 1, nmax}], {x, 0, nmax}], x]]
    a[n_] := Plus @@ (PrimePi[#[[1]]] & /@ FactorInteger[n]); a[1] = 0; Accumulate[Table[a[n], {n, 65}]]

Formula

G.f.: (1/(1 - x))*Sum_{k>=1} k*x^prime(k)/(1 - x^prime(k)).
a(p^k) = a(p^k-1) + pi(p), where p is a prime and pi() = A000720.
a(n) = A056239(A048803(n)).
Showing 1-5 of 5 results.