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 518 results. Next

A241909 Self-inverse permutation of natural numbers: a(1)=1, a(p_i) = 2^i, and if n = p_i1 * p_i2 * p_i3 * ... * p_{ik-1} * p_ik, where p's are primes, with their indexes are sorted into nondescending order: i1 <= i2 <= i3 <= ... <= i_{k-1} <= ik, then a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})). Here k = A001222(n) and ik = A061395(n).

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 16, 5, 6, 27, 32, 25, 64, 81, 18, 7, 128, 15, 256, 125, 54, 243, 512, 49, 12, 729, 10, 625, 1024, 75, 2048, 11, 162, 2187, 36, 35, 4096, 6561, 486, 343, 8192, 375, 16384, 3125, 50, 19683, 32768, 121, 24, 45, 1458, 15625, 65536, 21, 108, 2401
Offset: 1

Views

Author

Antti Karttunen, May 03 2014, partly inspired by Marc LeBrun's Jan 11 2006 message on SeqFan mailing list

Keywords

Comments

This permutation maps between the partitions as ordered in A112798 and A241918 (the original motivation for this sequence).
For all n > 2, A007814(a(n)) = A055396(n)-1, which implies that this self-inverse permutation maps between primes (A000040) and the powers of two larger than one (A000079(n>=1)), and apart from a(1) & a(2), this also maps each even number to some odd number, and vice versa, which means there are no fixed points after 2.
A122111 commutes with this one, that is, a(n) = A122111(a(A122111(n))).
Conjugates between A243051 and A242424 and other rows of A243060 and A243070.

Examples

			For n = 12 = 2 * 2 * 3 = p_1 * p_1 * p_2, we obtain by the first formula 2^(1-1) * 3^(1-1) * 5^(1+(2-1)) = 5^2 = 25. By the second formula, as n = 2^2 * 3^1, we obtain the same result, p_{1+2} * p_{2+1} = p_3 * p_3 = 25, thus a(12) = 25.
Using the product formula over the terms of row n of table A241918, we see, because 9450 = 2*3*3*3*5*5*7 = p_1^1 * p_2^3 * p_3^2 * p_4^1, that the corresponding row in A241918 is {2,5,7,7}, and multiplying p_2 * p_5 * p_7^2 yields 3 * 11 * 17 * 17 = 9537, thus a(9450) = 9537.
Similarly, for 9537, the corresponding row in A241918 is {1,2,2,2,3,3,4}, and multiplying p_1^1 * p_2^3 * p_3^2 * p_4^1, we obtain 9450 back.
		

Crossrefs

Cf. also A278220 (= A046523(a(n))), A331280 (its rgs_transform), A331299 (= min(n,a(n))).
{A000027, A122111, A241909, A241916} form a 4-group.

Programs

  • Haskell
    a241909 1 = 1
    a241909 n = product $ zipWith (^) a000040_list $ zipWith (-) is (1 : is)
                where is = reverse ((j + 1) : js)
                      (j:js) = reverse $ map a049084 $ a027746_row n
    -- Reinhard Zumkeller, Aug 04 2014
    
  • Mathematica
    Array[If[# == 1, 1, Function[t, Times @@ Prime@ Accumulate[If[Length@ t < 2, {0}, Join[{1}, ConstantArray[0, Length@ t - 2], {-1}]] + ReplacePart[t, Map[#1 -> #2 & @@ # &, #]]]]@ ConstantArray[0, Transpose[#][[1, -1]]] &[FactorInteger[#] /. {p_, e_} /; p > 0 :> {PrimePi@ p, e}]] &, 56] (* Michael De Vlieger, Jan 23 2020 *)
  • PARI
    A241909(n) = if(1==n||isprime(n),2^primepi(n),my(f=factor(n),h=1,i,m=1,p=1,k=1); while(k<=#f~, p = nextprime(1+p); i = primepi(f[k,1]); m *= p^(i-h); h = i; if(f[k,2]>1, f[k,2]--, k++)); (p*m)); \\ Antti Karttunen, Jan 17 2020

Formula

If n is a prime with index i (p_i), then a(n) = 2^i, otherwise when n = p_i1 * p_i2 * p_i3 * ... p_ik, where p_i1, p_i2, p_i3, ..., p_ik are the primes present (not necessarily all distinct) in the prime factorization of n, sorted into nondescending order, a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})).
Equally, if n = 2^k, then a(n) = p_k, otherwise, when n = 2^e1 * 3^e2 * 5^e3 * ... * p_k^{e_k}, i.e., where e1 ... e_k are the exponents (some of them possibly zero, except the last) of the primes 2, 3, 5, ... in the prime factorization of n, a(n) = p_{1+e1} * p_{1+e1+e2} * p_{1+e1+e2+e3} * ... * p_{e1+e2+e3+...+e_k}.
From the equivalence of the above two formulas (which are inverses of each other) it follows that a(a(n)) = n, i.e., that this permutation is an involution. For a proof, please see the attached notes.
The first formula corresponds to this recurrence:
a(1) = 1, a(p_k) = 2^k for primes with index k, otherwise a(n) = (A000040(A001222(n))^(A241917(n)+1)) * A052126(a(A052126(n))).
And the latter formula with this recurrence:
a(1) = 1, and for n>1, if n = 2^k, a(n) = A000040(k), otherwise a(n) = A000040(A001511(n)) * A242378(A007814(n), a(A064989(n))).
[Here A242378(k,n) changes each prime p(i) in the prime factorization of n to p(i+k), i.e., it's the result of A003961 iterated k times starting from n.]
We also have:
a(1)=1, and for n>1, a(n) = Product_{i=A203623(n-1)+2..A203623(n)+1} A000040(A241918(i)).
For all n >= 1, A001222(a(n)) = A061395(n), and vice versa, A061395(a(n)) = A001222(n).
For all n > 1, a(2n-1) = 2*a(A064216(n)).

Extensions

Typos in the name corrected by Antti Karttunen, May 31 2014

A244990 After 1, numbers whose greatest prime factor is a prime with an even index; n such that A061395(n) is even.

Original entry on oeis.org

1, 3, 6, 7, 9, 12, 13, 14, 18, 19, 21, 24, 26, 27, 28, 29, 35, 36, 37, 38, 39, 42, 43, 48, 49, 52, 53, 54, 56, 57, 58, 61, 63, 65, 70, 71, 72, 74, 76, 78, 79, 81, 84, 86, 87, 89, 91, 95, 96, 98, 101, 104, 105, 106, 107, 108, 111, 112, 113, 114, 116, 117, 122, 126, 129, 130, 131, 133, 139, 140, 142, 143, 144
Offset: 1

Views

Author

Antti Karttunen, Jul 21 2014

Keywords

Comments

Equally, after 1, natural numbers n such that A006530(n) is in A031215.
A122111 maps each one of these numbers to a unique term of A028260 and vice versa.

Crossrefs

Formula

For all n, A244988(a(n)) = n.

A340610 Numbers whose number of prime factors (A001222) divides their greatest prime index (A061395).

Original entry on oeis.org

2, 3, 5, 6, 7, 9, 11, 13, 14, 17, 19, 20, 21, 23, 26, 29, 30, 31, 35, 37, 38, 39, 41, 43, 45, 47, 49, 50, 52, 53, 56, 57, 58, 59, 61, 65, 67, 71, 73, 74, 75, 78, 79, 83, 84, 86, 87, 89, 91, 92, 95, 97, 101, 103, 106, 107, 109, 111, 113, 117, 122, 125, 126, 127
Offset: 1

Views

Author

Gus Wiseman, Jan 27 2021

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 sequence of terms together with their prime indices begins:
     2: {1}        29: {10}       56: {1,1,1,4}
     3: {2}        30: {1,2,3}    57: {2,8}
     5: {3}        31: {11}       58: {1,10}
     6: {1,2}      35: {3,4}      59: {17}
     7: {4}        37: {12}       61: {18}
     9: {2,2}      38: {1,8}      65: {3,6}
    11: {5}        39: {2,6}      67: {19}
    13: {6}        41: {13}       71: {20}
    14: {1,4}      43: {14}       73: {21}
    17: {7}        45: {2,2,3}    74: {1,12}
    19: {8}        47: {15}       75: {2,3,3}
    20: {1,1,3}    49: {4,4}      78: {1,2,6}
    21: {2,4}      50: {1,3,3}    79: {22}
    23: {9}        52: {1,1,6}    83: {23}
    26: {1,6}      53: {16}       84: {1,1,2,4}
		

Crossrefs

Note: Heinz numbers are given in parentheses below.
The case of equality is A047993 (A106529).
The case where all parts are multiples, not just the maximum part, is A143773 (A316428), with strict case A340830, while the case of factorizations is A340853.
These are the Heinz numbers of certain partitions counted by A168659.
The reciprocal version is A340609.
The squarefree case is A340828 (A340856).
A001222 counts prime factors.
A006141 counts partitions whose length equals their minimum (A324522).
A056239 adds up prime indices.
A061395 selects the maximum prime index.
A067538 counts partitions whose length divides their sum (A316413).
A067538 counts partitions whose maximum divides their sum (A326836).
A112798 lists the prime indices of each positive integer.
A200750 counts partitions with length coprime to maximum (A340608).

Programs

  • Maple
    filter:= proc(n) local F,m,g,t;
      F:= ifactors(n)[2];
      m:= add(t[2],t=F);
      g:= numtheory:-pi(max(seq(t[1],t=F)));
      g mod m = 0;
    end proc:
    select(filter, [$2..1000]); # Robert Israel, Feb 08 2021
  • Mathematica
    Select[Range[2,100],Divisible[PrimePi[FactorInteger[#][[-1,1]]],PrimeOmega[#]]&]

Formula

A001222(a(n)) divides A061395(a(n)).

A297167 a(1) = 0, for n > 1, a(n) = -1 + the excess of n (A046660) + the index of the largest prime factor (A061395).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 27 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Array[-1 + PrimeOmega@ # - PrimeNu@ # + PrimePi[FactorInteger[#][[-1, 1]]] /. k_ /; k < 0 -> 0 &, 105] (* or, slightly faster *)
    Array[-1 + Length@ # - Length@ Union@ # + PrimePi@ Last@ # /. k_ /; k < 0 -> 0 &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, #] &@ FactorInteger[#] &, 105] (* Michael De Vlieger, Mar 13 2018 *)
  • PARI
    A061395(n) = if(1==n, 0, primepi(vecmax(factor(n)[, 1]))); \\ After M. F. Hasler's code for A006530.
    A252464(n) = if(1==n, 0, (bigomega(n) + A061395(n) - 1));
    A297167(n) = (A252464(n) - omega(n));
    \\ Or just as:
    A297167(n) = if(1==n, 0, (A061395(n) + (bigomega(n)-omega(n)) - 1));
    \\ Antti Karttunen, Mar 13 2018
    
  • Python
    from sympy import factorint, primepi
    def A297167(n): return primepi(max(f:=factorint(n)))+sum(e-1 for e in f.values())-1 if n>1 else 0 # Chai Wah Wu, Jul 29 2023
  • Scheme
    (define (A297167 n) (- (A252464 n) (A001221 n)))
    

Formula

a(n) = A252464(n) - A001221(n).
For n > 1, a(n) = A033265(A156552(n)) = A297113(n) - 1.
For n > 1, a(n) = A046660(n) + A061395(n) - 1. - Antti Karttunen, Mar 13 2018

Extensions

Name changed, original equivalent definition is the first entry in the Formula section - Antti Karttunen, Mar 13 2018

A340609 Numbers whose number of prime factors (A001222) is divisible by their greatest prime index (A061395).

Original entry on oeis.org

2, 4, 6, 8, 9, 16, 20, 24, 30, 32, 36, 45, 50, 54, 56, 64, 75, 81, 84, 96, 125, 126, 128, 140, 144, 160, 176, 189, 196, 210, 216, 240, 256, 264, 294, 315, 324, 350, 360, 384, 396, 400, 416, 440, 441, 486, 490, 512, 525, 540, 576, 594, 600, 616, 624, 660, 686
Offset: 1

Views

Author

Gus Wiseman, Jan 27 2021

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.
If n is a term, then so is n^k for k > 1. - Robert Israel, Feb 08 2021

Examples

			The sequence of terms together with their prime indices begins:
      2: {1}             64: {1,1,1,1,1,1}      216: {1,1,1,2,2,2}
      4: {1,1}           75: {2,3,3}            240: {1,1,1,1,2,3}
      6: {1,2}           81: {2,2,2,2}          256: {1,1,1,1,1,1,1,1}
      8: {1,1,1}         84: {1,1,2,4}          264: {1,1,1,2,5}
      9: {2,2}           96: {1,1,1,1,1,2}      294: {1,2,4,4}
     16: {1,1,1,1}      125: {3,3,3}            315: {2,2,3,4}
     20: {1,1,3}        126: {1,2,2,4}          324: {1,1,2,2,2,2}
     24: {1,1,1,2}      128: {1,1,1,1,1,1,1}    350: {1,3,3,4}
     30: {1,2,3}        140: {1,1,3,4}          360: {1,1,1,2,2,3}
     32: {1,1,1,1,1}    144: {1,1,1,1,2,2}      384: {1,1,1,1,1,1,1,2}
     36: {1,1,2,2}      160: {1,1,1,1,1,3}      396: {1,1,2,2,5}
     45: {2,2,3}        176: {1,1,1,1,5}        400: {1,1,1,1,3,3}
     50: {1,3,3}        189: {2,2,2,4}          416: {1,1,1,1,1,6}
     54: {1,2,2,2}      196: {1,1,4,4}          440: {1,1,1,3,5}
     56: {1,1,1,4}      210: {1,2,3,4}          441: {2,2,4,4}
		

Crossrefs

Note: Heinz numbers are given in parentheses below.
The case of equality is A047993 (A106529).
These are the Heinz numbers of certain partitions counted by A168659.
The reciprocal version is A340610, with strict case A340828 (A340856).
If all parts (not just the greatest) are divisors we get A340693 (A340606).
A001222 counts prime factors.
A006141 counts partitions whose length equals their minimum (A324522).
A056239 adds up prime indices.
A061395 selects the maximum prime index.
A067538 counts partitions whose length divides their sum (A316413).
A067538 counts partitions whose maximum divides their sum (A326836).
A112798 lists the prime indices of each positive integer.
A200750 counts partitions with length coprime to maximum (A340608).

Programs

  • Maple
    filter:= proc(n) local F,m,g,t;
      F:= ifactors(n)[2];
      m:= add(t[2],t=F);
      g:= numtheory:-pi(max(seq(t[1],t=F)));
      m mod g = 0;
    end proc:
    seelect(filter, [$2..1000]); # Robert Israel, Feb 08 2021
  • Mathematica
    Select[Range[2,100],Divisible[PrimeOmega[#],PrimePi[FactorInteger[#][[-1,1]]]]&]

Formula

A061395(a(n)) divides A001222(a(n)).

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

A241917 If n is a prime with index i, p_i, a(n) = i, (with a(1)=0), otherwise difference (i-j) of the indices of the two largest primes p_i, p_j, i >= j in the prime factorization of n: a(n) = A061395(n) - A061395(A052126(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 13 2014

Keywords

Comments

Note: the two largest primes in the multiset of prime divisors of n are equal for all numbers that are in A070003, thus, after a(1)=0, A070003 gives the positions of the other zeros in this sequence.

Crossrefs

Cf. A241919, A242411, A243055 for other variants.

Programs

  • Haskell
    a241917 n = i - j where
                (i:j:_) = map a049084 $ reverse (1 : a027746_row n)
    -- Reinhard Zumkeller, May 15 2014
    
  • PARI
    A241917(n) = if(isprime(n), primepi(n), if(1>=omega(n), 0, my(f=factor(n)); if(f[#f~,2]>1, 0, primepi(f[#f~,1])-primepi(f[(#f~)-1,1])))); \\ Antti Karttunen, Jul 10 2024
  • Python
    from sympy import primefactors, primepi
    def a061395(n): return 0 if n==1 else primepi(primefactors(n)[-1])
    def a052126(n): return 1 if n==1 else n/primefactors(n)[-1]
    def a(n): return 0 if n==1 else a061395(n) - a061395(a052126(n)) # Indranil Ghosh, May 19 2017
    
  • Scheme
    (define (A241917 n) (- (A061395 n) (A061395 (A052126 n))))
    

Formula

a(n) = A061395(n) - A061395(A052126(n)).

A340608 The number of prime factors of n (A001222) is relatively prime to the maximum prime index of n (A061395).

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19, 22, 23, 25, 27, 28, 29, 31, 32, 33, 34, 37, 40, 41, 42, 43, 44, 46, 47, 48, 51, 53, 55, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 76, 77, 79, 80, 82, 83, 85, 88, 89, 90, 93, 94, 97, 98, 99
Offset: 1

Views

Author

Gus Wiseman, Jan 27 2021

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 sequence of terms together with their prime indices begins:
     2: {1}          22: {1,5}          44: {1,1,5}
     3: {2}          23: {9}            46: {1,9}
     4: {1,1}        25: {3,3}          47: {15}
     5: {3}          27: {2,2,2}        48: {1,1,1,1,2}
     7: {4}          28: {1,1,4}        51: {2,7}
     8: {1,1,1}      29: {10}           53: {16}
    10: {1,3}        31: {11}           55: {3,5}
    11: {5}          32: {1,1,1,1,1}    59: {17}
    12: {1,1,2}      33: {2,5}          60: {1,1,2,3}
    13: {6}          34: {1,7}          61: {18}
    15: {2,3}        37: {12}           62: {1,11}
    16: {1,1,1,1}    40: {1,1,1,3}      63: {2,2,4}
    17: {7}          41: {13}           64: {1,1,1,1,1,1}
    18: {1,2,2}      42: {1,2,4}        66: {1,2,5}
    19: {8}          43: {14}           67: {19}
		

Crossrefs

Note: Heinz numbers are given in parentheses below.
These are the Heinz numbers of the partitions counted by A200750.
The case of equality is A047993 (A106529).
The divisible instead of coprime version is A168659 (A340609).
The dividing instead of coprime version is A168659 (A340610), with strict case A340828 (A340856).
A001222 counts prime factors.
A006141 counts partitions whose length equals their minimum (A324522).
A051424 counts singleton or pairwise coprime partitions (A302569).
A056239 adds up prime indices.
A061395 selects the maximum prime index.
A067538 counts partitions whose length divides their sum (A316413).
A067538 counts partitions whose maximum divides their sum (A326836).
A112798 lists the prime indices of each positive integer.
A259936 counts singleton or pairwise coprime factorizations.
A326849 counts partitions whose sum divides length times maximum (A326848).
A327516 counts pairwise coprime partitions (A302696).

Programs

  • Mathematica
    Select[Range[100],GCD[PrimeOmega[#],PrimePi[FactorInteger[#][[-1,1]]]]==1&]

A253550 Shift one instance of the largest prime one step towards larger primes: a(1) = 1, for n>1: a(n) = (n / prime(g)) * prime(g+1), where g = A061395(n), index of the greatest prime dividing n.

Original entry on oeis.org

1, 3, 5, 6, 7, 10, 11, 12, 15, 14, 13, 20, 17, 22, 21, 24, 19, 30, 23, 28, 33, 26, 29, 40, 35, 34, 45, 44, 31, 42, 37, 48, 39, 38, 55, 60, 41, 46, 51, 56, 43, 66, 47, 52, 63, 58, 53, 80, 77, 70, 57, 68, 59, 90, 65, 88, 69, 62, 61, 84, 67, 74, 99, 96, 85, 78, 71, 76, 87, 110, 73, 120, 79, 82, 105, 92, 91, 102, 83, 112, 135, 86, 89
Offset: 1

Views

Author

Antti Karttunen, Jan 03 2015

Keywords

Crossrefs

Inverse: A252462.
Cf. A102750 (same terms, but with 2 instead of 1, sorted into ascending order).

Programs

Formula

a(1) = 1; for n>1: a(n) = A065091(A061395(n)) * A052126(n).
Other identities. For all n >= 1:
A252462(a(n)) = n. [A252462 works as an inverse function for this injection.]
a(n) <= A253560(n).

A241919 If n is a prime power, p_i^e, a(n) = i, (with a(1)=0), otherwise difference (i-j) of the indices of the two largest distinct primes p_i, p_j, i > j in the prime factorization of n: a(n) = A061395(n) - A061395(A051119(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 13 2014

Keywords

Comments

See A242411 and A241917 for other variants.

Crossrefs

Programs

  • Haskell
    a241919 1 = 0
    a241919 n = i - j where
                (i:j:_) = map a049084 $ reverse (1 : a027748_row n)
    -- Reinhard Zumkeller, May 15 2014
    
  • Python
    from sympy import factorint, primefactors, primepi
    def a061395(n): return 0 if n==1 else primepi(primefactors(n)[-1])
    def a053585(n):
        if n==1: return 1
        p = primefactors(n)[-1]
        return p**factorint(n)[p]
    def a051119(n): return n/a053585(n)
    def a(n): return a061395(n) - a061395(a051119(n)) # Indranil Ghosh, May 19 2017
  • Scheme
    (define (A241919 n) (- (A061395 n) (A061395 (A051119 n))))
    

Formula

a(n) = A061395(n) - A061395(A051119(n)).
Showing 1-10 of 518 results. Next