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

A196050 Number of edges in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Sep 27 2011

Keywords

Comments

The Matula-Goebel number of a rooted tree is defined in the following recursive manner: to the one-vertex tree there corresponds the number 1; to a tree T with root degree 1 there corresponds the t-th prime number, where t is the Matula-Goebel number of the tree obtained from T by deleting the edge emanating from the root; to a tree T with root degree m>=2 there corresponds the product of the Matula-Goebel numbers of the m branches of T.
a(n) is, for n >= 2, the number of prime function prime(.) = A000040(.) operations in the complete reduction of n. See the W. Lang link with a list of the reductions for n = 2..100, where a curly bracket notation {.} is used for prime(.). - Wolfdieter Lang, Apr 03 2018
From Gus Wiseman, Mar 23 2019: (Start)
Every positive integer has a unique factorization (encoded by A324924) into factors q(i) = prime(i)/i, i > 0. For example:
11 = q(1) q(2) q(3) q(5)
50 = q(1)^3 q(2)^2 q(3)^2
360 = q(1)^6 q(2)^3 q(3)
In this factorization, a(n) is the number of factors counted with multiplicity. For example, a(11) = 4, a(50) = 7, a(360) = 10.
(End)
From Antti Karttunen, Oct 23 2023: (Start)
Totally additive with a(prime(n)) = 1 + a(n).
Number of iterations of A366385 (or equally, of A366387) needed to reach 1.
(End)

Examples

			a(7) = 3 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y.
a(2^m) = m because the rooted tree with Matula-Goebel number 2^m is the star tree with m edges.
		

Crossrefs

Programs

  • Haskell
    import Data.List (genericIndex)
    a196050 n = genericIndex a196050_list (n - 1)
    a196050_list = 0 : g 2 where
       g x = y : g (x + 1) where
         y = if t > 0 then a196050 t + 1 else a196050 r + a196050 s
             where t = a049084 x; r = a020639 x; s = x `div` r
    -- Reinhard Zumkeller, Sep 03 2013
    
  • Maple
    with(numtheory): a := proc (n) local r, s: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: if n = 1 then 0 elif bigomega(n) = 1 then 1+a(pi(n)) else a(r(n))+a(s(n)) end if end proc: seq(a(n), n = 1 .. 110);
  • Mathematica
    a[1] = 0; a[n_?PrimeQ] := a[n] = 1 + a[PrimePi[n]]; a[n_] := Total[#[[2]] * a[#[[1]] ]& /@ FactorInteger[n]];
    Array[a, 110] (* Jean-François Alcover, Nov 16 2017 *)
    difac[n_]:=If[n==1,{},With[{i=PrimePi[FactorInteger[n][[1,1]]]},Sort[Prepend[difac[n*i/Prime[i]],i]]]];
    Table[Length[difac[n]],{n,100}] (* Gus Wiseman, Mar 23 2019 *)
  • PARI
    a(n) = my(f=factor(n)); [self()(primepi(p))+1 |p<-f[,1]]*f[,2]; \\ Kevin Ryde, May 28 2021
    
  • Python
    from functools import lru_cache
    from sympy import isprime, primepi, factorint
    @lru_cache(maxsize=None)
    def A196050(n):
        if n == 1 : return 0
        if isprime(n): return 1+A196050(primepi(n))
        return sum(e*A196050(p) for p, e in factorint(n).items()) # Chai Wah Wu, Mar 19 2022

Formula

a(1)=0; if n = prime(t) (the t-th prime), then a(n)=1 + a(t); if n = r*s (r,s>=2), then a(n)=a(r)+a(s). The Maple program is based on this recursive formula.
a(n) = A061775(n) - 1.
a(n) = A109129(n) + A366388(n) = A109082(n) + A358729(n). - Antti Karttunen, Oct 23 2023

A014689 a(n) = prime(n)-n, the number of nonprimes less than prime(n).

Original entry on oeis.org

1, 1, 2, 3, 6, 7, 10, 11, 14, 19, 20, 25, 28, 29, 32, 37, 42, 43, 48, 51, 52, 57, 60, 65, 72, 75, 76, 79, 80, 83, 96, 99, 104, 105, 114, 115, 120, 125, 128, 133, 138, 139, 148, 149, 152, 153, 164, 175, 178, 179, 182, 187, 188, 197, 202, 207, 212, 213, 218, 221, 222
Offset: 1

Views

Author

Keywords

Comments

a(n) = A048864(A000040(n)) = number of nonprimes in RRS of n-th prime. - Labos Elemer, Oct 10 2002
A000040 - A014689 = A000027; in other words, the sequence of natural numbers subtracted from the prime sequence produces A014689. - Enoch Haga, May 25 2009
a(n) = A000040(n) - n. a(n) = inverse (frequency distribution) sequence of A073425(n), i.e., number of terms of sequence A073425(n) less than n. a(n) = A065890(n) + 1, for n >= 1. a(n) - 1 = A065890(n) = the number of composite numbers, i.e., (A002808) less than n-th primes, (i.e., < A000040(n)). - Jaroslav Krizek, Jun 27 2009
a(n) = A162177(n+1) + 1, for n >= 1. a(n) - 1 = A162177(n+1) = the number of composite numbers, i.e., (A002808) less than (n+1)-th number of set {1, primes}, (i.e., < A008578(n+1)). - Jaroslav Krizek, Jun 28 2009
Conjecture: Each residue class contains infinitely many terms of this sequence. Similarly, for any integers m > 0 and r, we have prime(n) + n == r (mod m) for infinitely many positive integers n. - Zhi-Wei Sun, Nov 25 2013
First differences are A046933 = differences minus one between successive primes. - Gus Wiseman, Jan 18 2020

Crossrefs

Equals A014692 - 1.
The sum of prime factors of n is A001414(n).
The sum of prime indices of n is A056239(n).
Their difference is A331415(n).

Programs

Formula

G.f: b(x) - x/((1-x)^2), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 13 2016

Extensions

More terms from Vasiliy Danilov (danilovv(AT)usa.net), Jul 1998
Correction for Aug 2009 change of offset in A158611 and A008578 by Jaroslav Krizek, Jan 27 2010

A334201 a(n) = A056239(n) - A061395(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 11 2020

Keywords

Comments

a(n) is the sum of all other parts of the partition having Heinz number n except one instance of the largest part.

Crossrefs

Sum of A339895 and A339896.
Differs from A323077 for the first time at n=169, where a(169) = 6, while A323077(169) = 5.
Cf. also A334107.

Programs

  • Mathematica
    Array[Total[# /. {p_, c_} /; p > 0 :> PrimePi[p] c] - PrimePi@ #[[-1, 1]] &@ FactorInteger[#] &, 105] (* Michael De Vlieger, May 14 2020 *)
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A334201(n) = if(1==n,0,(bigomega(n)-1)+A334201(A064989(n)));

Formula

a(n) = A056239(n) - A061395(n) = A056239(A052126(n)).
a(n) = A318995(A122111(n)).
a(n) = a(A064989(n)) + A001222(n) - 1.
a(n) = A339895(n) + A339896(n). - Antti Karttunen, Dec 31 2020

A104244 Suppose m = Product_{i=1..k} p_i^e_i, where p_i is the i-th prime number and each e_i is a nonnegative integer. Then we can define P_m(x) = Sum_{i=1..k} e_i*x^(i-1). The sequence is the square array A(n,m) = P_m(n) read by descending antidiagonals.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 2, 2, 1, 0, 1, 2, 3, 1, 0, 2, 4, 2, 4, 1, 0, 1, 3, 9, 2, 5, 1, 0, 3, 8, 4, 16, 2, 6, 1, 0, 2, 3, 27, 5, 25, 2, 7, 1, 0, 2, 4, 3, 64, 6, 36, 2, 8, 1, 0, 1, 5, 6, 3, 125, 7, 49, 2, 9, 1, 0, 3, 16, 10, 8, 3, 216, 8, 64, 2, 10, 1, 0, 1, 4, 81, 17, 10, 3, 343, 9, 81, 2, 11, 1, 0, 2, 32, 5
Offset: 1

Views

Author

Olaf Voß, Feb 26 2005

Keywords

Comments

From Antti Karttunen, Jul 29 2015: (Start)
The square array A(row,col) is read by downwards antidiagonals as: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
A(n,m) (entry at row=n, column=m) gives the evaluation at x=n of the polynomial (with nonnegative integer coefficients) bijectively encoded in the prime factorization of m. See A206284, A206296 for the details of that encoding. (The roles of variables n and m were accidentally swapped in this description, corrected by Antti Karttunen, Oct 30 2016)
(End)
Each row is a completely additive sequence, row n mapping prime(m) to n^(m-1). - Peter Munn, Apr 22 2022

Examples

			a(13) = 3 because 3 = p_1^0 * p_2^1 * p_3^0 * ..., so P_3(x) = 0*x^(1-1) + 1*x^(2-1) + 0*x^(3-1) + ... = x. Hence a(13) = A(3,3) = P_3(3) = 3. [Elaborated by _Peter Munn_, Aug 13 2022]
The top left corner of the array:
0, 1,  1, 2,   1,  2,   1,  3,  2,   2,     1,  3,      1,    2,   2, 4
0, 1,  2, 2,   4,  3,   8,  3,  4,   5,    16,  4,     32,    9,   6, 4
0, 1,  3, 2,   9,  4,  27,  3,  6,  10,    81,  5,    243,   28,  12, 4
0, 1,  4, 2,  16,  5,  64,  3,  8,  17,   256,  6,   1024,   65,  20, 4
0, 1,  5, 2,  25,  6,  125, 3, 10,  26,   625,  7,   3125,  126,  30, 4
0, 1,  6, 2,  36,  7,  216, 3, 12,  37,  1296,  8,   7776,  217,  42, 4
0, 1,  7, 2,  49,  8,  343, 3, 14,  50,  2401,  9,  16807,  344,  56, 4
0, 1,  8, 2,  64,  9,  512, 3, 16,  65,  4096, 10,  32768,  513,  72, 4
0, 1,  9, 2,  81, 10,  729, 3, 18,  82,  6561, 11,  59049,  730,  90, 4
0, 1, 10, 2, 100, 11, 1000, 3, 20, 101, 10000, 12, 100000, 1001, 110, 4
...
		

Crossrefs

Cf. A000720.
Transpose: A104245.
Main diagonal: A090883.
Row 1: A001222, row 2: A048675, row 3: A090880, row 4: A090881, row 5: A090882, row 10: A054841; and, in the extrapolated table, row 0: A007814, row -1: A195017.
Other completely additive sequences with prime(k) mapped to a function of k include k: A056239, k-1: A318995, k+1: A318994, k^2: A289506, 2^k-1: A293447, k!: A276075, F(k-1): A265753, F(k-2): A265752.
For completely additive sequences with primes p mapped to a function of p, see A001414.
For completely additive sequences where some primes are mapped to 1, the rest to 0 (notably, some ruler functions) see the cross-references in A249344.
For completely additive sequences, s, with primes p mapped to a function of s(p-1) and maybe s(p+1), see A352957.
See the formula section for the relationship to A073133, A206296.
See the comments for the relevance of A206284.
A297845 represents multiplication of the relevant polynomials.
Cf. A090884, A248663, A265398, A265399 for other related sequences.
A167219 lists columns that contain their own column number.

Formula

A(n,A206296(k)) = A073133(n,k). [This formula demonstrates how this array can be used with appropriately encoded polynomials. Note that A073133 reads its antidiagonals by ascending order, while here the order is opposite.] - Antti Karttunen, Oct 30 2016
From Peter Munn, Apr 05 2021: (Start)
The sequence is defined by the following identities:
A(n, 3) = n;
A(n, m*k) = A(n, m) + A(n, k);
A(n, A297845(m, k)) = A(n, m) * A(n, k).
(End)

Extensions

Starting offset changed from 0 to 1 by Antti Karttunen, Jul 29 2015
Name edited (and aligned with rest of sequence) by Peter Munn, Apr 23 2022

A331415 Sum of prime factors minus sum of prime indices of n.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 3, 2, 3, 6, 3, 7, 4, 3, 4, 10, 3, 11, 4, 4, 7, 14, 4, 4, 8, 3, 5, 19, 4, 20, 5, 7, 11, 5, 4, 25, 12, 8, 5, 28, 5, 29, 8, 4, 15, 32, 5, 6, 5, 11, 9, 37, 4, 8, 6, 12, 20, 42, 5, 43, 21, 5, 6, 9, 8, 48, 12, 15, 6, 51, 5, 52, 26, 5, 13, 9, 9
Offset: 1

Views

Author

Gus Wiseman, Jan 17 2020

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 factors of 12 are {2,2,3}, while the prime indices are {1,1,2}, so a(12) = 7 - 4 = 3.
		

Crossrefs

The number of k's is A331387(k) = sum of k-th column of A331385.
The sum of prime factors of n is A001414(n).
The sum of prime indices of n is A056239(n).
Numbers divisible by the sum of their prime factors are A036844.
Sum of prime factors is divisible by sum of prime indices: A331380
Product of prime indices equals sum of prime factors: A331384.

Programs

  • Mathematica
    Table[Total[Cases[If[n==1,{},FactorInteger[n]],{p_,k_}:>k*(p-PrimePi[p])]],{n,30}]

Formula

Totally additive with a(prime(k)) = prime(k) - k = A014689(k).
a(n) = A001414(n) - A056239(n).

A318994 Totally additive with a(prime(n)) = n + 1.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 07 2018

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add((1+numtheory[pi](i[1]))*i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 07 2018
  • Mathematica
    Table[Cases[If[n==1,{},FactorInteger[n]],{p_,k_}:>(PrimePi[p]+1)*k]//Total,{n,100}]
  • PARI
    a(n)={my(f=factor(n)); sum(i=1, #f~, my([p,e]=f[i,]); (primepi(p)+1)*e)} \\ Andrew Howroyd, Sep 07 2018

A325120 Sum of binary lengths of the prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 29 2019

Keywords

Comments

The binary length of n is the number of digits in its binary representation. 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

Programs

  • Mathematica
    Table[Sum[pr[[2]]*IntegerLength[PrimePi[pr[[1]]],2],{pr,FactorInteger[n]}],{n,100}]

Formula

Totally additive with a(prime(n)) = A070939(n).

A325121 Sum of binary digits of the prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 29 2019

Keywords

Comments

The sum of binary digits of an integer is the number of 1's in its binary representation. 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

Programs

  • Mathematica
    Table[Sum[pr[[2]]*DigitCount[PrimePi[pr[[1]]],2,1],{pr,FactorInteger[n]}],{n,100}]

Formula

Totally additive with a(prime(n)) = A000120(n).

A325122 Sum of binary digits of the prime indices of n, minus Omega(n).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 2, 0, 0, 1, 0, 1, 1, 0, 2, 1, 0, 0, 1, 1, 2, 0, 1, 2, 1, 0, 1, 0, 1, 1, 2, 0, 2, 1, 1, 1, 3, 0, 0, 2, 2, 1, 0, 0, 2, 0, 0, 1, 1, 1, 1, 2, 0, 0, 2, 1, 2, 2, 1, 1, 1, 0, 2, 1, 2, 0, 1, 1, 2, 1, 0, 2, 3, 0, 3, 2, 1
Offset: 1

Views

Author

Gus Wiseman, Mar 29 2019

Keywords

Comments

The sum of binary digits of an integer is the number of 1's in its binary representation. 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

Positions of zeros are A318400.
Other totally additive sequences: A056239, A302242, A318994, A318995, A325033, A325034, A325120, A325121.

Programs

  • Mathematica
    Table[Sum[pr[[2]]*(DigitCount[PrimePi[pr[[1]]],2,1]-1),{pr,If[n==1,{},FactorInteger[n]]}],{n,100}]

Formula

Totally additive with a(prime(n)) = A048881(n).

A359587 Fully multiplicative with a(p) = A008578(1+A329697(p)).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 3, 1, 4, 2, 3, 2, 3, 3, 4, 1, 2, 4, 5, 2, 6, 3, 5, 2, 4, 3, 8, 3, 5, 4, 5, 1, 6, 2, 6, 4, 5, 5, 6, 2, 3, 6, 7, 3, 8, 5, 7, 2, 9, 4, 4, 3, 5, 8, 6, 3, 10, 5, 7, 4, 5, 5, 12, 1, 6, 6, 7, 2, 10, 6, 7, 4, 5, 5, 8, 5, 9, 6, 7, 2, 16, 3, 5, 6, 4, 7, 10, 3, 5, 8, 9, 5, 10, 7, 10, 2, 3, 9, 12, 4, 5, 4, 5, 3, 12
Offset: 1

Views

Author

Antti Karttunen, Jan 08 2023

Keywords

Crossrefs

Programs

  • PARI
    A008578(n) = if(1==n,1,prime(n-1));
    A329697(n) = if(!bitand(n, n-1), 0, 1+A329697(n-(n/vecmax(factor(n)[, 1]))));
    A359587(n) = { my(f=factor(n)); for(i=1, #f~, f[i, 1] = A008578(1+A329697(f[i, 1]))); factorback(f); };

Formula

For n >= 1: (Start)
a(A000265(n)) = a(2*n) = a(n).
A001222(a(n)) = A087436(n),
A056239(a(n)) = A329697(n),
A318995(a(n)) = A336396(n) = A329697(A336466(n)).
(End)
Showing 1-10 of 10 results.