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

A003307 Numbers k such that 2*3^k - 1 is prime.

Original entry on oeis.org

1, 2, 3, 7, 8, 12, 20, 23, 27, 35, 56, 62, 68, 131, 222, 384, 387, 579, 644, 1772, 3751, 5270, 6335, 8544, 9204, 12312, 18806, 21114, 49340, 75551, 90012, 128295, 143552, 147488, 1010743, 1063844, 1360104
Offset: 1

Views

Author

Keywords

References

  • R. K. Guy, Unsolved Problems in Theory of Numbers, Section A3.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A079363 (primes of the form 2*3^k - 1), A003306 (k such that 2*3^k + 1 is prime).

Programs

Extensions

More terms from Douglas Burke (dburke(AT)nevada.edu)
More terms from T. D. Noe, Aug 24 2005
Corrected and extended by Herman Jamke (hermanjamke(AT)fastmail.fm), Jan 05 2008
a(35) from Borys Jaworski, Sep 02 2011
a(36) from Borys Jaworski, Feb 13 2012
a(37) from Jeppe Stig Nielsen, Sep 28 2018

A079363 Primes of the form 2*3^k - 1.

Original entry on oeis.org

5, 17, 53, 4373, 13121, 1062881, 6973568801, 188286357653, 15251194969973, 100063090197999413, 1046695266054721074427023041, 763040848953891663257299797617, 556256778887387022514571552463521
Offset: 1

Views

Author

Cino Hilliard, Feb 15 2003

Keywords

Comments

Sum of reciprocals = 0.2779972845973183835923785945..

Crossrefs

Cf. A003306 (n such that 2*3^n+1 is prime), A003307 (n such that 2*3^n-1 is prime).

Programs

  • Magma
    [a: n in [1..200] | IsPrime(a) where a is  2*3^n-1 ]; // Vincenzo Librandi, Dec 09 2011
  • Maple
    select(isprime,[2*3^k-1$k=0..200]); # Muniru A Asiru, Nov 24 2018
  • Mathematica
    Select[2*3^Range[100]-1, PrimeQ]
  • PARI
    \\ Primes in the sequence of sums of alternating powers of 3
    pseq3(n) = { j=a=1; p=1; sr=0; while(j<=n, a = a + 3^(p); if(isprime(a),print1(a", "); sr+=1.0/a; ); a = a+3^(p-1); if(isprime(a),print1(a", "); sr+=1.0/a; ); p+=1; j+=2; ); print(); print(sr); }
    

A111974 Primes of the form 2*3^k + 1.

Original entry on oeis.org

3, 7, 19, 163, 487, 1459, 39367, 86093443, 258280327, 411782264189299, 116299474006080119380780339, 3140085798164163223281069127, 84782316550432407028588866403, 20602102921755074907947094535687, 1910009901593650473786381403548828023839870277948686259673707683
Offset: 1

Views

Author

T. D. Noe, Aug 24 2005

Keywords

Crossrefs

Cf. A003306 (k such that 2*3^k + 1 is prime), A003307 (k such that 2*3^k - 1 is prime), A052919.

Programs

  • Mathematica
    Select[2*3^Range[100]+1, PrimeQ]

Formula

a(n) = A052919(A003306(n)+1). - Amiram Eldar, Jul 18 2025

Extensions

a(15) from Amiram Eldar, Jul 18 2025

A087126 Primes of the form p^k - p^(k-1) + 1 for some prime p and integer k > 1.

Original entry on oeis.org

3, 5, 7, 17, 19, 43, 101, 157, 163, 257, 487, 1459, 2029, 4423, 6163, 14407, 19183, 22651, 23549, 26407, 37057, 39367, 62501, 65537, 77659, 113233, 121453, 143263, 208393, 292141, 342733, 375157, 412807, 527803, 564899, 590593, 697049, 843643
Offset: 1

Views

Author

T. D. Noe, Aug 15 2003

Keywords

Comments

It is usually the case that, for prime p and k > 1, the first time the totient function phi(n) has value p^k - p^(k-1) is for n = p^k. However, this is not true when p^k - p^(k-1) + 1 is prime.

Crossrefs

Cf. A002383 (primes of the form n^2 + n + 1, which is the same as n^2 - n + 1).
Cf. A019434 (Fermat primes), A003306 (2*3^n + 1 is prime), A056799 (8*9^n + 1 is prime), A056797 (9*10^n + 1 is prime), A087139 (least k such that p^k - p^(k-1) + 1 is prime for p = prime(n)).

Programs

  • Mathematica
    lst={}; maxNum=10^6; n=1; While[p=Prime[n]; p^2-p+1
    				

A239676 Least k such that k*3^n+1 is prime.

Original entry on oeis.org

1, 2, 2, 4, 2, 2, 2, 8, 6, 2, 8, 28, 10, 12, 4, 4, 2, 2, 10, 20, 26, 24, 8, 48, 16, 34, 14, 14, 18, 6, 2, 26, 26, 14, 22, 26, 16, 22, 12, 4, 62, 64, 68, 88, 70, 56, 34, 96, 32, 50, 20, 24, 8, 6, 2, 18, 6, 2, 8, 6, 2, 42, 14, 18, 6, 2, 98, 66, 22, 70, 74, 80, 68, 52
Offset: 0

Views

Author

Derek Orr, Mar 23 2014

Keywords

Comments

All numbers in this sequence, except for a(0), are even.

Examples

			1*3^1+1 = 4 is not prime. 2*3^1+1 = 7 is prime. Thus, a(1) = 2.
1*3^3+1 = 28 is not prime. 2*3^3+1 = 57 is not prime. 3*3^3+1 = 82 is not prime. 4*3^3+1 = 109 is prime. Thus, a(3) = 4.
		

Crossrefs

Cf. A003306 (where k=2), A035050 (k*2^n+1 is prime).

Programs

  • Magma
    sol:=[];m:=1; for n in [0..73] do k:=0; while not IsPrime(k*3^n+1) do k:=k+1; end while; sol[m]:=k; m:=m+1; end for; sol; // Marius A. Burtea, Jun 05 2019
  • Mathematica
    lk[n_]:=Module[{k=1,t=3^n},While[!PrimeQ[k*t+1],k++];k]; Array[lk,80,0] (* Harvey P. Dale, May 11 2025 *)
  • PARI
    for(n=0, 100, k=0; while(!isprime(k*3^n+1), k++); print1(k, ", ")) \\ Colin Barker, Mar 24 2014
    
  • Python
    import sympy
    from sympy import isprime
    def Pow3(n):
      for k in range(10**4):
        if isprime(k*(3**n)+1):
          return n
    n = 1
    while n < 100:
      print(Pow3(n))
      n += 1
    

A305237 Numbers m such that m, m+1 and m+2 all have primitive roots.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 17, 25, 81, 241
Offset: 1

Views

Author

Jianing Song, Jun 04 2018

Keywords

Comments

Start of run of 3 consecutive numbers in A033948.
The next term is 3^541 - 2, which is too large to be included here. No more terms below 3^100000, or approximately 1.33*10^47712.
There is a multiple of 4 in every four consecutive positive integers and it clearly has no primitive roots if it is larger than 4. Again, there is a multiple of 3 in every three consecutive positive integers, so it must be a power of 3 or two times a power of 3, and the other two numbers must be odd prime powers or two times odd prime powers.
According to Pillai's conjecture, there're only finitely many solutions to |3^a - p^b| = 2, |3^a - 2*p^b| = 1, |p^a - 2*3^b| = 1 with a,b >= 2, p odd primes (no solution other than 3^3 - 5^2 = 2, 3^5 - 2*11^2 = 1 below 3^100000). So beyond (25, 26, 27) and (241, 242, 243), it's very likely that all three consecutive numbers with primitive roots are of the form (3^i, 3^i + 1, 3^i + 2), (3^j - 2, 3^j - 1, 3^j), (2*3^k - 1, 2*3^k, 2*3^k + 1) such that (3^i + 1)/2, 3^i + 2, 3^j - 2, (3^j - 1)/2, 2*3^k - 1, 2*3^k + 1 are primes, which only produces one more solution (3^541 - 2, 3^541 - 1, 3^541) below 3^1000000.

Examples

			81, 82, 83 all have primitive roots (in fact, their least common primitive root is 47), so 81 is a term.
Note that A014224 and A028491 have a term 541 in common, so 3^541 - 2, 3^541 - 1 and 3^541 all have primitive roots, so 3^541 - 2 is a term.
		

Crossrefs

A319036 a(n) is the smallest triangular number T(k) such that both it and its successor T(k+1) have exactly 2n divisors, or 0 if no such pair of consecutive triangular numbers exists.

Original entry on oeis.org

0, 6, 153, 66, 0, 3916, 0, 1770, 2556, 327645, 0, 1540, 0, 893862621, 8199225, 17766, 0, 76636, 0, 12720, 662976, 2096128, 0, 10296, 3357936, 416798777159765703, 6221628, 3611328, 0, 1734453, 0, 303810, 111576864636, 1420010137134674578503, 18051523357140153
Offset: 1

Views

Author

Jon E. Schoenfield, Dec 05 2018

Keywords

Comments

The only primes p for which a(p) > 0 are those for which both 2*3^(p-1) - 1 and 2*3^(p-1) + 1 are prime: 2, 3, and any other primes p such that p-1 appears both in A003307 and A003306. (If such a prime p > 3 exists, then p exceeds 1360105.)
Conjecture: The only primes p for which a(p) > 0 are 2 and 3.

Examples

			For n=1, the only triangular number with exactly 2*1 = 2 divisors is T(2) = 2*(2+1)/2 = 3 (the only triangular number that is prime); thus, exists no pair of consecutive triangular numbers having exactly 2 divisors, so a(1)=0.
a(2) is 6 because T(3) = 3*(3+1)/2 = 6 and T(4) = 4*(4+1)/2 = 10 are the first two consecutive triangular numbers having exactly 2*2 = 4 divisors.
		

Crossrefs

A056802 Numbers k such that 2*9^k + 1 is prime.

Original entry on oeis.org

0, 1, 2, 3, 8, 15, 27, 30, 66, 90, 160, 348, 391, 411, 626, 727, 2740, 3921, 6048, 6891, 8860, 21978, 32411, 41390, 52553, 82948, 95907, 264840, 537363, 543056, 587616, 638931, 673271, 1561518
Offset: 1

Views

Author

Robert G. Wilson v, Aug 22 2000

Keywords

Crossrefs

Cf. A003306 (k such that 2*3^k + 1 is prime).

Programs

  • Mathematica
    Do[ If[ PrimeQ[ 2*9^n + 1], Print[ n ]], {n, 0, 1000}]
  • PARI
    is(n)=ispseudoprime(2*9^n+1) \\ Charles R Greathouse IV, Jun 12 2017

Extensions

More terms from Rick L. Shepherd, Apr 22 2003
a(21)-a(31) from David Broadhurst, Feb 22 2010
a(32)-a(34) from Paul S. Vanderveen, Feb 09 2020

A058934 Numbers k such that 2*5^k + 1 is prime.

Original entry on oeis.org

0, 1, 3, 13, 45, 105, 159, 297, 1443, 2977, 3699, 11709, 12357, 43165, 121995
Offset: 1

Views

Author

Labos Elemer, Jan 12 2001

Keywords

Comments

a(n) is odd for n > 0. Next term > 17200. - Julián Aguirre, Apr 22 2011
a(16) > 2*10^5. - Robert Price, Mar 14 2015

Examples

			a(3)=13 and 1 + 2*5^13 = 2441406251 is prime.
		

Crossrefs

Cf. A003306 (2*3^n + 1 is prime), A120375 (2*5^n-1 is prime).

Programs

Extensions

Edited by Joerg Arndt, Apr 22 2011
Terms 1443,...,12357 from Julián Aguirre, Apr 22 2011
a(14)-a(15) from Robert Price, Mar 14 2015

A216889 Numbers k such that 12*3^k + 1 is prime.

Original entry on oeis.org

0, 1, 2, 5, 13, 14, 38, 200, 248, 884, 1004, 1253, 1634, 3305, 3521, 9601, 19784, 72697
Offset: 1

Views

Author

Vincenzo Librandi, Sep 26 2012

Keywords

Comments

a(19) > 2*10^5. - Robert Price, Mar 16 2014
All terms are verified primes (i.e., not merely probable primes). - Robert Price, Mar 16 2014

Crossrefs

Programs

  • Magma
    [n: n in [0..4000] | IsPrime(12*3^n + 1)];
    
  • Mathematica
    Select[Range[4000], PrimeQ[12 * 3^# + 1] &]
  • PARI
    is(n)=ispseudoprime(12*3^n+1) \\ Charles R Greathouse IV, Jun 13 2017

Formula

a(n) = A005537(n+1) - 1. - Bruno Berselli, Sep 27 2012

Extensions

a(16)-a(17) from Vincenzo Librandi, Sep 30 2012
a(18) from Robert Price, Mar 16 2014
Showing 1-10 of 21 results. Next