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

A286470 a(n) = maximal gap between indices of successive primes in the prime factorization of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 3, 1, 0, 0, 1, 0, 2, 2, 4, 0, 1, 0, 5, 0, 3, 0, 1, 0, 0, 3, 6, 1, 1, 0, 7, 4, 2, 0, 2, 0, 4, 1, 8, 0, 1, 0, 2, 5, 5, 0, 1, 2, 3, 6, 9, 0, 1, 0, 10, 2, 0, 3, 3, 0, 6, 7, 2, 0, 1, 0, 11, 1, 7, 1, 4, 0, 2, 0, 12, 0, 2, 4, 13, 8, 4, 0, 1, 2, 8, 9, 14, 5, 1, 0, 3, 3, 2, 0, 5, 0, 5, 1, 15, 0, 1, 0, 2, 10, 3, 0, 6, 6, 9, 4, 16, 3, 1
Offset: 1

Views

Author

Antti Karttunen, May 13 2017

Keywords

Examples

			For n = 70 = 2*5*7 = prime(1)*prime(3)*prime(4), the largest index difference occurs between prime(1) and prime(3), thus a(70) = 3-1 = 2.
		

Crossrefs

Cf. A286469 (version which considers the index of the smallest prime as the initial gap).
Cf. A000961 (positions of zeros).
Differs from A242411 for the first time at n=70, where a(70) = 2, while A242411(70) = 1.

Programs

  • Mathematica
    Table[If[Or[n == 1, PrimeNu@ n == 1], 0, Max@ Differences@ PrimePi[FactorInteger[n][[All, 1]]]], {n, 120}] (* Michael De Vlieger, May 16 2017 *)
  • Python
    from sympy import primepi, isprime, primefactors, divisors
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def x(n): return 1 if n==1 else divisors(n)[-2]
    def a(n): return 0 if n==1 or len(primefactors(n))==1 else max(a055396(x(n)) - a055396(n), a(x(n))) # Indranil Ghosh, May 17 2017
  • Scheme
    (define (A286470 n) (cond ((or (= 1 n) (= 1 (A001221 n))) 0) (else (max (- (A055396 (A032742 n)) (A055396 n)) (A286470 (A032742 n))))))
    

Formula

a(1) = 0, for n > 1, if A001221(n) = 1 [when n is a prime power], a(n) = 0, otherwise a(n) = max((A055396(A032742(n))-A055396(n)), a(A032742(n))).
For all n >= 1, a(n) <= A243055(n).

Extensions

Definition corrected by Zak Seidov, May 16 2017

A286473 Compound filter (for counting primes of form 4k+1, 4k+2 and 4k+3): a(n) = 4*A032742(n) + (A020639(n) mod 4), a(1) = 1.

Original entry on oeis.org

1, 6, 7, 10, 5, 14, 7, 18, 15, 22, 7, 26, 5, 30, 23, 34, 5, 38, 7, 42, 31, 46, 7, 50, 21, 54, 39, 58, 5, 62, 7, 66, 47, 70, 29, 74, 5, 78, 55, 82, 5, 86, 7, 90, 63, 94, 7, 98, 31, 102, 71, 106, 5, 110, 45, 114, 79, 118, 7, 122, 5, 126, 87, 130, 53, 134, 7, 138, 95, 142, 7, 146, 5, 150, 103, 154, 47, 158, 7, 162, 111, 166, 7, 170, 69, 174, 119, 178, 5, 182, 55
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Comments

For all i, j: a(i) = a(j) => A079635(i) = A079635(j). This follows because A079635(n) can be computed by recursively invoking a(n), without needing any other information.

Crossrefs

Cf. A001511, A007814, A065339, A079635, A083025 (some of the matched sequences).

Programs

  • Mathematica
    With[{k = 4}, Table[Function[{p, d}, k d + Mod[p, k] - k Boole[n == 1]] @@ {#, n/#} &@ FactorInteger[n][[1, 1]], {n, 91}]] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import divisors, primefactors
    def a(n): return 1 if n==1 else 4*divisors(n)[-2] + (min(primefactors(n))%4) # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286473 n) (if (= 1 n) n (+ (* 4 (A032742 n)) (modulo (A020639 n) 4))))
    

Formula

a(1) = 1, for n > 1, a(n) = 4*A032742(n) + (A020639(n) mod 4).

A286474 Compound filter: a(n) = 4*A032742(n) + (n mod 4), a(1) = 1.

Original entry on oeis.org

1, 6, 7, 8, 5, 14, 7, 16, 13, 22, 7, 24, 5, 30, 23, 32, 5, 38, 7, 40, 29, 46, 7, 48, 21, 54, 39, 56, 5, 62, 7, 64, 45, 70, 31, 72, 5, 78, 55, 80, 5, 86, 7, 88, 61, 94, 7, 96, 29, 102, 71, 104, 5, 110, 47, 112, 77, 118, 7, 120, 5, 126, 87, 128, 53, 134, 7, 136, 93, 142, 7, 144, 5, 150, 103, 152, 45, 158, 7, 160, 109, 166, 7, 168, 69, 174, 119, 176, 5, 182, 55
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[If[n == 1, 1, 4 (Divisors[n][[-2]]) + Mod[n, 4]], {n, 91}] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import divisors, primefactors
    def a(n): return 1 if n==1 else 4*divisors(n)[-2] + n%4 # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286474 n) (if (= 1 n) n (+ (* 4 (A032742 n)) (modulo n 4))))
    

Formula

a(1) = 1, for n > 1, a(n) = 4*A032742(n) + (n mod 4).

A286476 Compound filter: a(n) = 6*A032742(n) + (n mod 6), a(1) = 1.

Original entry on oeis.org

1, 8, 9, 16, 11, 18, 7, 26, 21, 34, 11, 36, 7, 44, 33, 52, 11, 54, 7, 62, 45, 70, 11, 72, 31, 80, 57, 88, 11, 90, 7, 98, 69, 106, 47, 108, 7, 116, 81, 124, 11, 126, 7, 134, 93, 142, 11, 144, 43, 152, 105, 160, 11, 162, 67, 170, 117, 178, 11, 180, 7, 188, 129, 196, 83, 198, 7, 206, 141, 214, 11, 216, 7, 224, 153, 232, 71, 234, 7, 242, 165, 250, 11, 252, 103
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Crossrefs

Programs

  • Mathematica
    With[{k = 6}, Table[If[n == 1, 1, k (Divisors[n][[-2]]) + Mod[n, k]], {n, 85}]] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import divisors
    def a(n): return 1 if n==1 else 6*divisors(n)[-2] + n%6 # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286476 n) (if (= 1 n) n (+ (* 6 (A032742 n)) (modulo n 6))))
    

Formula

a(1) = 1, for n > 1, a(n) = 6*A032742(n) + (n mod 6).

A286475 Compound filter (for counting primes of form 6k+1, 6k+2, 6k+3 and 6k+5): a(n) = 6*A032742(n) + (A020639(n) mod 6), a(1) = 1.

Original entry on oeis.org

1, 8, 9, 14, 11, 20, 7, 26, 21, 32, 11, 38, 7, 44, 33, 50, 11, 56, 7, 62, 45, 68, 11, 74, 35, 80, 57, 86, 11, 92, 7, 98, 69, 104, 47, 110, 7, 116, 81, 122, 11, 128, 7, 134, 93, 140, 11, 146, 43, 152, 105, 158, 11, 164, 71, 170, 117, 176, 11, 182, 7, 188, 129, 194, 83, 200, 7, 206, 141, 212, 11, 218, 7, 224, 153, 230, 67, 236, 7, 242, 165, 248, 11, 254, 107
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Examples

			For n = 55 = 5*11, a(n) = 6*A032742(55) + (5 modulo 6) = 6*11 + 5 = 71.
For n = 121 = 11*11, a(n) = 6*A032742(121) + (11 modulo 6) = 6*11 + 1 = 71.
For n = 91 = 7*13, a(n) = 6*A032742(91) + (7 modulo 6) = 6*13 + 1 = 79.
For n = 169 = 13*13, a(n) = 6*A032742(169) + (13 modulo 6) = 6*13 + 1 = 79.
		

Crossrefs

Programs

  • Mathematica
    With[{k = 6}, Table[Function[{p, d}, k d + Mod[p, k] - k Boole[n == 1]] @@ {#, n/#} &@ FactorInteger[n][[1, 1]], {n, 85}]] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import divisors, primefactors
    def a(n): return 1 if n==1 else 6*divisors(n)[-2] +(min(primefactors(n))%6) # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286475 n) (if (= 1 n) n (+ (* 6 (A032742 n)) (modulo (A020639 n) 6))))
    

Formula

a(1) = 1, for n > 1, a(n) = 6*A032742(n) + (A020639(n) mod 6).

A286471 If n is noncomposite, then a(n) = 0, otherwise 1 + difference between indices of the two smallest (not necessarily distinct) prime factors of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 11 2017

Keywords

Examples

			For n = 1, 2 and 3, which are all noncomposite numbers, a(n) = 0.
For n = 4 = 2*2 = prime(1)*prime(1), the difference 1-1 = 0, plus one is 1, thus a(4) = 1.
For n = 6 = 2*3 = prime(1)*prime(2), the difference 2-1 = 1, plus one is 2, thus a(6) = 2.
		

Crossrefs

Programs

  • Mathematica
    Table[If[Length@ # < 2, 0, First@ Differences@ PrimePi@ Take[#, 2] + 1] &@ Flatten[FactorInteger[n] /. {p_, e_} /; p > 0 :> ConstantArray[p, e]], {n, 118}] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import primepi, isprime, primefactors, divisors
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def a(n): return 0 if n==1 or isprime(n) else 1 + a055396(divisors(n)[-2]) - a055396(n) # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286471 n) (if (or (= 1 n) (= 1 (A001222 n))) 0 (+ 1 (- (A055396 (A032742 n)) (A055396 n)))))
    

Formula

If n is noncomposite, then a(n) = 0, otherwise a(n) = 1 + A055396(A032742(n)) - A055396(n).
Showing 1-6 of 6 results.