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.

Previous Showing 41-50 of 132 results. Next

A373149 Fully additive with a(2) = 1 and a(p) = prevprime(p) for odd primes p.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 5, 3, 4, 4, 7, 4, 11, 6, 5, 4, 13, 5, 17, 5, 7, 8, 19, 5, 6, 12, 6, 7, 23, 6, 29, 5, 9, 14, 8, 6, 31, 18, 13, 6, 37, 8, 41, 9, 7, 20, 43, 6, 10, 7, 15, 13, 47, 7, 10, 8, 19, 24, 53, 7, 59, 30, 9, 6, 14, 10, 61, 15, 21, 9, 67, 7, 71, 32, 8, 19, 12, 14, 73, 7, 8, 38, 79, 9, 16, 42, 25, 10, 83, 8, 16
Offset: 1

Views

Author

Antti Karttunen, Jun 02 2024

Keywords

Crossrefs

Programs

  • Mathematica
    A373149[n_] := If[n == 1, 0, Total[MapApply[#2*If[# == 2, 1, NextPrime[#, -1]] &, FactorInteger[n]]]];
    Array[A373149, 100] (* Paolo Xausa, Dec 17 2024 *)
  • PARI
    A373149(n) = { my(f = factor(n)); sum(i = 1, #f~, f[i, 2]*if(2==f[i, 1], 1, precprime(f[i, 1] - 1))); };

Formula

Additive with a(p^e) = e*A064989(p).

A378363 Greatest number <= n that is 1 or not a perfect-power.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 7, 7, 7, 10, 11, 12, 13, 14, 15, 15, 17, 18, 19, 20, 21, 22, 23, 24, 24, 26, 26, 28, 29, 30, 31, 31, 33, 34, 35, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 65, 66, 67
Offset: 1

Views

Author

Gus Wiseman, Nov 24 2024

Keywords

Comments

Perfect-powers (A001597) are 1 and numbers with a proper integer root, complement A007916.

Examples

			In the non-perfect-powers ... 5, 6, 7, 10, 11 ... the greatest term <= 8 is 7, so a(8) = 7.
		

Crossrefs

The union is A007916, complement A001597.
The version for prime numbers is A007917 or A151799, opposite A159477.
The version for prime-powers is A031218, opposite A000015.
The version for squarefree numbers is A067535, opposite A070321.
The version for perfect-powers is A081676, opposite A377468.
The version for composite numbers is A179278, opposite A113646.
Terms appearing multiple times are A375704, opposite A375703.
The run-lengths are A375706.
Terms appearing only once are A375739, opposite A375738.
The version for nonsquarefree numbers is A378033, opposite A120327.
The opposite version is A378358.
Subtracting n gives A378364, opposite A378357.
The version for non-prime-powers is A378367 (subtracted A378371), opposite A378372.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect-powers, differences A053289.
A007916 lists the non-perfect-powers, differences A375706.
A069623 counts perfect-powers <= n.
A076411 counts perfect-powers < n.
A131605 lists perfect-powers that are not prime-powers.
A377432 counts perfect-powers between primes, zeros A377436.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[NestWhile[#-1&,n,#>1&&perpowQ[#]&],{n,100}]
  • Python
    from sympy import mobius, integer_nthroot
    def A378363(n):
        def f(x): return int(1-sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        a = n-f(n)
        m, k = a, f(a)+a
        while m != k: m, k = k, f(k)+a
        return m # Chai Wah Wu, Nov 26 2024

A136548 a(n) = max {k >= 1 | sigma(k) <= n}.

Original entry on oeis.org

1, 1, 2, 3, 3, 5, 5, 7, 7, 7, 7, 11, 11, 13, 13, 13, 13, 17, 17, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 29, 29, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 41, 41, 43, 43, 43, 43, 47, 47, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 61, 61, 61, 61, 61, 61, 67, 67, 67, 67, 71, 71
Offset: 1

Views

Author

Roger L. Bagula, Mar 26 2008

Keywords

Comments

Old name was "Extended 'previous prime' version 2".
This is the same as A151799 if n >= 3 and falls back to 1, if no prime smaller than n exists.
a(n+1) is the largest number k such that A007955(k) <= n, where A007955 is the product of divisors. - Jaroslav Krizek, Apr 01 2010
For every k >= 1, the equation n - a(n) = k has infinitely many solutions. - Bernard Schott, Mar 05 2019

References

  • P. Tauvel, Exercices d'Algèbre Générale et d'Arithmétique, Dunod, 2004, Exercice 18 p. 204.

Crossrefs

Cf. A000203 (sigma), A000142, A006530, A151799.

Programs

Formula

a(n) = A006530(A000142(n-1)). - Michel Marcus, Jun 20 2014
For n > 1, a(n) < n. If p is prime, a(p+1) = p. - Bernard Schott, Mar 05 2019

Extensions

Definition clarified by N. J. A. Sloane, Mar 14 2019 based on a suggestion from Jaroslav Krizek, Mar 01 2010.

A245396 Largest prime not exceeding prime(n)^(1 + 1/n).

Original entry on oeis.org

3, 5, 7, 11, 17, 19, 23, 23, 31, 37, 41, 47, 53, 53, 59, 67, 73, 73, 83, 83, 89, 89, 97, 107, 113, 113, 113, 113, 127, 131, 139, 151, 157, 157, 167, 173, 179, 181, 181, 193, 199, 199, 211, 211, 211, 223, 233, 241, 251, 251, 257, 263, 263, 277, 283, 283, 293, 293, 293, 307, 307, 317, 331, 337
Offset: 1

Views

Author

M. F. Hasler, Nov 03 2014

Keywords

Comments

Firoozbakht's conjecture, prime(n+1) < prime(n)^(1 + 1/n), is equivalent to a(n) > prime(n). See also A182134.
Here prime(n) = A000040(n). The conjecture is also equivalent to a(n) - prime(n) >= A001223(n), the n-th gap between primes. See also A246778(n) = floor(prime(n)^(1 + 1/n)) - prime(n).
It is also conjectured that the equality a(n) - prime(n) = A001223(n) holds only for n in the set {1, 2, 3, 4, 8}, see A246782. a(n) is also largest prime less than prime(n)^(1 + 1/n), since prime(n)^(1 + 1/n) is never prime. - Farideh Firoozbakht, Nov 03 2014
a(n) = A007917(A249669(n)) = A244365(n,A182134(n)) = A006530(A245722(n)). - Reinhard Zumkeller, Nov 18 2014

Crossrefs

Programs

  • Haskell
    a245396 n = a244365 n (a182134 n)  -- Reinhard Zumkeller, Nov 16 2014
  • Maple
    seq(prevprime(ceil(ithprime(n)^(1+1/n))),n=1..100); # Robert Israel, Nov 03 2014
  • Mathematica
    Table[NextPrime[Prime[n]^(1 + 1/n), -1], {n, 64}] (* Farideh Firoozbakht, Nov 03 2014 *)
  • PARI
    a(n)=precprime(prime(n)^(1+1/n))
    
  • PARI
    a(n)=precprime(sqrtnint(prime(n)^(n+1),n)) \\ Charles R Greathouse IV, Oct 29 2018
    

Formula

A245396 = A007917 o A249669, i.e., a(n) = A007917(A249669(n)). Although one could say "less than" in the definition of this sequence, one cannot use A151799 in this formula because for n = 2 and n = 4, one has a(n) = A249669(n).

A285703 a(n) = A000203(A064216(n)).

Original entry on oeis.org

1, 3, 4, 6, 7, 8, 12, 12, 14, 18, 18, 20, 13, 15, 24, 30, 24, 24, 32, 36, 38, 42, 28, 44, 31, 42, 48, 32, 54, 54, 60, 42, 48, 62, 60, 68, 72, 39, 48, 74, 31, 80, 56, 72, 84, 72, 90, 72, 90, 56, 98, 102, 72, 104, 108, 96, 110, 80, 84, 84, 57, 114, 40, 114, 126, 128, 108, 60, 132, 138, 132, 96, 96, 93, 140, 150, 98, 120, 152, 144, 120, 158, 96, 164, 133, 126
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[DivisorSigma[1, #] &@ If[n == 1, 1, Apply[Times, FactorInteger[2 n - 1] /. {p_, e_} /; p > 2 :> NextPrime[p, -1]^e]], {n, 86}] (* Michael De Vlieger, Apr 26 2017 *)
  • Scheme
    (define (A285703 n) (A000203 (A064216 n)))

Formula

a(n) = A000203(A064216(n)).
Sum_{k=1..n} a(k) ~ c * n^2, where c = Product_{p prime} (p^3/((p+1)*(p^2-q(p)))) = 0.8168476756..., where q(p) = prevprime(p) (A151799) if p > 2 and q(2) = 1. - Amiram Eldar, Dec 21 2023

A013638 a(n) = prevprime(n)*nextprime(n).

Original entry on oeis.org

10, 15, 21, 35, 55, 77, 77, 77, 91, 143, 187, 221, 221, 221, 247, 323, 391, 437, 437, 437, 551, 667, 667, 667, 667, 667, 713, 899, 1073, 1147, 1147, 1147, 1147, 1147, 1271, 1517, 1517, 1517, 1591, 1763, 1927
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a013638 n = a151799 n * a151800 n  -- Reinhard Zumkeller, May 22 2015
  • Maple
    [ seq(prevprime(i)*nextprime(i),i=3..70) ];
  • Mathematica
    a[n_] := NextPrime[n, -1] NextPrime[n];
    Table[a[n], {n, 3, 50}] (* Jean-François Alcover, Aug 02 2018 *)

Formula

a(n) = A151799(n)*A151800(n). - Reinhard Zumkeller, May 22 2015

A030460 Previous prime concatenated with this prime p is a prime.

Original entry on oeis.org

3, 37, 89, 157, 163, 173, 211, 239, 257, 263, 269, 277, 337, 359, 379, 439, 479, 521, 541, 547, 607, 659, 673, 683, 733, 947, 977, 1019, 1039, 1187, 1193, 1213, 1229, 1277, 1373, 1459, 1471, 1663, 1693, 1721, 1747, 1867, 1979, 2081, 2179
Offset: 1

Views

Author

Keywords

Comments

Terms 157, 257, 263, 541, 1187, 1459, 2179 also belong to A030459. [Carmine Suriano, Jan 27 2011]

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[400]],2,1], PrimeQ[FromDigits[ Flatten[IntegerDigits/@#]]]&]][[2]] (* Harvey P. Dale, Dec 23 2011 *)
  • PARI
    c=0; o=2; s=1; forprime(p=3,default(primelimit), p>s & s*=10; isprime(o*s+o=p) & write("b030460.txt",c++," ",p))  \\ M. F. Hasler, Feb 06 2011

Formula

A030459(n) = A151799(a(n)). - M. F. Hasler, Feb 06 2011
A030461(n) = concat(A030459(n),a(n)) = A045533( A000720( A030459(n))). - M. F. Hasler, Feb 06 2011

Extensions

Offset changed from 0 to 1 by M. F. Hasler, Feb 06 2011

A054805 Second term of strong prime quartets: prime(m+1)-prime(m) > prime(m+2)-prime(m+1) > prime(m+3)-prime(m+2).

Original entry on oeis.org

37, 67, 97, 223, 277, 307, 457, 479, 613, 631, 719, 751, 853, 877, 929, 1087, 1297, 1423, 1447, 1471, 1543, 1657, 1663, 1693, 1733, 1777, 1783, 1847, 1861, 1867, 1987, 1993, 2053, 2137, 2333, 2371, 2377, 2459, 2467, 2503, 2521, 2531, 2579, 2609, 2647
Offset: 1

Views

Author

Henry Bottomley, Apr 10 2000

Keywords

Comments

Second member of pairs of consecutive primes in A051634 (strong primes). - M. F. Hasler, Oct 27 2018

Crossrefs

Cf. A051634, A051635; A054800 .. A054803: members of balanced prime quartets (= consecutive primes in arithmetic progression); A054804 .. A054818: members of strong prime quartet, quintet, sextet; A054819 .. A054840: members of weak prime quartet, quintet, sextet, septets.

Formula

a(n) = nextprime(A054804(n))= prevprime(A054806(n)), nextprime = A151800, prevprime = A151799. - M. F. Hasler, Oct 27 2018

Extensions

Offset corrected to 1 by M. F. Hasler, Oct 27 2018
Definition clarified by N. J. A. Sloane, Aug 28 2021

A285705 a(n) = 2*n - A285703(n) = 2*n - A000203(A064216(n)).

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 2, 4, 4, 2, 4, 4, 13, 13, 6, 2, 10, 12, 6, 4, 4, 2, 18, 4, 19, 10, 6, 24, 4, 6, 2, 22, 18, 6, 10, 4, 2, 37, 30, 6, 51, 4, 30, 16, 6, 20, 4, 24, 8, 44, 4, 2, 34, 4, 2, 16, 4, 36, 34, 36, 65, 10, 86, 14, 4, 4, 26, 76, 6, 2, 10, 48, 50, 55, 10, 2, 56, 36, 6, 16, 42, 6, 70, 4, 37, 46, 6, 98, 16, 6, 2, 4, 58, 76, 100, 10, 2, 52, 4, 2, 16, 60, 54
Offset: 1

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Comments

Question: Are all terms positive? - Yes, they are, see A286385. (Note added Jul 24 2022).
For listening: fast tempo and percussive instrument, default "modulo 88" pitch mapping, all 10000 terms.

Crossrefs

Programs

  • Mathematica
    Table[2 n - DivisorSigma[1, #] &@ If[n == 1, 1, Apply[Times, FactorInteger[2 n - 1] /. {p_, e_} /; p > 2 :> NextPrime[p, -1]^e]], {n, 103}] (* Michael De Vlieger, Apr 26 2017 *)
  • PARI
    A064989(n) = { my(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); };
    A285705(n) = (n+n - sigma(A064989(n+n-1))); \\ Antti Karttunen, Jul 24 2022
    
  • Scheme
    (define (A285705 n) (- (* 2 n) (A285703 n)))

Formula

a(n) = 2*n - A285703(n) = 2*n - A000203(A064216(n)).
a(n) = 1 + A286385(A064216(n)). - Antti Karttunen, Jul 24 2022
Sum_{k=1..n} a(k) ~ c * n^2, where c = 1 - Product_{p prime} (p^3/((p+1)*(p^2-q(p)))) = 0.1831523243..., where q(p) = prevprime(p) (A151799) if p > 2 and q(2) = 1. - Amiram Eldar, Dec 21 2023

A349382 Dirichlet convolution of A064989 with A346234 (Dirichlet inverse of A003961), where A003961 and A064989 are fully multiplicative sequences that shift the prime factorization of n one step towards larger and smaller primes respectively.

Original entry on oeis.org

1, -2, -3, -2, -4, 6, -6, -2, -6, 8, -6, 6, -6, 12, 12, -2, -6, 12, -6, 8, 18, 12, -10, 6, -12, 12, -12, 12, -8, -24, -8, -2, 18, 12, 24, 12, -10, 12, 18, 8, -6, -36, -6, 12, 24, 20, -10, 6, -30, 24, 18, 12, -12, 24, 24, 12, 18, 16, -8, -24, -8, 16, 36, -2, 24, -36, -10, 12, 30, -48, -6, 12, -8, 20, 36, 12, 36, -36
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2021

Keywords

Comments

Multiplicative because both A064989 and A346234 are.

Crossrefs

Cf. A003961, A064989, A151799, A151800, A346234, A349381 (Dirichlet inverse), A349383 (sum with it).
Cf. also A349355, A349356.

Programs

  • Mathematica
    f[p_, e_] := If[p == 2, -2, NextPrime[p, -1]^e - NextPrime[p]*NextPrime[p, -1]^(e - 1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 17 2021 *)
  • PARI
    A003961(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
    A064989(n) = { my(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); };
    A346234(n) = (moebius(n)*A003961(n));
    A349382(n) = sumdiv(n,d,A064989(n/d)*A346234(d));

Formula

a(n) = Sum_{d|n} A064989(n/d) * A346234(d).
a(n) = A349383(n) - A349381(n).
Multiplicative with a(p^e) = -2 if p = 2, and prevprime(p)^e - nextprime(p) * prevprime(p)^(e-1) otherwise, where prevprime function is A151799 and nextprime function is A151800. - Amiram Eldar, Nov 17 2021
Previous Showing 41-50 of 132 results. Next