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

A307805 a(n) = first position of prime(n) in A023503.

Original entry on oeis.org

2, 4, 5, 10, 9, 16, 27, 43, 15, 17, 64, 35, 23, 40, 61, 28, 127, 73, 57, 104, 62, 66, 39, 41, 77, 111, 114, 117, 182, 49, 97, 56, 143, 102, 196, 155, 248, 119, 346, 69, 72, 181, 76, 137, 497, 139, 318, 388, 721, 401, 91, 92, 229, 96, 243, 249, 325, 258, 186, 103
Offset: 1

Views

Author

Michael De Vlieger, Apr 29 2019

Keywords

Comments

Apparent permutation of A071349(n) apart from A071349(1) = 1.
Let i = a(n). Sorting prime(n) in order of increasing i yields A112037 = {2, 3, 5, 11, 7, 23, 13, 29, 41, ...}. The product of the first j terms of A112037 = A071350(j).

Examples

			a(1) = 2 since prime(1) = gpf(prime(2) - 1), i.e., 2 = gpf(2).
a(2) = 4 since prime(2) = gpf(prime(4) - 1), i.e., 3 = gpf(6).
a(3) = 5 since prime(3) = gpf(prime(5) - 1), i.e., 5 = gpf(10).
a(4) = 10 since prime(4) = gpf(prime(10) - 1), i.e., 7 = gpf(28).
		

Crossrefs

Programs

  • Mathematica
    With[{s = Array[FactorInteger[Prime@ # - 1][[-1, 1]] &, 1000]}, Reap[Do[If[FreeQ[s, #], Break[], Sow@ FirstPosition[s, #][[1]]] &@ Prime@ i, {i, Length@ s}]][[-1, -1]]]
  • PARI
    { a = vector(60); pr = primes(#a); u = 1; n = 1;
    forprime (p=3, oo, n++; f=factor(p-1); g=setsearch(pr, f[#f~,1]);
    if (g && !a[g], a[g]=n; while (a[u], print1 (a[u]", "); u++; if (u>#a, break (2))))) } \\ Rémy Sigrist, May 28 2019

A331810 Smallest integer x such that prime(n) divides 1 + x + x^2 + ... + x^(q-1) where q = A023503(n), or 0 if no such x exists.

Original entry on oeis.org

2, 4, 2, 3, 3, 16, 7, 2, 7, 2, 10, 10, 4, 2, 10, 3, 9, 9, 20, 8, 8, 3, 2, 35, 36, 8, 3, 45, 16, 2, 39, 16, 6, 5, 8, 14, 58, 2, 6, 3, 42, 5, 84, 36, 18, 58, 2, 3, 16, 2, 6, 87, 20, 256, 2, 5, 10, 16, 59, 4, 16, 9, 7, 27, 10, 74, 8, 3, 31, 22, 2, 7, 12, 86, 2, 5
Offset: 2

Views

Author

Michel Lagneau, Jan 27 2020

Keywords

Comments

Conjecture: every integer > 1 is in the sequence.
Theorem: Let p and q be prime numbers for which there exists an integer x such that p divides 1 + x + x^2 + ... + x^(q-1). Then p == 1 (mod q) or p = q.

Examples

			a(8) = 7 because prime(8) = 19 divides 1 + 7^1 + 7^2 = 57 = 3*19, where q = 3 = A023503(8).
a(9) = 2 because prime(9) = 23 divides 1 + 2^1 + 2^2 + 2^3 + 2^4 + 2^5 + 2^6 + 2^7 + 2^8 + 2^9 + 2^10  = 2047 = 23*89, where q = 11 = A023503(9).
		

Crossrefs

Cf. A023503 (greatest prime divisor of prime(n) - 1).

Programs

  • Maple
    with(numtheory):nn:=100:
    for n from 2 to nn do:
    p:=ithprime(n):d:=factorset(p-1):n0:=nops(d):q:=d[n0]:ii:=0:
       for x from 1 to 10^5 while(ii=0) do:
        s:=sum('x^(i-1)', 'i'=1..q):
         if irem(s,p)=0 then
          ii:=1:printf(`%d, `,x):
         else fi:
         od:
        od:
  • Mathematica
    Array[Block[{k = 2}, While[Mod[Total[k^#2 ], #1] != 0, k++]; k ] & @@ {Prime@ #, Range[0, FactorInteger[Prime@ # - 1][[-1, 1]] - 1 ]} &, 76, 2] (* Michael De Vlieger, Jan 27 2020 *)
  • PARI
    a(n) = {my(p=prime(n), q=vecmax(factor(p-1)[,1]), x=1); while (sum(k=0, q-1, x^k) % p, x++); x;} \\ Michel Marcus, Jan 30 2020

A035095 Smallest prime congruent to 1 (mod prime(n)).

Original entry on oeis.org

3, 7, 11, 29, 23, 53, 103, 191, 47, 59, 311, 149, 83, 173, 283, 107, 709, 367, 269, 569, 293, 317, 167, 179, 389, 607, 619, 643, 1091, 227, 509, 263, 823, 557, 1193, 907, 1571, 653, 2339, 347, 359, 1087, 383, 773, 3547, 797, 2111, 2677, 5449, 2749, 467
Offset: 1

Views

Author

Keywords

Comments

This is a version of the "least prime in special arithmetic progressions" problem.
Smallest numbers m such that largest prime factor of Phi(m) = prime(n), the n-th prime, also seems to be prime and identical to n-th term of A035095. See A068211, A068212, A065966: Min[x : A068211(x)=prime(n)] = A035095(n); e.g., Phi(a(7)) = Phi(103) = 2*3*17, of which 17 = p(7) is the largest prime factor, arising first here.
It appears that A035095, A066674, A125878 are probably all the same, but see the comments in A066674. - N. J. A. Sloane, Jan 05 2013
Minimum of the smallest prime factors of F(n,i) = (i^prime(n)-1)/(i-1), when i runs through all integers in [2, prime(n)]. Every prime factor of F(n,i) is congruent to 1 modulo prime(n). - Vladimir Shevelev, Nov 26 2014
Conjecture: a(n) is the smallest prime p such that gpf(p-1) = prime(n). See A023503. - Thomas Ordowski, Aug 06 2017
For n>1, a(n) is the smallest prime congruent to 1 mod (2*prime(n)). - Chai Wah Wu, Apr 28 2025

Examples

			a(8) = 191 because in the prime(8)k+1 = 19k+1 sequence, 191 is the smallest prime.
		

References

  • E. Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Bd 1 (reprinted Chelsea 1953).
  • E. C. Titchmarsh, A divisor problem, Renc. Circ. Math. Palermo, 54 (1930) pp. 414-429.
  • P. Turan, Über Primzahlen der arithmetischen Progression, Acta Sci. Math. (Szeged), 8 (1936/37) pp. 226-235.

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{p = Prime[n]}, r = 1 + p; While[ !PrimeQ[r], r += p]; r]; Array[a, 51] (* Jean-François Alcover, Sep 20 2011, after PARI *)
    a[n_]:=If[n<2,3,Block[{p=Prime[n]},r=1+2*p;While[!PrimeQ[r],r+=2*p]];r];Array[a,51] (* Zak Seidov, Dec 14 2013 *)
  • PARI
    a(n)=local(p,r);p=prime(n);r=1;while(!isprime(r),r+=p);r
    
  • PARI
    {my(N=66); forprime(p=2, , forprime(q=p+1,10^10, if((q-1)%p==0, print1(q,", "); N-=1; break)); if(N==0,break)); } \\ Joerg Arndt, May 27 2016
    
  • Python
    from itertools import count
    from sympy import prime, isprime
    def A035095(n): return 3 if n==1 else next(filter(isprime,count((p:=prime(n)<<1)+1,p))) # Chai Wah Wu, Apr 28 2025

Formula

According to a long-standing conjecture (see the 1979 Wagstaff reference), a(n) <= prime(n)^2 + 1. This would be sufficient to imply that a(n) is the smallest prime such that greatest prime divisor of a(n)-1 is prime(n), the n-th prime: A006530(a(n)-1) = A000040(n). This in turn would be sufficient to imply that no value occurs twice in this sequence. - Franklin T. Adams-Watters, Jun 18 2010
a(n) = 1 + A035096(n)*A000040(n). - Zak Seidov, Dec 27 2013

Extensions

Edited by Franklin T. Adams-Watters, Jun 18 2010
Minor edits by N. J. A. Sloane, Jun 27 2010
Edited by N. J. A. Sloane, Jan 05 2013

A103667 Primes p such that the largest prime divisor of p-1 is greater than the largest prime divisor of p+1.

Original entry on oeis.org

7, 11, 23, 29, 31, 47, 53, 59, 71, 79, 83, 89, 103, 107, 127, 131, 139, 149, 167, 173, 179, 191, 199, 223, 227, 233, 239, 263, 269, 293, 307, 311, 317, 347, 349, 359, 367, 373, 383, 389, 419, 431, 439, 449, 461, 467, 479, 499, 503, 509, 557, 563, 569, 571, 587
Offset: 1

Views

Author

Hugo Pfoertner, Feb 19 2005

Keywords

Comments

Primes of the form 2*A070087(n)+1 for some n. - Charles R Greathouse IV, Dec 22 2022
Conjecture: this sequence is of positive relative density in the primes, perhaps even 1/2. - Charles R Greathouse IV, Dec 22 2022

Examples

			a(1)=7 because the largest prime divisor of 6 is greater than the largest prime divisor of 8.
		

Crossrefs

Cf. A023503 (greatest prime divisor of n-th prime - 1), A023509 (greatest prime divisor of n-th prime + 1), A103666, A070087.

Programs

  • Maple
    filter:= p -> isprime(p) and max(numtheory:-factorset(p-1)) > max(numtheory:-factorset(p+1)):
    select(filter, [seq(i,i=3..1000,2)]); # Robert Israel, Jan 15 2024
  • Mathematica
    Select[Prime@Range[2, 107], If[FactorInteger[#-1][[-1, 1]]>FactorInteger[#+1][[-1, 1]], True]&] (* James C. McMahon, Jan 15 2024 *)

A082449 Let f(p) = greatest prime divisor of p-1. Sequence gives smallest prime which takes at least n steps to reach 2 when f is iterated.

Original entry on oeis.org

2, 3, 7, 23, 47, 283, 719, 1439, 2879, 34549, 138197, 1266767, 14619833, 36449279, 377982107, 1432349099, 22111003847
Offset: 0

Views

Author

N. J. A. Sloane, Apr 25 2003

Keywords

Comments

There is a remarkable and unexplained agreement: if 3 and 7 are replaced by 11 and 14619833 is replaced by 14920303, the result is sequence A056637 (least prime of class n-, according to the Erdős-Selfridge classification of primes).
From David A. Corneth, Oct 18 2016: (Start):
If a(n) * k + 1 is prime then a(n + 1) <= a(n) * k + 1.
a(18), a(19), ..., a(23) <= 309554053859, 619108107719, 19811459447009, 433142367554861, 866284735109723, 22523403112852799 respectively. (End)
Conjecture: a(n) is the smallest prime p such that b(p) = n, where f(2) = 0 and for an odd prime p, f(p) = 1 + max{q|(p-1), q prime} f(q). In other words, a(n) is the smallest prime p such that A364332(primepi(p)) = n. Verified for n <= 13. - Jianing Song, Apr 28 2024

Examples

			a(2) = 7 since 7 -> 3 -> 2 takes two steps, and smaller primes require less than 2 steps.
For p = 2879, 8 steps are needed (2879 -> 1439 -> 719 -> 359 -> 179 -> 89 -> 11 -> 5 -> 2), so a(8) = 2879, since smaller primes require less than 8 steps.
		

References

  • Steven G. Johnson, Postings to Number Theory List, Apr 23 and Apr 25, 2003.

Crossrefs

Programs

  • Mathematica
    (* Assuming a(n) > 2 a(n-1) if n>1 *) Clear[a, f]; f[p_] := FactorInteger[p - 1][[-1, 1]]; f[2] = 2; a[n_] := a[n] = For[p = NextPrime[2 a[n-1]], True, p = NextPrime[p], k = 0; If[Length[FixedPointList[f, p]] == n+2, Return[p]]]; a[0]=2; a[1]=3; Table[Print[a[n]]; a[n], {n, 0, 16}] (* Jean-François Alcover, Oct 18 2016 *)

Extensions

Edited by Klaus Brockhaus, May 01 2003
a(16) from Donovan Johnson, Nov 17 2008

A103666 Primes p such that the largest prime divisor of p-1 is less than the largest prime divisor of p+1.

Original entry on oeis.org

5, 13, 17, 19, 37, 41, 43, 61, 67, 73, 97, 101, 109, 113, 137, 151, 157, 163, 181, 193, 197, 211, 229, 241, 251, 257, 271, 277, 281, 283, 313, 331, 337, 353, 379, 397, 401, 409, 421, 433, 443, 457, 463, 487, 491, 521, 523, 541, 547, 577, 601, 613, 617, 631
Offset: 1

Views

Author

Hugo Pfoertner, Feb 19 2005

Keywords

Examples

			a(1)=5 because the largest prime divisor of 4 is less than the largest prime divisor of 6.
		

Crossrefs

Cf. A023503 greatest prime divisor of n-th prime - 1, A023509 greatest prime divisor of n-th prime + 1, A103667.

Programs

  • Mathematica
    Select[Prime[Range[2,200]],Max[Transpose[FactorInteger[#-1]][[1]]]< Max[Transpose[FactorInteger[#+1]][[1]]]&]  (* Harvey P. Dale, Apr 26 2011 *)

A105403 Numbers n such that prime(n)-1 and prime(n+1)-1 have the same largest prime factor.

Original entry on oeis.org

2, 30, 53, 217
Offset: 1

Views

Author

Cino Hilliard, May 01 2005

Keywords

Comments

The PARI program below is a generalization of this type of sequence. These numbers are rare. Are they finite? Proof?
No more terms between 217 and 3090000. - R. J. Mathar, Feb 14 2008
No more terms < 5760000. - David Wasserman, May 02 2008
No more terms < 11078936. - Otis Tweneboah, Pratik Koirala, Eugene Fiorini, Nathan Fox, Jun 30 2015
No more terms < 50000000 (~40 minutes computation time). - Manfred Scheucher, Jul 25 2015
No more terms < 100000000. Conjecture: sequence is full. - Jon E. Schoenfield, Jul 25 2015

Examples

			The prime factorization of prime(217) - 1 = 1327 - 1 = 1326 is 2*3*13*17, and that of prime(218) - 1 = 1361 - 1 = 1360 is 2^4*5*17; each has 17 as its largest factor.
		

Crossrefs

Cf. A023503.

Programs

  • Mathematica
    Select[Range@ 1000000, FactorInteger[Prime[#] - 1][[-1, 1]] == FactorInteger[Prime[# + 1] - 1][[-1, 1]] &] (* Michael De Vlieger, Jul 25 2015 *)
  • PARI
    \prime indices such that gd of prime(x)+ k and prime(x+m) + k are equal divpm1(n,m,k) = { local(x,l1,l2,v1,v2); for(x=2,n, v1 = ifactor(prime(x)+ k); v2 = ifactor(prime(x+m)+k); l1 = length(v1); l2 = length(v2); if(v1[l1] == v2[l2], print1(x",") ) ) } ifactor(n) = \Vector of the prime factors of n { local(f,j,k,flist); flist=[]; f=Vec(factor(n)); for(j=1,length(f[1]), for(k = 1,f[2][j],flist = concat(flist,f[1][j]) ); ); return(flist) }
    
  • PARI
    gpf(n)=if(n>1, my(f=factor(n)[,1]); f[#f], 1)
    is(n,p=prime(n))=my(q=nextprime(p+1),g=gcd(p-1,q-1)); q\=g; p\=g; forprime(r=2,gpf(g), p/=r^valuation(p,r); q/=r^valuation(q,r)); p==1 && q==1
    n=0;forprime(p=2,1e9,n++;if(is(0,p),print1(n", "))) \\ Charles R Greathouse IV, Aug 27 2015

Formula

{i: A023503(i) = A023503(i+1)}. - R. J. Mathar, Feb 14 2008

A083647 For primes p: Number of steps to reach 2 when iterating f(p) = greatest prime divisor of p-1.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, May 01 2003

Keywords

Comments

For smallest prime that requires n steps to reach 2 cf. A082449.

Examples

			59 is the 17th prime and takes four steps to reach 2 (59 -> 29 -> 7 -> 3 -> 2), so a(17) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[NestWhileList[FactorInteger[#-1][[-1,1]]&,Prime[n], #!=2&]]-1,{n,110}] (* Harvey P. Dale, Feb 27 2012 *)
  • PARI
    {forprime(p=2,571,q=p; c=0; while(q>2,fac=factor(q-1); q=fac[matsize(fac)[1],1]; c++); print1(c,","))}

A061599 Primes p such that the greatest prime divisor of p-1 is 5.

Original entry on oeis.org

11, 31, 41, 61, 101, 151, 181, 241, 251, 271, 401, 541, 601, 641, 751, 811, 1201, 1601, 1621, 1801, 2161, 2251, 3001, 4001, 4051, 4801, 4861, 6481, 7681, 8101, 8641, 9001, 9601, 9721, 11251, 14401, 15361, 16001, 19441, 21601, 21871, 22501, 23041, 24001
Offset: 1

Views

Author

Labos Elemer, Jun 13 2001

Keywords

Comments

Prime numbers n for which cos(2Pi/n) is an algebraic number of 5th degree. - Artur Jasinski, Dec 13 2006
The least significant digit of each term is one. - Harvey P. Dale, Jul 07 2024

Crossrefs

The 3rd in a family of sequences after A019434(=Fermat-primes) and A058383.

Programs

  • Mathematica
    Do[If[Take[FactorInteger[EulerPhi[2n + 1]][[ -1]],1] == {5} && PrimeQ[2n + 1], Print[2n + 1]], {n, 1, 10000}] (* Artur Jasinski, Dec 13 2006 *)
    Select[Prime[Range[3000]],Max[FactorInteger[#-1][[;;,1]]]==5&] (* Harvey P. Dale, Jul 07 2024 *)
  • PARI
    { default(primelimit, 167772161); n=0; forprime (p=3, 167772161, f=factor(p - 1)~; if (f[1, length(f)]==5, write("b061599.txt", n++, " ", p)) ) } \\ Harry J. Smith, Jul 25 2009
    
  • PARI
    list(lim)=my(v=List(), s, t); lim\=1; lim--; for(i=1, logint(lim\2, 5), t=2*5^i; for(j=0, logint(lim\t, 3), s=t*3^j; while(s<=lim, if(isprime(s+1), listput(v, s+1)); s<<=1))); Set(v) \\ Charles R Greathouse IV, Oct 29 2018

Formula

Primes of the form 2^a*3^b*5^c + 1 with a and c > 0.

A174869 a(n) is 0 if n is a power of 2, otherwise the smallest k > 0 such that A006530(n+k) < A006530(n).

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 1, 0, 7, 2, 1, 4, 1, 1, 1, 0, 1, 14, 1, 4, 3, 2, 1, 8, 2, 1, 5, 2, 1, 2, 1, 0, 2, 1, 1, 28, 1, 1, 1, 8, 1, 3, 1, 1, 3, 2, 1, 16, 1, 4, 1, 2, 1, 10, 1, 4, 3, 2, 1, 4, 1, 1, 1, 0, 1, 4, 1, 2, 1, 2, 1, 56, 1, 1, 6, 1, 3, 2, 1, 1, 47, 2, 1, 6, 3, 1, 1, 2, 1, 6, 5, 3, 2, 1, 1, 32, 1, 2, 1, 8, 1, 2, 1
Offset: 1

Views

Author

Vladimir Shevelev, Mar 31 2010

Keywords

Comments

a(n)=1 if the index n is an odd prime.

Crossrefs

Programs

  • Maple
    A006530 := proc(n) option remember; if n = 1 then 1; else max(op(numtheory[factorset](n)) ) ; end if; end proc:
    A174869 := proc(n) if n <= 2 then 0; else gpf := A006530(n) ; if gpf = 2 then 0; else for k from 1 do if A006530(n+k) < gpf then return k; end if; end do: end if; end if; end proc:
    seq(A174869(n),n=1..120) ; # R. J. Mathar, Aug 10 2010
  • Mathematica
    Block[{s = Array[FactorInteger[#][[-1, 1]] &, 120]}, Array[If[IntegerQ@ Log2[#], 0, Block[{k = 1, n = s[[#]]}, While[n <= s[[# + k]], k++; If[# + k > Length[s], AppendTo[s, FactorInteger[# + k][[-1, 1]] ]] ]; k]] &, 102, 2]] (* Michael De Vlieger, Apr 06 2021 *)
  • PARI
    A006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1);
    A174869(n) = if(!bitand(n,n-1), 0, my(gpf=A006530(n)); for(k=1,oo,if(A006530(n+k)Antti Karttunen, Apr 06 2021

Extensions

More terms from R. J. Mathar, Aug 10 2010
Showing 1-10 of 18 results. Next