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.

A079277 Largest integer k < n such that any prime factor of k is also a prime factor of n.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 4, 3, 8, 1, 9, 1, 8, 9, 8, 1, 16, 1, 16, 9, 16, 1, 18, 5, 16, 9, 16, 1, 27, 1, 16, 27, 32, 25, 32, 1, 32, 27, 32, 1, 36, 1, 32, 27, 32, 1, 36, 7, 40, 27, 32, 1, 48, 25, 49, 27, 32, 1, 54, 1, 32, 49, 32, 25, 64, 1, 64, 27, 64, 1, 64, 1, 64, 45, 64, 49, 72, 1, 64, 27
Offset: 2

Views

Author

Istvan Beck (istbe(AT)online.no), Feb 07 2003

Keywords

Comments

The function a(n) complements Euler's phi-function: 1) a(n)+phi(n) = n if n is a power of a prime (actually, in A285710). 2) It seems also that a(n)+phi(n) >= n for "almost all numbers" (see A285709, A208815). 3) a(2n) = n+1 if and only if n is a Mersenne prime. 4) Lim a(n^k)/n^k =1 if n has at least two prime factors and k goes to infinity.
From Michael De Vlieger, Apr 26 2017: (Start)
In other words, largest integer k < n such that k | n^e with integer e >= 0.
Penultimate term of row n in A162306. (The last term of row n in A162306 is n.)
For prime p, a(p) = 1. More generally, for n with omega(n) = 1, that is, a prime power p^e with e > 0, a(p^e) = p^(e - 1).
For n with omega(n) > 1, a(n) does not divide n. If n = pq with q = p + 2, then p^2 < n though p^2 does not divide n, yet p^2 | n^e with e > 1. If n has more than 2 distinct prime divisors p, powers p^m of these divisors will appear in the range (1..n-1) such that p^m > n/lpf(n) (lpf(n) = A020639(n)). Since a(n) is the largest of these, a(n) is not a divisor of n.
If a(n) does not divide n, then a(n) appears last in row n of A272618.
(End)

Examples

			a(10)=8 since 8 is the largest integer< 10 that can be written using only the primes 2 and 5. a(78)=72 since 72 is the largest number less than 78 that can be written using only the primes 2, 3 and 13. (78=2*3*13).
		

Crossrefs

Programs

  • Mathematica
    Table[If[n == 2, 1, Module[{k = n - 2, e = Floor@ Log2@ n}, While[PowerMod[n, e, k] != 0, k--]; k]], {n, 2, 81}] (* Michael De Vlieger, Apr 26 2017 *)
  • PARI
    a(n) = {forstep(k = n - 1, 2, -1, f = factor(k); okk = 1; for (i=1, #f~, if ((n % f[i,1]) != 0, okk = 0; break;)); if (okk, return (k));); return (1);} \\ Michel Marcus, Jun 11 2013
    
  • PARI
    A007947(n) = factorback(factorint(n)[, 1]); \\ Andrew Lelechenko, May 09 2014
    A079277(n) = { my(r); if((n > 1 && !bitand(n,(n-1))), (n/2), r=A007947(n); if(1==n,0,k = n-1; while(A007947(k*n) <> r, k = k-1); k)); }; \\ Antti Karttunen, Apr 26 2017
    
  • Python
    from sympy import divisors
    from sympy.ntheory.factor_ import core
    def a007947(n): return max(d for d in divisors(n) if core(d) == d)
    def a(n):
        k=n - 1
        while True:
            if a007947(k*n) == a007947(n): return k
            else: k-=1
    print([a(n) for n in range(2, 101)]) # Indranil Ghosh, Apr 26 2017

Formula

Largest k < n with rad(kn) = rad(n), where rad = A007947.

A285699 a(1) = 1; for n > 1, a(n) = n - A079277(n).

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 4, 6, 2, 10, 3, 12, 6, 6, 8, 16, 2, 18, 4, 12, 6, 22, 6, 20, 10, 18, 12, 28, 3, 30, 16, 6, 2, 10, 4, 36, 6, 12, 8, 40, 6, 42, 12, 18, 14, 46, 12, 42, 10, 24, 20, 52, 6, 30, 7, 30, 26, 58, 6, 60, 30, 14, 32, 40, 2, 66, 4, 42, 6, 70, 8, 72, 10, 30, 12, 28, 6, 78, 16, 54, 18, 82, 3, 60, 22, 6, 24, 88, 9, 42, 28, 12, 30, 70, 15, 96, 34, 18, 20
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Comments

The scatter plot has unusual "rays".

Crossrefs

Programs

  • Mathematica
    Table[n - If[n <= 2, n - 1, Module[{k = n - 2, e = Floor@ Log2@ n}, While[PowerMod[n, e, k] != 0, k--]; k]], {n, 100}] (* Michael De Vlieger, Apr 26 2017 *)
  • Python
    from sympy import divisors
    from sympy.ntheory.factor_ import core
    def a007947(n): return max(i for i in divisors(n) if core(i) == i)
    def a079277(n):
        k=n - 1
        while True:
            if a007947(k*n) == a007947(n): return k
            else: k-=1
    def a(n): return 1 if n<2 else n - a079277(n)
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Apr 26 2017
  • Scheme
    (define (A285699 n) (if (= 1 n) n (- n (A079277 n))))
    

Formula

a(1) = 1; for n > 1, a(n) = n - A079277(n).
Other identities. For all n >= 1:
a(A285710(n)) = A000010(A285710(n)). [A285710 gives all such matches.]

A285709 a(n) = A000010(n) - A285699(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 2, 0, 0, 4, 0, 4, 0, 4, 0, 2, 0, 2, 0, 0, 0, 5, 0, 0, 14, 14, 14, 8, 0, 12, 12, 8, 0, 6, 0, 8, 6, 8, 0, 4, 0, 10, 8, 4, 0, 12, 10, 17, 6, 2, 0, 10, 0, 0, 22, 0, 8, 18, 0, 28, 2, 18, 0, 16, 0, 26, 10, 24, 32, 18, 0, 16, 0, 22, 0, 21, 4, 20, 50, 16, 0, 15, 30, 16, 48, 16, 2, 17, 0, 8, 42, 20, 0, 26, 0, 8, 24, 10, 0, 24, 0, 30, 42, 34, 0, 30, -2
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Comments

The scatter plot has unusual "rays".

Crossrefs

Cf. A285710 (positions of zeros), A208815 (of negative terms).

Programs

  • Mathematica
    Table[EulerPhi@ n - (n - If[n <= 2, n - 1, Module[{k = n - 2, e = Floor@ Log2@ n}, While[PowerMod[n, e, k] != 0, k--]; k]]), {n, 115}] (* Michael De Vlieger, Apr 26 2017 *)
  • PARI
    A007947(n) = factorback(factorint(n)[, 1]); \\ From Andrew Lelechenko, May 09 2014
    A079277(n) = { my(r); if((n > 1 && !bitand(n,(n-1))), (n/2), r=A007947(n); if(1==n,0,k = n-1; while(A007947(k*n) <> r, k = k-1); k)); };
    A285709(n) = if(!n,n,(eulerphi(n)+A079277(n))-n);
    
  • Python
    from sympy import divisors, totient
    from sympy.ntheory.factor_ import core
    def a007947(n): return max(i for i in divisors(n) if core(i) == i)
    def a079277(n):
        k=n - 1
        while True:
            if a007947(k*n) == a007947(n): return k
            else: k-=1
    def a285699(n): return 1 if n<2 else n - a079277(n)
    def a(n): return totient(n) - a285699(n)
    print([a(n) for n in range(1, 116)]) # Indranil Ghosh, Apr 26 2017
  • Scheme
    (define (A285709 n) (- (A000010 n) (A285699 n)))
    

Formula

a(n) = A000010(n) - A285699(n).
For n > 1, a(n) = (A000010(n) + A079277(n)) - n = A079277(n) - A051953(n).

A285711 a(n) = gcd(A051953(n), A079277(n)), a(1) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 1, 4, 3, 2, 1, 1, 1, 8, 1, 8, 1, 4, 1, 4, 9, 4, 1, 2, 5, 2, 9, 16, 1, 1, 1, 16, 1, 2, 1, 8, 1, 4, 3, 8, 1, 6, 1, 8, 3, 8, 1, 4, 7, 10, 1, 4, 1, 12, 5, 1, 3, 2, 1, 2, 1, 32, 1, 32, 1, 2, 1, 4, 1, 2, 1, 16, 1, 2, 5, 8, 1, 18, 1, 16, 27, 2, 1, 3, 1, 4, 1, 16, 1, 3, 1, 16, 3, 16, 1, 1, 1, 8, 3, 20, 1, 2, 1, 8, 3, 2, 1, 24, 1, 10, 3, 2, 1, 6, 1
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[GCD[n - EulerPhi@ n, If[n <= 2, 1, Module[{k = n - 2, e = Floor@ Log2@ n}, While[PowerMod[n, e, k] != 0, k--]; k]]], {n, 115}] (* Michael De Vlieger, Apr 26 2017 *)
  • Python
    from sympy import divisors, totient, gcd
    from sympy.ntheory.factor_ import core
    def a007947(n): return max(i for i in divisors(n) if core(i) == i)
    def a079277(n):
        k=n - 1
        while True:
            if a007947(k*n) == a007947(n): return k
            else: k-=1
    def a(n): return 1 if n==1 else gcd(n - totient(n), a079277(n))
    print([a(n) for n in range(1, 151)]) # Indranil Ghosh, Apr 26 2017
  • Scheme
    (define (A285711 n) (if (= 1 n) n (gcd (A051953 n) (A079277 n))))
    

Formula

a(1) = 1; for n > 1, a(n) = gcd(A051953(n), A079277(n)).

A208815 n for which A079277(n) + phi(n) < n.

Original entry on oeis.org

115, 329, 1243, 2119, 2171, 4709, 4777, 4811, 6593, 6631, 6707, 6821, 11707, 11983, 12029, 14597, 15463, 16793, 23809, 23867, 23983, 24041, 24331, 29047, 29171, 29357, 29543, 50357, 50579, 67937, 68183, 68347, 68429, 77873, 78389, 78733, 79421, 83351, 83453, 102413
Offset: 1

Views

Author

Robert Israel, Mar 01 2012

Keywords

Comments

Includes (among other terms, see below) semiprimes pq where p and q are primes with p^k-p+1 < q < p^k for an integer k>1. In particular, by the Prime Number Theorem this sequence is infinite. - clarified by Antti Karttunen, Apr 26 2017
From Antti Karttunen, Apr 26 2017: (Start)
Numbers n for which A051953(n) > A079277(n).
Factorization of terms a(1) .. a(29): 5*23, 7*47, 11*113, 13*163, 13*167, 17*277, 17*281, 17*283, 19*347, 19*349, 19*353, 19*359, 23*509, 23*521, 23*523, 11*1327, 7*47*47, 7*2399, 29*821, 29*823, 29*827, 29*829, 29*839, 31*937, 31*941, 31*947, 31*953, 37*1361, 37*1367. Note that a(17) = 15463 is not a semiprime.
(End)

Examples

			A079277(115) + phi(115) = 25 + 88 = 113 < 115 so 115 is in the sequence, where phi = A000010.
		

Crossrefs

Positions of negative terms in A285709.

Programs

  • Mathematica
    Select[Range[2, 10^4], Function[n, If[n == 2, 1, Module[{k = n - 2, e = Floor@ Log2@ n}, While[PowerMod[n, e, k] != 0, k--]; k]] + EulerPhi@ n < n]] (* or *)
    Do[If[If[n == 2, 1, Module[{k = n - 2, e = Floor@ Log2@ n}, While[PowerMod[n, e, k] != 0, k--]; k]] + EulerPhi@ n < n, Print@ n], {n, 2, 10^5}] (* Michael De Vlieger, Apr 27 2017 *)

Extensions

a(28)-a(29) from Antti Karttunen, Apr 26 2017
a(30)-a(40) from David A. Corneth, Apr 26 2017
Showing 1-5 of 5 results.