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-4 of 4 results.

A301916 Primes which divide numbers of the form 3^k + 1.

Original entry on oeis.org

2, 5, 7, 17, 19, 29, 31, 37, 41, 43, 53, 61, 67, 73, 79, 89, 97, 101, 103, 113, 127, 137, 139, 149, 151, 157, 163, 173, 193, 197, 199, 211, 223, 233, 241, 257, 269, 271, 281, 283, 293, 307, 317, 331, 337, 349, 353, 367, 373, 379, 389, 397, 401, 409, 439
Offset: 1

Views

Author

Luke W. Richards, Mar 28 2018

Keywords

Comments

This sequence can be used to factor P-1 values for prime candidates of the form 3^k+2, to aid with primality testing.
a(1) = 2 divides every number of the form 3^k+1. It is the only term with this property.
For k > 2, A000040(k) is a member if and only if A062117(k) is even. - Robert Israel, May 23 2018

Examples

			Every value of 3^k+1 is an even number, so 2 is in the sequence.
No values of 3^k+1 is ever a multiple of 3 for any integer k, so 3 is not in the sequence.
3^2+1 = 10, which is a multiple of 5, so 5 is in the sequence.
		

Crossrefs

Programs

  • Maple
    f:= p -> numtheory:-order(3,p)::even:
    f(2):= true:
    select(isprime and f, [2,seq(p,p=5..1000,2)]); # Robert Israel, May 23 2018
  • Mathematica
    Join[{2}, Select[Range[5, 1000, 2], PrimeQ[#] && EvenQ@ MultiplicativeOrder[3, #]&]] (* Jean-François Alcover, Feb 02 2023 *)
  • PARI
    isok(p)=if (p != 3, m = Mod(3, p); nb = znorder(m); for (k=1, nb, if (m^k == Mod(-1, p), return(1)););); return(0); \\ Michel Marcus, May 18 2018
    
  • PARI
    list(lim)=my(v=List([2]),t); forfactored(n=4,lim\1+1, if(n[2][,2]==[1]~, my(p=n[1],m=Mod(3,p)); for(k=2,znorder(m,t), m*=3; if(m==-1, listput(v,p); break))); t=n); Vec(v) \\ Charles R Greathouse IV, May 23 2018
    
  • PARI
    isok(p)=isprime(p)&&if(p<4,p==2,znorder(Mod(3,p))%2==0) \\ Jeppe Stig Nielsen, Jun 27 2020
    
  • PARI
    isok(p)=!isprime(p)&&return(0); p<4&&return(p==2); s=valuation(p-1,2); Mod(3,p)^((p-1)>>s)!=1 \\ Jeppe Stig Nielsen, Jun 27 2020

A320481 Primes in A301916 but not in A045318.

Original entry on oeis.org

2, 769, 1297, 6529, 7057, 8017, 8737, 12097, 12289, 13297, 13441, 14929, 15073, 15361, 15937, 16273, 18913, 19441, 20593, 21601, 21649, 22273, 22369, 23857, 25633, 26017, 26449, 26497, 27793, 28513, 30529, 31249, 34369, 34849, 36913, 37057, 37441, 37633, 38833, 38977, 39409
Offset: 1

Views

Author

N. J. A. Sloane, Oct 17 2018

Keywords

Comments

Is there a simpler characterization of these primes?
Answer from Don Reble, Oct 25 2018: (Start)
Let POT(x) be the largest power of 2 which divides x (A006519).
Apart from the initial 2, this sequence consists of those primes P such that
2 <= POT(the order of 3 modulo P) <= POT(P-1)/8.
The condition "2 <=" ensures that P divides some 3^k+1, and the condition "<= POT(P-1)/8" is so that 3 has an eighth root modulo P. A062117 is the order of 3 modulo prime(n). (End)
Comments from Richard Bumby, Nov 12 2018: (Start)
When considering methods for finding square roots mod p one is led to filtering the nonzero elements by the power of 2 dividing the multiplicative order of the element. The lowest level -- elements of odd order -- have easily computed square roots, and the square roots of other elements can be found if you can discover at least one element at a higher level.
To say that "x^8 = 3 has no solution mod p" is to say that 3 is in one of the top three levels and that there are more than 3 levels (so that 8 divides p-1).
To say that primes "divide numbers of the form 3^k + 1" is to say that -1 is a power of 3 mod p, or that 3 is not at the lowest level. If there are only four levels (9 mod 16), these statements are equivalent. Otherwise, the two statements are different. An interesting case has 3 at the second level, so that (-3) has odd order allowing cube roots of unity to be found quickly.
I was told that Odoni had some results on finding the number of primes with k levels for which a given number (e.g., 3) is at level j, but I never tracked down a reference. If the asymptotic behavior is what one would expect, A045318 and A301916 are really far from being "almost the same", except in the trivial sense of "zero density". (End)

References

  • Georg Fischer, email to N. J. A. Sloane, Oct 16 2018.

Crossrefs

Programs

  • Mathematica
    Select[Prime@Range@4200,PowerModList[3,1/8,#]!={}&&IntegerQ@MultiplicativeOrder[3,#,-1]&] (* Giorgos Kalogeropoulos, Feb 23 2022 *)

Extensions

More terms from Michel Marcus, Oct 17 2018

A301919 a(n) is the least value of k for which A301918(n) divides 3^k+3.

Original entry on oeis.org

0, 1, 3, 4, 9, 10, 15, 16, 10, 5, 22, 27, 6, 12, 7, 40, 45, 25, 51, 18, 57, 64, 69, 70, 75, 26, 40, 82, 87, 9, 99, 100, 106, 112, 117, 61, 129, 135, 16, 141, 142, 147, 18, 159, 166, 85, 88, 177, 62, 94, 190, 195, 100, 201, 103, 74, 225, 115, 231, 232, 244, 84
Offset: 1

Views

Author

Luke W. Richards, Mar 28 2018

Keywords

Comments

This can be used to identify P+1 values to primality test potential primes P of the form 3^k+2, i.e., A051783.

Examples

			All values of 3^k+3 are multiples of 2, so 3^0+3 = 4 is the least value of k which is a multiple of 2.
a(10) = 5 and A301918(10) = 41 so 3^5+3 = 246 is the first multiple of 41 which can be written in the form 3^k+3.
		

Crossrefs

Formula

a(n) = A301917(n-1) + 1 for n > 2.

A301918 Primes which divide numbers of the form 3^k+3.

Original entry on oeis.org

2, 3, 5, 7, 17, 19, 29, 31, 37, 41, 43, 53, 61, 67, 73, 79, 89, 97, 101, 103, 113, 127, 137, 139, 149, 151, 157, 163, 173, 193, 197, 199, 211, 223, 233, 241, 257, 269, 271, 281, 283, 293, 307, 317, 331, 337, 349, 353, 367, 373, 379, 389, 397, 401, 409, 439
Offset: 1

Views

Author

Luke W. Richards, Mar 28 2018

Keywords

Comments

Union of {3} and A301916, because 3^k + 3 = 3*(3^(k-1) + 1). [Comment edited by Jeppe Stig Nielsen, Jul 04 2020.]
Can be used to factor P+1 values where P is a potential prime of the form 3^k+2.
Is this 2 and 3 with A045318? - David A. Corneth, May 04 2018
No, it is not. Primes like 769, 1297, ... are also here but not in A045318. See A320481 for the explanation. - Jeppe Stig Nielsen, Jun 27 2020

Examples

			All values of 3^k+3 are multiples of 2, so 2 is in the sequence.
3^4+3 = 84, which is a multiple of 7, so 7 is in the sequence.
		

Crossrefs

Showing 1-4 of 4 results.