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

A338577 Primes p such that A013632(p)*A105161(p) > p.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 19, 23, 31, 47, 83, 89, 113, 199, 1327
Offset: 1

Views

Author

Robert Israel, Nov 03 2020

Keywords

Comments

Primes p such that (q-p)*(r-p) > p, where q and r are the next two primes after p.
a(16) > 10^8 if it exists.
Sequence is finite if Cramér's conjecture is true. - Chai Wah Wu, Nov 03 2020
Data from A002386 and A005250 show that a(16) > 18361375334787046697 if it exists. - Jason Yuen, Jun 13 2024

Examples

			a(5) = 11 is a member because 11 is prime, the next two primes are 13 and 17, and (13-11)*(17-11) = 12 > 11.
		

Crossrefs

Contains A338567.

Programs

  • Maple
    p:= 0: q:=2:r:= 3: R:= NULL:
    while p < 10^4 do
      p:= q: q:= r: r:= nextprime(r);
      if (q-p)*(r-p) > p then R:= R, p fi
    od:
    R;
  • Python
    from sympy import nextprime
    A338577_list, p, q, r = [], 2,3,5
    while p < 10**6:
        if (q-p)*(r-p) > p:
            A338577_list.append(p)
        p, q, r = q, r, nextprime(r) # Chai Wah Wu, Nov 03 2020

A171240 a(n) = n^d+d^n where d = A013632(n) is the distance to the next prime.

Original entry on oeis.org

2, 3, 17, 5, 57, 7, 18785, 7073, 593, 11, 2169, 13, 67137425, 4785713, 32993, 17, 131361, 19, 274878037265, 3486792401, 2097593, 23, 789730223201638705, 59604644783353249, 1125899907233249, 2541865845905, 134218457, 29, 536871753, 31
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 05 2009

Keywords

Crossrefs

Programs

  • Mathematica
    dnp[n_]:=Module[{d=NextPrime[n]-n},n^d+d^n]; Array[dnp,20](* Harvey P. Dale, Jun 23 2017 *)

Extensions

Definition and some values corrected - R. J. Mathar, Jun 04 2010
More terms from Harvey P. Dale, Jun 23 2017

A013597 a(n) = nextprime(2^n) - 2^n.

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 3, 3, 1, 9, 7, 5, 3, 17, 27, 3, 1, 29, 3, 21, 7, 17, 15, 9, 43, 35, 15, 29, 3, 11, 3, 11, 15, 17, 25, 53, 31, 9, 7, 23, 15, 27, 15, 29, 7, 59, 15, 5, 21, 69, 55, 21, 21, 5, 159, 3, 81, 9, 69, 131, 33, 15, 135, 29, 13, 131, 9, 3, 33, 29, 25, 11, 15, 29
Offset: 0

Views

Author

James Kilfiger (mapdn(AT)csv.warwick.ac.uk)

Keywords

Comments

A013597 and A092131 use different definitions of "nextprime(2)", namely A151800 vs A007918: A013597 assumes nextprime(2) = 3 = A151800(2), whereas A092131 assumes nextprime(2) = 2 = A007918(n). [Edited by M. F. Hasler, Sep 09 2015]
If (for n>0) a(n)=1, then n is a power of 2 and 2^n+1 is a Fermat prime. n=1,2,4,8,16 are probably the only indices with this property. - Franz Vrabec, Sep 27 2005
Conjecture: there are no Sierpiński numbers in the sequence. See A076336. - Thomas Ordowski, Aug 13 2017

Crossrefs

Programs

  • Maple
    A013597 := proc(n)
        nextprime(2^n)-2^n ;
    end proc:
    seq(A013597(n),n=0..40) ;
  • Mathematica
    Table[NextPrime[#] - # &[2^n], {n, 0, 73}] (* Michael De Vlieger, Aug 15 2017 *)
  • PARI
    a(n) = nextprime(2^n+1) - 2^n; \\ Michel Marcus, Nov 06 2015
    
  • Python
    from sympy import nextprime
    def A013597(n): return nextprime(m:=1<Chai Wah Wu, Dec 02 2024

Formula

a(n) = A151800(2^n) - 2^n = A013632(2^n). - R. J. Mathar, Nov 28 2016
Conjecture: a(n) < n^2/2 for n > 1. - Thomas Ordowski, Aug 13 2017

A033873 Difference between first prime > 10^n (A003617) and 10^n.

Original entry on oeis.org

1, 1, 1, 9, 7, 3, 3, 19, 7, 7, 19, 3, 39, 37, 31, 37, 61, 3, 3, 51, 39, 117, 9, 117, 7, 13, 67, 103, 331, 319, 57, 33, 49, 61, 193, 69, 67, 43, 133, 3, 121, 109, 63, 57, 31, 9, 121, 33, 193, 9, 151, 121, 327, 171, 31, 21, 3, 279, 159, 19, 7, 93, 447, 121, 57, 49, 49, 49, 99, 9
Offset: 0

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net)

Keywords

Examples

			The 23rd term is 117 since 10^23 + 117 = 100000000000000000000117 is prime and all of 100000000.., 100000....001, 1000...002 up through 1000...000116 are composite.
		

References

  • O'Hara, J. Rec. Math., 22 (1990), Table on page 278.

Crossrefs

Programs

Formula

a(n) = A003617(n) - 10^n = A013632(10^n). - Robert Israel, Aug 10 2015

Extensions

More terms from Patrick De Geest

A377282 Difference between n and the next prime-power (exclusive).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 3, 2, 1, 1, 2, 1, 4, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 5, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 2, 1, 3, 2, 1, 3, 2, 1, 4, 3, 2, 1, 2, 1, 6, 5, 4, 3, 2, 1, 2, 1, 2, 1, 6, 5, 4, 3, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2024

Keywords

Examples

			The next prime-power after 13 is 16, so a(12) = 3.
		

Crossrefs

For powers of 2 see A013597, A014210, A014234, A244508, A304521.
For prime instead of prime-power we have A013632.
For previous instead of next prime-power we have A276781, restriction A377289.
The restriction to the prime numbers is A377281.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, complement A361102.
A031218 gives the greatest prime-power <= n.
A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n+1,!PrimePowerQ[#]&]-n,{n,100}]
  • Python
    from itertools import count
    from sympy import factorint
    def A377282(n): return next(filter(lambda m:len(factorint(m))<=1, count(n+1)))-n # Chai Wah Wu, Oct 25 2024

Formula

a(n) = A000015(n) - n + 1 for n > 1.
a(prime(n)) = A377281(n).

A007920 Smallest number k such that n + k is prime.

Original entry on oeis.org

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

Views

Author

R. Muller

Keywords

Comments

a(n) = A007918(n) - n.

Examples

			a(22) = 1 because 22 + 1 = 23, the next higher prime.
a(23) = 0 because 23 is prime.
a(24) = 5 because 24 + 5 = 29, the next higher prime.
a(25) = 4 because 25 + 4 = 29, the next higher prime.
		

Crossrefs

Cf. A064722, A013632 (a slightly different version).

Programs

  • Mathematica
    distToPrime[n_] := If[PrimeQ[n], 0, NextPrime[n] - n]; Array[distToPrime, 110, 0] (* Harvey P. Dale, Sep 19 2011 *)
  • PARI
    a(n)=nextprime(n)-n

Extensions

More terms from Joanna S. Bartlett (s1117611(AT)cedarville.edu)

A053000 a(n) = (smallest prime > n^2) - n^2.

Original entry on oeis.org

2, 1, 1, 2, 1, 4, 1, 4, 3, 2, 1, 6, 5, 4, 1, 2, 1, 4, 7, 6, 1, 2, 3, 12, 1, 6, 1, 4, 3, 12, 7, 6, 7, 2, 7, 4, 1, 4, 3, 2, 1, 12, 13, 12, 13, 2, 13, 4, 5, 10, 3, 8, 3, 10, 1, 12, 1, 2, 7, 10, 7, 6, 3, 20, 3, 4, 1, 4, 13, 22, 3, 10, 5, 4, 1, 14, 3, 10, 5, 6, 21, 2, 9, 10, 1, 4, 15, 4, 9, 6, 1, 6, 3, 14
Offset: 0

Views

Author

N. J. A. Sloane, Feb 21 2000

Keywords

Comments

Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Record values are listed in A070317, their indices in A070316. - M. F. Hasler, Mar 23 2013
Conjecture: a(n) <= 1+phi(n) = 1+A000010(n), for n>0. This improves on Oppermann's conjecture, which says a(n) < n. - Jianglin Luo, Sep 22 2023

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A1.

Crossrefs

Programs

  • Magma
    [NextPrime(n^2) - n^2: n in [0..100]]; // Vincenzo Librandi, Jul 06 2015
    
  • Maple
    A053000 := n->nextprime(n^2)-n^2;
  • Mathematica
    nxt[n_]:=Module[{n2=n^2},NextPrime[n2]-n2]
    nxt/@Range[0,100]  (* Harvey P. Dale, Dec 20 2010 *)
  • PARI
    A053000(n)=nextprime(n^2)-n^2  \\ M. F. Hasler, Mar 23 2013
    
  • Python
    from sympy import nextprime
    def a(n): nn = n*n; return nextprime(nn) - nn
    print([a(n) for n in range(94)]) # Michael S. Branicky, Feb 17 2022

Formula

a(n) = A013632(n^2). - Robert Israel, Jul 06 2015

Extensions

More terms from James Sellers, Feb 22 2000

A378371 Distance between n and the least non prime power >= n, allowing 1.

Original entry on oeis.org

0, 4, 3, 2, 1, 0, 3, 2, 1, 0, 1, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Nov 28 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Examples

			The least non prime power >= 4 is 6, so a(4) = 2.
		

Crossrefs

Sequences obtained by adding n to each term are placed in parentheses below.
For prime we have A007920 (A151800), strict A013632.
For composite we have A010051 (A113646 except initial terms).
For perfect power we have A074984 (A377468)
For squarefree we have A081221 (A067535).
For nonsquarefree we have (A120327).
For non perfect power we have A378357 (A378358).
The opposite version is A378366 (A378367).
For prime power we have A378370, strict A377282 (A000015).
This sequence is A378371 (A378372).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,PrimePowerQ[#]&]-n,{n,100}]

Formula

a(n) = A378372(n) - n.

A378372 Least non prime power >= n, allowing 1.

Original entry on oeis.org

1, 6, 6, 6, 6, 6, 10, 10, 10, 10, 12, 12, 14, 14, 15, 18, 18, 18, 20, 20, 21, 22, 24, 24, 26, 26, 28, 28, 30, 30, 33, 33, 33, 34, 35, 36, 38, 38, 39, 40, 42, 42, 44, 44, 45, 46, 48, 48, 50, 50, 51, 52, 54, 54, 55, 56, 57, 58, 60, 60, 62, 62, 63, 65, 65, 66, 68
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Examples

			The least non prime power >= 4 is 6, so a(4) = 6.
		

Crossrefs

Sequences obtained by subtracting n from each term are placed in parentheses below.
For prime power we have A000015 (A378370).
For squarefree we have A067535 (A081221).
For composite we have A113646 (A010051).
For nonsquarefree we have A120327.
For prime we have A151800 (A007920), strict (A013632).
Run-lengths are 1 and A375708.
For perfect power we have A377468 (A074984).
For non-perfect power we have A378358 (A378357).
The opposite is A378367, distance A378366.
This sequence is A378372 (A378371).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,PrimePowerQ[#]&],{n,100}]

Formula

a(n) = A378371(n) + n.

A378357 Distance from n to the least non perfect power >= n.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0
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.
All terms are <= 2 because the only adjacent perfect powers are 8 and 9.

Crossrefs

The version for prime numbers is A007920, subtraction of A159477 or A007918.
The version for perfect powers is A074984, subtraction of A377468.
The version for squarefree numbers is A081221, subtraction of A067535.
Subtracting from n gives A378358, opposite A378363.
The opposite version is A378364.
The version for nonsquarefree numbers is A378369, subtraction of A120327.
The version for prime powers is A378370, subtraction of A000015.
The version for non prime powers is A378371, subtraction of A378372.
The version for composite numbers is A378456, subtraction of A113646.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289, seconds A376559.
A007916 lists the non perfect powers, differences A375706, seconds A376562.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
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,{n,100}]
  • Python
    from sympy import perfect_power
    def A378357(n): return 0 if n>1 and perfect_power(n)==False else 1 if perfect_power(n+1)==False else 2 # Chai Wah Wu, Nov 27 2024

Formula

a(n) = n - A378358(n).
Showing 1-10 of 51 results. Next