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.

A249072 Sum of prime indices in the prime factorization of A249337(n), counted with multiplicity: a(n) = A056239(A249337(n)).

Original entry on oeis.org

0, 1, 0, 1, 1, 2, 0, 2, 1, 2, 2, 2, 3, 0, 2, 3, 1, 3, 2, 4, 0, 3, 2, 3, 3, 3, 4, 1, 3, 3, 4, 2, 4, 2, 4, 3, 4, 3, 5, 0, 3, 4, 4, 3, 6, 0, 4, 4, 4, 5, 1, 4, 4, 6, 1, 3, 5, 2, 5, 2, 4, 5, 3, 5, 3, 4, 5, 4, 4, 7, 0, 3, 7, 1, 4, 5, 3, 5, 4, 8, 0, 4, 5, 4, 6, 2, 6, 2, 5, 5, 4, 6, 3, 8, 1, 4, 9, 0
Offset: 1

Views

Author

Antti Karttunen, Oct 26 2014

Keywords

Crossrefs

Cf. A249341 (positions of zeros), A249342 (positions of records).

Programs

  • PARI
    A049084(n) = if(isprime(n), primepi(n), 0); \\ This function from Charles R Greathouse IV
    A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * A049084(f[i,1]))); }
    A249072_write_bfile(up_to_n) = { my(counts, n, a_k, a_n); counts = vector(up_to_n); a_k = 1; for(n = 1, up_to_n, a_n = A056239(a_k); write("b249072_upto12580.txt", n, " ", a_n); counts[1+a_n]++; if(1 == n, a_k = 2, a_k = counts[1+a_n])); };
    A249072_write_bfile(12580);
    
  • Scheme
    (define (A249072 n) (A056239 (A249337 n)))

Formula

a(n) = A056239(A249337(n)).

A249341 Positions of ones in A249337; positions of zeros in A249072.

Original entry on oeis.org

1, 3, 7, 14, 21, 40, 46, 71, 81, 98, 122, 146, 194, 241, 258, 297, 323, 380, 401, 433, 482, 491, 533, 567, 633, 716, 761, 767, 808, 836, 879, 1068, 1105, 1210, 1216, 1370, 1415, 1469, 1515, 1541, 1606, 1684, 1707, 1854, 1872, 1906, 1936, 2117, 2277, 2294, 2305, 2344
Offset: 1

Views

Author

Antti Karttunen, Oct 26 2014

Keywords

Crossrefs

After the initial term, one more than A249342.

Programs

  • PARI
    allocatemem(234567890);
    A049084(n) = if(isprime(n), primepi(n), 0); \\ This function from Charles R Greathouse IV
    A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * A049084(f[i,1]))); }
    A249341_write_bfile(up_to_n) = { my(counts, n, k, a_k); counts = vector(min((2^24)-8,up_to_n^2)); n = 0; k = 0; a_k = 1; while(n < up_to_n, k++; if((1 == a_k), n++; write("b249341.txt", n, " ", k)); counts[1+A056239(a_k)]++; if(1 == k, a_k = 2, a_k = counts[1+A056239(a_k)])); };
    A249341_write_bfile(10000);
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library, two alternative definitions.
    (define A249341 (MATCHING-POS 1 1 (lambda (n) (= 1 (A249337 n)))))
    (define A249341 (ZERO-POS 1 1 A249072))

Formula

For all n >= 2: a(n) = A249342(n) + 1.

A249342 Position of the first occurrence of n-th noncomposite number, A008578(n), in A249337; positions of records in A249072.

Original entry on oeis.org

1, 2, 6, 13, 20, 39, 45, 70, 80, 97, 121, 145, 193, 240, 257, 296, 322, 379, 400, 432, 481, 490, 532, 566, 632, 715, 760, 766, 807, 835, 878, 1067, 1104, 1209, 1215, 1369, 1414, 1468, 1514, 1540, 1605, 1683, 1706, 1853, 1871, 1905, 1935, 2116, 2276, 2293, 2304, 2343
Offset: 1

Views

Author

Antti Karttunen, Oct 26 2014

Keywords

Crossrefs

After the initial term, one less than A249341.

Formula

For all n >= 1:
A249337(a(n)) = A008578(n).
A249072(a(n)) = n-1.
For all n >= 2:
a(n) = A249341(n) - 1.

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

A249336 a(1) = 1; for n>1, a(n) = number of values k in range 1 .. n-1 such that {sum of prime indices in the prime factorization of a(k)} = {sum of prime indices in the prime factorization of a(n-1)}, both counted with multiplicity.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 25 2014

Keywords

Comments

The initial occurrences of primes appear in ascending order. After a(1) and a(2), 1's occur only after each such initial occurrence of a prime, followed by that prime's index (in A000040) + 2.

Examples

			a(1) = 1 by definition.
For n = 2, we see that a(n-1) = a(1) = 1, the sum of whose prime indices is 0, and the only integer k for which A056239(k) = 0 is 1, and 1 occurs once among the terms a(1) .. a(1), thus a(2) = 1 also.
For n = 3, we see that a(n-1) = a(2) = 1 occurs two times among the terms a(1) .. a(2), thus a(3) = 2.
For n = 4, we see that a(n-1) = a(3) = 2, and A056239(2) = 1, and so far there are no other terms than a(3) in a(1) .. a(3) which would result the same sum, thus a(4) = 1.
For n = 5, we see that a(n-1) = a(4) = 1 occurs three times in a(1) .. a(4), thus a(5) = 3.
For n = 6, we see that a(n-1) = a(5) = 3, and A056239(3) = 2 (as 3 = p_2), and so far there are no other terms than a(5) in a(1) .. a(5) which would result the same sum, thus a(6) = 1.
For n = 7, we see that a(n-1) = a(6) = 1 occurs four times in a(1) .. a(6), thus a(7) = 4.
For n = 8, we see that a(n-1) = a(7) = 4, and A056239(4) = 2 (as 4 = p_1 * p_1), and so far among the terms a(1) .. a(7) only a(5) results in the same sum, thus a(8) = 2.
		

Crossrefs

Cf. A056239, A249338 (sum of prime indices of n-th term), A249339 (positions of ones), A249340 (positions of first occurrences of each noncomposite).
Cf. also A249337 (a similar sequence with a slightly different starting condition), A249148.

Programs

  • PARI
    A049084(n) = if(isprime(n), primepi(n), 0); \\ This function from Charles R Greathouse IV
    A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * A049084(f[i,1]))); }
    A249336_write_bfile(up_to_n) = { my(counts, n, a_n); counts = vector(up_to_n); a_n = 1; for(n = 1, up_to_n, write("b249336.txt", n, " ", a_n); counts[1+A056239(a_n)]++; a_n = counts[1+A056239(a_n)]); };
    A249336_write_bfile(12580);
    
  • Scheme
    ;; With memoization-macro definec from Antti Karttunen's IntSeq-library:
    (definec (A249336 n) (if (<= n 1) n (let ((s (A056239 (A249336 (- n 1))))) (let loop ((i (- n 1)) (k 0)) (cond ((zero? i) k) ((= (A056239 (A249336 i)) s) (loop (- i 1) (+ k 1))) (else (loop (- i 1) k))))))) ;; Slow, quadratic time implementation.

Formula

a(1) = 1; for n>1, a(n) = number of values k in range 1 .. n-1 such that A056239(a(k)) = A056239(a(n-1)).
Showing 1-5 of 5 results.