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.

A048675 If n = p_i^e_i * ... * p_k^e_k, p_i < ... < p_k primes (with p_i = prime(i)), then a(n) = (1/2) * (e_i * 2^i + ... + e_k * 2^k).

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 8, 3, 4, 5, 16, 4, 32, 9, 6, 4, 64, 5, 128, 6, 10, 17, 256, 5, 8, 33, 6, 10, 512, 7, 1024, 5, 18, 65, 12, 6, 2048, 129, 34, 7, 4096, 11, 8192, 18, 8, 257, 16384, 6, 16, 9, 66, 34, 32768, 7, 20, 11, 130, 513, 65536, 8, 131072, 1025, 12, 6, 36, 19
Offset: 1

Views

Author

Antti Karttunen, Jul 14 1999

Keywords

Comments

The original motivation for this sequence was to encode the prime factorization of n in the binary representation of a(n), each such representation being unique as long as this map is restricted to A005117 (squarefree numbers, resulting a permutation of nonnegative integers A048672) or any of its subsequence, resulting an injective function like A048623 and A048639.
However, also the restriction to A260443 (not all terms of which are squarefree) results a permutation of nonnegative integers, namely A001477, the identity permutation.
When a polynomial with nonnegative integer coefficients is encoded with the prime factorization of n (e.g., as in A206296, A260443), then a(n) gives the evaluation of that polynomial at x=2.
The primitive completely additive integer sequence that satisfies a(n) = a(A225546(n)), n >= 1. By primitive, we mean that if b is another such sequence, then there is an integer k such that b(n) = k * a(n) for all n >= 1. - Peter Munn, Feb 03 2020
If the binary rank of an integer partition y is given by Sum_i 2^(y_i-1), and the Heinz number is Product_i prime(y_i), then a(n) is the binary rank of the integer partition with Heinz number n. Note the function taking a set s to Sum_i 2^(s_i-1) is the inverse of A048793 (binary indices), and the function taking a multiset m to Product_i prime(m_i) is the inverse of A112798 (prime indices). - Gus Wiseman, May 22 2024

Examples

			From _Gus Wiseman_, May 22 2024: (Start)
The A018819(7) = 6 cases of binary rank 7 are the following, together with their prime indices:
   30: {1,2,3}
   40: {1,1,1,3}
   54: {1,2,2,2}
   72: {1,1,1,2,2}
   96: {1,1,1,1,1,2}
  128: {1,1,1,1,1,1,1}
(End)
		

Crossrefs

Row 2 of A104244.
Similar logarithmic functions: A001414, A056239, A090880, A289506, A293447.
Left inverse of the following sequences: A000079, A019565, A038754, A068911, A134683, A260443, A332824.
A003961, A028234, A032742, A055396, A064989, A067029, A225546, A297845 are used to express relationship between terms of this sequence.
Cf. also A048623, A048676, A099884, A277896 and tables A277905, A285325.
Cf. A297108 (Möbius transform), A332813 and A332823 [= a(n) mod 3].
Pairs of sequences (f,g) that satisfy a(f(n)) = g(n), possibly with offset change: (A000203,A331750), (A005940,A087808), (A007913,A248663), (A007947,A087207), (A097248,A048675), (A206296,A000129), (A248692,A056239), (A283477,A005187), (A284003,A006068), (A285101,A028362), (A285102,A068052), (A293214,A001065), (A318834,A051953), (A319991,A293897), (A319992,A293898), (A320017,A318674), (A329352,A069359), (A332461,A156552), (A332462,A156552), (A332825,A000010) and apparently (A163511,A135529).
See comments/formulas in A277333, A331591, A331740 giving their relationship to this sequence.
The formula section details how the sequence maps the terms of A329050, A329332.
A277892, A322812, A322869, A324573, A324575 give properties of the n-th term of this sequence.
The term k appears A018819(k) times.
The inverse transformation is A019565 (Heinz number of binary indices).
The version for distinct prime indices is A087207.
Numbers k such that a(k) is prime are A277319, counts A372688.
Grouping by image gives A277905.
A014499 lists binary indices of prime numbers.
A061395 gives greatest prime index, least A055396.
A112798 lists prime indices, length A001222, reverse A296150, sum A056239.
Binary indices:
- listed A048793, sum A029931
- reversed A272020
- opposite A371572, sum A230877
- length A000120, complement A023416
- min A001511, opposite A000012
- max A070939, opposite A070940
- complement A368494, sum A359400
- opposite complement A371571, sum A359359

Programs

  • Maple
    nthprime := proc(n) local i; if(isprime(n)) then for i from 1 to 1000000 do if(ithprime(i) = n) then RETURN(i); fi; od; else RETURN(0); fi; end; # nthprime(2) = 1, nthprime(3) = 2, nthprime(5) = 3, etc. - this is also A049084.
    A048675 := proc(n) local s,d; s := 0; for d in ifactors(n)[ 2 ] do s := s + d[ 2 ]*(2^(nthprime(d[ 1 ])-1)); od; RETURN(s); end;
    # simpler alternative
    f:= n -> add(2^(numtheory:-pi(t[1])-1)*t[2], t=ifactors(n)[2]):
    map(f, [$1..100]); # Robert Israel, Oct 10 2016
  • Mathematica
    a[1] = 0; a[n_] := Total[ #[[2]]*2^(PrimePi[#[[1]]]-1)& /@ FactorInteger[n] ]; Array[a, 100] (* Jean-François Alcover, Mar 15 2016 *)
  • PARI
    a(n) = my(f = factor(n)); sum(k=1, #f~, f[k,2]*2^primepi(f[k,1]))/2; \\ Michel Marcus, Oct 10 2016
    
  • PARI
    \\ The following program reconstructs terms (e.g. for checking purposes) from the factorization file prepared by Hans Havermann:
    v048675sigs = readvec("a048675.txt");
    A048675(n) = if(n<=2,n-1,my(prsig=v048675sigs[n],ps=prsig[1],es=prsig[2]); prod(i=1,#ps,ps[i]^es[i])); \\ Antti Karttunen, Feb 02 2020
    
  • Python
    from sympy import factorint, primepi
    def a(n):
        if n==1: return 0
        f=factorint(n)
        return sum([f[i]*2**(primepi(i) - 1) for i in f])
    print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Jun 19 2017

Formula

a(1) = 0, a(n) = 1/2 * (e1*2^i1 + e2*2^i2 + ... + ez*2^iz) if n = p_{i1}^e1*p_{i2}^e2*...*p_{iz}^ez, where p_i is the i-th prime. (e.g. p_1 = 2, p_2 = 3).
Totally additive with a(p^e) = e * 2^(PrimePi(p)-1), where PrimePi(n) = A000720(n). [Missing factor e added to the comment by Antti Karttunen, Jul 29 2015]
From Antti Karttunen, Jul 29 2015: (Start)
a(1) = 0; for n > 1, a(n) = 2^(A055396(n)-1) + a(A032742(n)). [Where A055396(n) gives the index of the smallest prime dividing n and A032742(n) gives the largest proper divisor of n.]
a(1) = 0; for n > 1, a(n) = (A067029(n) * (2^(A055396(n)-1))) + a(A028234(n)).
Other identities. For all n >= 0:
a(A019565(n)) = n.
a(A260443(n)) = n.
a(A206296(n)) = A000129(n).
a(A005940(n+1)) = A087808(n).
a(A007913(n)) = A248663(n).
a(A007947(n)) = A087207(n).
a(A283477(n)) = A005187(n).
a(A284003(n)) = A006068(n).
a(A285101(n)) = A028362(1+n).
a(A285102(n)) = A068052(n).
Also, it seems that a(A163511(n)) = A135529(n) for n >= 1. (End)
a(1) = 0, a(2n) = 1+a(n), a(2n+1) = 2*a(A064989(2n+1)). - Antti Karttunen, Oct 11 2016
From Peter Munn, Jan 31 2020: (Start)
a(n^2) = a(A003961(n)) = 2 * a(n).
a(A297845(n,k)) = a(n) * a(k).
a(n) = a(A225546(n)).
a(A329332(n,k)) = n * k.
a(A329050(n,k)) = 2^(n+k).
(End)
From Antti Karttunen, Feb 02-25 2020, Feb 01 2021: (Start)
a(n) = Sum_{d|n} A297108(d) = Sum_{d|A225546(n)} A297108(d).
a(n) = a(A097248(n)).
For n >= 2:
A001221(a(n)) = A322812(n), A001222(a(n)) = A277892(n).
A000203(a(n)) = A324573(n), A033879(a(n)) = A324575(n).
For n >= 1, A331750(n) = a(A000203(n)).
For n >= 1, the following chains hold:
A293447(n) >= a(n) >= A331740(n) >= A331591(n).
a(n) >= A087207(n) >= A248663(n).
(End)
a(n) = A087207(A097248(n)). - Flávio V. Fernandes, Jul 16 2025

Extensions

Entry revised by Antti Karttunen, Jul 29 2015
More linking formulas added by Antti Karttunen, Apr 18 2017

A046645 a(n) = log_2(A046644(n)); also the 2-adic valuation of A046644(n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

A268375 gives numbers n for which a(n) = A289617(n) = A005187(A001222(n)). - Antti Karttunen, Jul 08 2017

Crossrefs

Programs

Formula

a(n) = A007814(A046644(n)). - Michel Marcus, Apr 16 2015
Additive with a(p^n) = A005187(n). - Antti Karttunen, Jul 08 2017
a(n) = A293447(A293442(n)). - Antti Karttunen, Nov 10 2017
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B + C), where B is Mertens's constant (A077761) and C = Sum_{p prime} f(1/p) = 1.410258867603361890498..., where f(x) = -x + Sum_{k>=0} (2^(k+1)-1)*x^(2^k)/(1+x^(2^k)). - Amiram Eldar, Sep 29 2023

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

A331591 a(n) is the number of distinct prime factors of A225546(n), or equally, number of distinct prime factors of A293442(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen and Peter Munn, Jan 21 2020

Keywords

Comments

a(n) is the number of terms in the unique factorization of n into powers of squarefree numbers with distinct exponents that are powers of 2. See A329332 for a description of the relationship between this factorization, canonical (prime power) factorization and A225546.
The result depends only on the prime signature of n.
a(n) is the number of distinct bit-positions where there is a 1-bit in the binary representation of an exponent in the prime factorization of n. - Antti Karttunen, Feb 05 2020
The first 3 is a(128) = a(2^1 * 2^2 * 2^4) = 3 and in general each m occurs first at position 2^(2^m-1) = A058891(m+1). - Peter Munn, Mar 07 2022

Examples

			From _Peter Munn_, Jan 28 2020: (Start)
The factorization of 6 into powers of squarefree numbers with distinct exponents that are powers of 2 is 6 = 6^(2^0) = 6^1, which has 1 term. So a(6) = 1.
Similarly, 40 = 10^(2^0) * 2^(2^1) = 10^1 * 2^2 = 10 * 4, which has 2 terms. So a(40) = 2.
Similarly, 320 = 5^(2^0) * 2^(2^1) * 2^(2^2) = 5^1 * 2^2 * 2^4 = 5 * 4 * 16, which has 3 terms. So a(320) = 3.
10^100 (a googol) factorizes in this way as 10^4 * 10^32 * 10^64. So a(10^100) = 3.
(End)
		

Crossrefs

Sequences with related definitions: A001221, A331309, A331592, A331593, A331740.
Positions of records: A058891.
Positions of 1's: A340682.
Sequences used to express relationships between the terms: A007913, A008833, A059796, A331590.

Programs

  • Mathematica
    Array[PrimeNu@ If[# == 1, 1, Times @@ Flatten@ Map[Function[{p, e}, Map[Prime[Log2@ # + 1]^(2^(PrimePi@ p - 1)) &, DeleteCases[NumberExpand[e, 2], 0]]] @@ # &, FactorInteger[#]]] &, 105] (* Michael De Vlieger, Jan 24 2020 *)
    f[e_] := Position[Reverse[IntegerDigits[e, 2]], 1] // Flatten; a[n_] := CountDistinct[Flatten[f /@ FactorInteger[n][[;; , 2]]]]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Dec 23 2023 *)
  • PARI
    A331591(n) = if(1==n,0,my(f=factor(n),u=#binary(vecmax(f[, 2])),xs=vector(u),m=1,e); for(i=1,u,for(k=1,#f~, if(bitand(f[k,2],m),xs[i]++)); m<<=1); #select(x -> (x>0),xs));
    
  • PARI
    A331591(n) = if(1==n, 0, hammingweight(fold(bitor, factor(n)[, 2]))); \\ Antti Karttunen, Feb 05 2020
    
  • PARI
    A331591(n) = if(n==1, 0, (core(n)>1) + A331591(core(n,1)[2])) \\ Peter Munn, Mar 08 2022

Formula

a(n) = A001221(A293442(n)) = A001221(A225546(n)).
From Peter Munn, Jan 28 2020: (Start)
a(n) = A000120(A267116(n)).
a(n) = a(A007913(n)) + a(A008833(n)).
For m >= 2, a(A005117(m)) = 1.
a(n^2) = a(n).
(End)
a(n) <= A331740(n) <= A048675(n) <= A293447(n). - Antti Karttunen, Feb 05 2020
From Peter Munn, Mar 07 2022: (Start)
a(n) <= A299090(n).
a(A337533(n)) = A299090(A337533(n)).
a(A337534(n)) < A299090(A337534(n)).
max(a(n), a(k)) <= a(A059796(n, k)) = a(A331590(n, k)) <= a(n) + a(k).
(End)

A318445 a(n) = Sum_{d|n, dA005187(d).

Original entry on oeis.org

0, 1, 1, 4, 1, 8, 1, 11, 5, 12, 1, 25, 1, 15, 13, 26, 1, 34, 1, 37, 16, 23, 1, 62, 9, 27, 21, 47, 1, 70, 1, 57, 24, 36, 20, 97, 1, 39, 28, 90, 1, 93, 1, 71, 55, 46, 1, 139, 12, 77, 37, 83, 1, 118, 28, 115, 40, 58, 1, 193, 1, 61, 71, 120, 32, 142, 1, 109, 47, 133, 1, 228, 1, 75, 86, 119, 31, 164, 1, 199, 71, 83, 1, 256, 41
Offset: 1

Views

Author

Antti Karttunen, Aug 26 2018

Keywords

Crossrefs

Programs

  • PARI
    A005187(n) = { my(s=n); while(n>>=1, s+=n); s; };
    A318445(n) = sumdiv(n,d,(dA005187(d));

Formula

a(n) = Sum_{d|n, dA005187(d).
a(n) = A318446(n) - A005187(n).
a(n) = A211779(n) + A318447(n).
a(n) = A293447(A293214(n)).
Showing 1-5 of 5 results.