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.

A013598 a(n) = nextprime(3^n)-3^n.

Original entry on oeis.org

1, 2, 2, 2, 2, 8, 4, 16, 2, 4, 2, 20, 16, 8, 2, 2, 26, 34, 10, 56, 8, 56, 4, 32, 2, 14, 2, 16, 26, 130, 4, 16, 70, 70, 34, 22, 2, 50, 8, 82, 118, 70, 4, 52, 8, 46, 68, 52, 56, 16, 28, 34, 50, 26, 28, 20, 62, 4, 158, 64, 16, 34, 122, 2, 92, 64, 28, 230, 20
Offset: 0

Views

Author

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

Keywords

Crossrefs

Cf. A013604.

Programs

  • Maple
    seq(nextprime(3^i)-3^i,i=0..100);
  • Mathematica
    np[n_]:=Module[{c=3^n},NextPrime[c]-c]; Array[np,80,0] (* Harvey P. Dale, Jul 14 2014 *)

Formula

a(n) = A151800(3^n)-3^n = A013632(3^n). - R. J. Mathar, Nov 28 2016

Extensions

Corrected by Harvey P. Dale, Jul 14 2014

A104094 Largest prime <= 9^n.

Original entry on oeis.org

7, 79, 727, 6553, 59029, 531383, 4782961, 43046623, 387420479, 3486784393, 31381059607, 282429536453, 2541865828309, 22876792454939, 205891132094623, 1853020188851807, 16677181699666513, 150094635296999111
Offset: 1

Views

Author

Cino Hilliard, Mar 03 2005

Keywords

Crossrefs

Cf. A013604.
Largest prime <= b^n: 2^n-A013603(n), 3^n-A013604(n), 4^n-A013606(n), 5^n-A013605(n), 6^n-A013607(n), 7^n-A013608(n), 8^n-A013603(3*n), 10^n-A033874(n).

Programs

  • Maple
    f:= n -> prevprime(9^n):
    map(f, [$1..30]); # Robert Israel, Aug 12 2019
  • Mathematica
    NextPrime[#,-1]&/@(9^Range[20]) (* Harvey P. Dale, Apr 21 2024 *)
  • PARI
    g(n,b) = for(x=0,n,print1(precprime(b^x)","))

Formula

a(n) = 9^n - A013604(2*n) = A001019(n) - A013604(2*n), n > 0. A.H.M. Smeets, Aug 12 2019

A338155 (Smallest prime >= 3^n) - (largest prime <= 3^n).

Original entry on oeis.org

0, 4, 6, 4, 10, 6, 24, 10, 6, 22, 36, 74, 30, 10, 18, 124, 44, 20, 70, 16, 60, 6, 52, 30, 34, 22, 42, 48, 144, 30, 20, 104, 122, 90, 50, 12, 52, 18, 140, 156, 72, 126, 126, 42, 68, 90, 98, 100, 66, 74, 50, 174, 30, 38, 126, 72, 30, 378, 102, 176, 108, 130
Offset: 1

Views

Author

A.H.M. Smeets, Oct 25 2020

Keywords

Comments

Size of prime gap containing the number 3^n, for n > 1.
From Gauss's prime counting function approximation, the expected gap size should be approximately n*log(3), however, the observed values seem to be closer to n*log(8.72) ~ n*log(3^2) = n*A016632.

Crossrefs

Cf. A058249 (for 2^n), A338419 (for 5^n), A338376 (for 6^n), A038804 (for 10^n).

Programs

  • Mathematica
    a[1] = 0; a[n_] := First @ Differences @ NextPrime[3^n, {-1, 1}]; Array[a, 60] (* Amiram Eldar, Oct 30 2020 *)
  • PARI
    a(n) = if (n==1, 0, nextprime(3^n) - precprime(3^n)); \\ Michel Marcus, Oct 25 2020

Formula

a(n) = A013598(n) + A013604(n) for n > 1.

A180303 a(n) = smallest number such that 3^n-2^a(n) is prime, or -1 if no such number exists.

Original entry on oeis.org

0, 1, 2, 1, 1, 1, 3, 3, 1, 7, 4, 11, 6, 3, 4, 9, 9, 5, 6, 3, 2, 1, 7, 35, 12, 29, 10, 13, 6, 11, 2, 21, 8, 27, 11, -1, 1, 17, 10, -1, 1, 37, 8, 9, 16, 61, 23, 23, 17, 27, 4, 7, 2, 7, 7, 39, 58, 81, 30, 17, 60, 3, 8, 13, 18, -1, 20, 101, 4, 73, 27, 17, 2, 17, 19, 13, 41, 53, 44, 111, 34, 13
Offset: 1

Views

Author

Carl R. White, Aug 25 2010

Keywords

Comments

From Carl R. White, Oct 23 2010: (Start)
Entries where a(n) = 1 can be found in A014224.
Entries where a(n) = -1 can be found in A181484. (End)

Examples

			3^1-2^0 = 2, so a(1)=0; no other terms are zero.
3^11-2^1, 3^11-2^2, 3^11-2^3 are all nonprime, but 3^11-2^4 = 177131 which is prime so a(11) = 4.
a(36) is -1 (the placeholder value) because nonprimes are obtained when any power of two is subtracted from 3^36.
		

Crossrefs

Cf. A013604.
Cf. A014224, A181483, A181484. - Carl R. White, Oct 23 2010

A181483 Number of powers of 2 which can be subtracted from 3^n to form primes.

Original entry on oeis.org

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

Views

Author

Carl R. White, Oct 23 2010

Keywords

Comments

Note that if a 2^m is too large or too small, 3^n-2^m is either negative or fractional (respectively) and cannot ever be prime, thus 0 <= a(n) <= floor(n*log_2(3))
Zeros in this sequence are in A181484, which correspond to -1s in A180303

Examples

			3^1-2^0 = 2 which is prime, so a(1)=1
3^3-{2^4,2^3,2^2,2^1,2^0} = {11,19,23,25,26}, three of which are prime, so a(3) = 3
		

Crossrefs

Programs

A181484 Numbers k such that no power of 2 can be subtracted from 3^k to make a prime.

Original entry on oeis.org

36, 40, 66, 124, 162, 170, 179, 182, 184, 198, 206, 212, 214, 230, 262, 288, 302, 356, 358, 368, 393, 402, 406, 448, 456, 468, 493, 546, 586, 666, 676, 683, 686, 690, 702, 718, 724, 738, 752, 760, 785, 844, 854, 862, 866, 870, 882, 884, 888, 904, 918, 980
Offset: 1

Views

Author

Carl R. White, Oct 23 2010

Keywords

Comments

Zeros of A181483, -1s of A180303.
Odd terms: 179, 393, 493, 683, 785, 1083, 1161, 1181, 1545, ..., . - Robert G. Wilson v, Oct 25 2010

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{k = 0, lmt = Floor@ Log[2, 3^n] +1, m = 3^n}, While[ k < lmt && !PrimeQ[m - 2^k], k++ ]; k == lmt]; Select[ Range@ 995, fQ] (* Robert G. Wilson v, Oct 25 2010 *)

Extensions

a(30) onwards from Robert G. Wilson v, Oct 25 2010
Name clarified by J. Lowell, Aug 21 2020
Showing 1-6 of 6 results.