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.

User: Paolo Galliani

Paolo Galliani's wiki page.

Paolo Galliani has authored 11 sequences. Here are the ten most recent ones:

A307533 Primes p such that p+2 has exactly two distinct prime factors.

Original entry on oeis.org

13, 19, 31, 37, 43, 53, 61, 67, 73, 83, 89, 97, 109, 113, 127, 131, 139, 151, 157, 173, 181, 199, 211, 223, 233, 251, 257, 263, 277, 293, 307, 317, 331, 337, 349, 353, 367, 373, 379, 389, 401, 409, 421, 439, 443, 449, 457, 467, 479, 487, 491, 499, 503, 509, 541
Offset: 1

Author

Paolo Galliani, Apr 13 2019

Keywords

Comments

(13,31), (37,73), (157,751), (199,991) are pairs of emirps belonging to this sequence such that the lesser term of the pair is the reverse of the greater. Are there infinitely many such pairs?
Are there infinitely many triples in the sequence like (61,67,73) and (251,257,263), that is, infinitely many a(n) such that a(n+1)=a(n)+6 and a(n+2)=a(n)+12?
The triples found so far are (61,67,73), (251,257,263) and (367,373,379). The first terms of the triples found are 61, 251 and 367, which belong to the sequence A038107.

Examples

			61 is in the sequence because 61 + 2 = 63 has exactly two distinct prime factors (3 and 7).
		

Programs

  • Maple
    filter:= proc(n) isprime(n) and nops(numtheory:-factorset(n+2))=2 end proc:
    select(filter, [seq(i,i=3..1000,2)]); # Robert Israel, Jul 28 2019
  • Mathematica
    Select[Range[500], PrimeQ[#] && PrimeNu[# + 2] == 2 &] (* Amiram Eldar, Apr 14 2019 *)
  • PARI
    isok(p) = isprime(p) && (omega(p+2) == 2); \\ Michel Marcus, May 02 2019

A307263 Primes p with a record number of iterations of the map p -> p - pi(p) until a nonprime is being reached.

Original entry on oeis.org

2, 5, 13, 43, 61, 14897, 377942237, 75697732547
Offset: 1

Author

Paolo Galliani, Apr 01 2019

Keywords

Comments

a(9) > 1.7*10^11. - Giovanni Resta, Jul 07 2019

Examples

			5 is in the sequence because if you start the algorithm from every prime < 5, you obtain a number of primes less than starting from 5. In fact, starting from 5, which is the 3rd prime number, you have (5-pi(5))=2, which is prime, then (2-pi(2))=1, which is not prime and so the algorithm stops. So applying the algorithm from 5 you have two prime numbers, 5 and 2. If you start the algorithm from any other prime < 5, then you have only one prime.
		

Crossrefs

Programs

  • Mathematica
    f[p_] := Module[{c = 0, q = p}, While[PrimeQ[q], q -= PrimePi[q]; c++]; c]; fm = 0; s = {}; Do[f1 = f[n]; If[f1 > fm, fm = f1; AppendTo[s, n]], {n, 1, 15000}]; s (* Amiram Eldar, Jul 06 2019 *)
  • PARI
    maxi=0; forprime(q=1, 10^8, p=q; r=0; while(isprime(p)==1, r=r+1; s=primepi(p); p=p-s); if(r>maxi, maxi=r; print1(q,", ")))

Extensions

a(8) from Giovanni Resta, Jul 07 2019

A321422 Primes that are non-Chen primes whose reversal is a Chen prime.

Original entry on oeis.org

73, 733, 739, 967, 1021, 1103, 1153, 1223, 1237, 1453, 1523, 1657, 1723, 1741, 1831, 3023, 3911, 7057, 7187, 7523, 7577, 7643, 7673, 7699, 7717, 7841, 9161, 9173, 9293, 9497, 9679, 9749, 9803, 9833, 9883, 9923, 9931, 10151, 10273, 10453, 10853, 11003, 11083, 11243, 11423
Offset: 1

Author

Paolo Galliani, Nov 09 2018

Keywords

Comments

The second term of the sequence: 733 is congruent to 1 mod 61, to 2 mod 43, to 3 mod 73, where 61 is the second non-Chen prime, 43 is the first non-Chen prime and 73 is the third non-Chen prime. 733 is also congruent to 4 mod (3^6).

Crossrefs

Programs

  • Mathematica
    cpQ[n_] := Module[{rev = FromDigits[Reverse[IntegerDigits[n]]]}, PrimeOmega[n + 2] > 2 && PrimeQ[rev] && PrimeOmega[rev + 2] < 3]; Select[Prime[Range[1300]], cpQ] (* Amiram Eldar, Nov 09 2018 after Harvey P. Dale at A118725 *)
  • PARI
    forprime(p=1,10^4,w=Vecrev(digits(p));q=0;for(j=1,length(w),q=q*10+w[j]);if(ispseudoprime(q)==1,if(bigomega(p+2)>2,if(bigomega(q+2)<=2,print1(p,", ")))))

A321420 Primes p whose reversal is a Chen prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 71, 73, 101, 107, 113, 131, 149, 157, 167, 179, 181, 191, 199, 311, 347, 353, 359, 389, 701, 733, 739, 743, 751, 761, 787, 797, 919, 941, 953, 967, 971, 983, 991, 1009, 1021, 1031, 1061, 1091, 1097, 1103, 1109, 1151, 1153, 1217, 1223
Offset: 1

Author

Paolo Galliani, Nov 09 2018

Keywords

Comments

73 is the smallest non-Chen prime whose reversal is a Chen prime.

Examples

			73 is in the sequence because its reversal is 37 which is a Chen prime (because 37 + 2 = 39 has at most two prime factors).
		

Crossrefs

Programs

  • Mathematica
    cpQ[n_] := Module[{rev = FromDigits[Reverse[IntegerDigits[n]]]}, PrimeQ[rev] && PrimeOmega[rev + 2] < 3]; Select[Prime[Range[400]], cpQ] (* Amiram Eldar, Nov 09 2018 after Harvey P. Dale at A118725 *)
  • PARI
    is(n) = if(isprime(n), rn = fromdigits(Vecrev(digits(n))); return(isprime(rn) && bigomega(rn+2) <= 2), 0) \\ David A. Corneth, Nov 09 2018

A321367 Palindromic primes p such that the highest factor of p+1 is a palindromic prime and the highest factor of p-1 is also a palindromic prime.

Original entry on oeis.org

3, 5, 7, 11, 383, 38783, 12211811221, 18345254381, 36729292763, 70381018307, 1852347432581, 1874989894781, 115582393285511, 164257606752461, 187610727016781, 199239838932991, 374147565741473, 396089252980693, 15243433533434251, 18741272727214781, 32547212721274523
Offset: 1

Author

Paolo Galliani, Nov 07 2018

Keywords

Examples

			383 is in the sequence because the highest factor of 383+1 is 3, which is a palindromic prime and the highest factor of 383-1 is 191, which is a palindromic prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range[10^4], AllTrue[{FactorInteger[# - 1][[-1, 1]], #, FactorInteger[# + 1][[-1, 1]]}, And[PrimeQ@ #, PalindromeQ@ #] &] &] (* Michael De Vlieger, Nov 13 2018 *)
  • PARI
    forprime(n=3,10^9,if(Vecrev(digits(n))==digits(n),s=factor(n-1);t=factor(n+1);s=component(s,1);t=component(t,1);s=s[length(s)];t=t[length(t)];if(Vecrev(digits(s))==digits(s),if(Vecrev(digits(t))==digits(t),print1(n," , ")))))

Extensions

a(11)-a(21) from Giovanni Resta, Nov 08 2018

A321210 Palindromic primes in base 10 of the form 6*p+1, where p is a palindromic prime in base 10.

Original entry on oeis.org

787, 72781818727, 787812181218787, 72781878787818727, 78121818781812187, 78181272727218187, 7278781818181878727, 7872787812187872787, 727872187212781278727, 781272121818121272187, 781272727818727272187, 781872727212727278187, 72121872127872127812127, 72727272187278127272727
Offset: 1

Author

Paolo Galliani, Oct 30 2018

Keywords

Comments

Conjecture 1: There are infinitely many primes of this form.
Conjecture 2: 6 is the only integer k for which palindrome primes of the form k*p+1 exist, where p is a palindromic prime.
Conjecture 2 is false. A counterexample: 180 * 101 + 1 = 18181 where 101 and 18181 are palindromic primes and k = 180. - David A. Corneth, Nov 01 2018
p must have an odd number of digits (since 11 is the only palindrome prime with an even number of digits) and the leading digit of p must be 1, otherwise 6p+1 has an even number of digits. So p must have the form 1...1 and 6p+1 the form 7...7.
Some other terms of this sequence: 727872187212781278727, 781272121818121272187, 781272727818727272187, 781872727212727278187, 72121872127872127812127, 72727272187278127272727, 72781872727872727818727, 78127212127872121272187, 78181218181218181218187, 78727272121212127272787, 78787272787278727278787. - Giovanni Resta, Oct 31 2018
From Chai Wah Wu, Dec 06 2019 : (Start)
Suppose q = 6p+1 is a term written as q = a0a1a2...a2a1a0 and p = b0b1b2...b2b1b0.
The discussion above shows that a0 = 7 and b0 = 1.
b_i is either 2 or 3 for i odd and b_i is either 0 or 1 for i even (see MathExchange link).
(End)

Examples

			787 is in the sequence because 787 = 6*131 + 1, where 131 is a palindromic prime.
		

Crossrefs

Programs

  • PARI
    print1(787", " ); for(u=0, 20, z=[[1, 1], [2, 3]]; for(j=1, u-1, z=concat(z, [[0, 9]])); forvec(j=z, for(k=0, 9, n=0; for(m=1, length(j), n=n*10+j[m]); n=n*10+k; forstep(m=length(j), 1, -1, n=n*10+j[m]); if(digits(6*n+1)==Vecrev(digits(6*n+1)), if(ispseudoprime(n)==1, if(ispseudoprime(6*n+1)==1, print1(6*n+1", " )))))))
    
  • Python
    from sympy import isprime
    A321210_list = []
    for i in range(2**20):
        s = bin(i)[2:]
        s += s[-2::-1]
        p = int(s) + int('02'*(len(s)//2)+'0')
        q = 6*p+1
        t = str(q)
        if t == t[::-1] and isprime(p) and isprime(q):
            A321210_list.append(q) # Chai Wah Wu, Dec 06 2019

Extensions

a(5)-a(8) from Giovanni Resta, Oct 31 2018
a(9)-a(14) from Chai Wah Wu, Dec 05 2019

A303937 Numbers k such that k!-1 reversed is a prime.

Original entry on oeis.org

3, 5, 19, 254, 266
Offset: 1

Author

Paolo Galliani, May 03 2018

Keywords

Comments

If it exists, a(6) > 3000. - Jon E. Schoenfield, May 04 2018
If it exists, a(6) > 5703. - J.W.L. (Jan) Eerland, Aug 08 2022
If it exists, a(6) > 10142. - J.W.L. (Jan) Eerland, Aug 14 2022
If it exists, a(6) > 15000. - J.W.L. (Jan) Eerland, Oct 16 2022
If it exists, a(6) > 17506. - J.W.L. (Jan) Eerland, Nov 26 2022
If it exists, a(6) > 35000. - Michael S. Branicky, Dec 16 2024

Examples

			5 is in the sequence because 5!-1 reversed is 911, which is prime.
		

Crossrefs

Programs

  • Mathematica
    ParallelTable[If[PrimeQ[IntegerReverse[Factorial[k]-1]],k,Nothing],{k,1,5703}]//.{}->Nothing (* J.W.L. (Jan) Eerland, Aug 08 2022 *)
  • PARI
    isok(n) = isprime(fromdigits(Vecrev(digits(n!-1))));

A301806 Numbers k such that the concatenation of 2^k - 1 and 2^(k - 1) - 1 is prime.

Original entry on oeis.org

2, 3, 4, 7, 8, 12, 19, 22, 36, 46, 51, 67, 79, 215, 359, 394, 451, 1323, 2131, 3336, 3371, 6231, 19179, 39699, 51456, 56238, 69660, 75894, 79798, 92020, 174968, 176006, 181015, 285019, 331259, 360787, 366770
Offset: 1

Author

Paolo Galliani, Mar 27 2018

Keywords

Comments

541456 is a term. - Paolo Galliani, Feb 12 2020

Examples

			2 is in the sequence because the concatenation of 3 and 1 is 31, which is prime.
3 is in the sequence because the concatenation of 7 and 3 is 73, which is prime.
5 is not in the sequence because the concatenation of 31 and 15 is 3115 = 5 * 7 * 89.
		

Crossrefs

Cf. A000040, A000225, A298613 (associated primes).

Programs

  • Mathematica
    Select[Range[10^3], PrimeQ@ FromDigits[Join @@ IntegerDigits@ {2^# - 1, 2^(# - 1) - 1}] &] (* Michael De Vlieger, Oct 17 2018 *)
  • PARI
    isok(n) = isprime(eval(concat(Str(2^n-1), Str(2^(n-1)-1)))); \\ Michel Marcus, Mar 27 2018
  • PFGW
    ABC2 (2^$a-1)*10^len(2^($a-1)-1)+2^($a-1)-1 a: from x to y
    

Extensions

a(33) from Paolo Galliani, May 02 2018
a(34) from Paolo Galliani, Jun 14 2018
a(35) from Paolo Galliani, Jul 17 2018
a(36)-a(37) from Paolo Galliani, Aug 27 2018

A298702 Numbers k such that k!+1 reversed is a prime.

Original entry on oeis.org

1, 2, 3, 6, 11, 15, 17, 19, 22, 51, 867, 1909, 9641
Offset: 1

Author

Paolo Galliani, Jan 25 2018

Keywords

Comments

a(14) > 19200, if it exists. - Giovanni Resta, May 04 2018

Crossrefs

Cf. A002981.

Programs

  • Mathematica
    Do[If[PrimeQ[FromDigits[Reverse[IntegerDigits[n! + 1]]]], Print[n]], {n, 400}] (* Vincenzo Librandi, Jan 25 2018 *)
  • PARI
    isok(n) = isprime(fromdigits(Vecrev(digits(n!+1)))); \\ Michel Marcus, Jan 26 2018

Extensions

a(1)-a(3) and a(8)-a(10) from Vincenzo Librandi, Jan 25 2018
a(11)-a(12) from Paolo Galliani, May 02 2018
a(13) from Giovanni Resta, May 04 2018

A298699 Primes of the form A132583(k)*42 - 43.

Original entry on oeis.org

419, 5039, 51239, 513239, 5133239, 51333239, 5133333333333239, 513333333333333239, 5133333333333333333239, 5133333333333333333333239, 513333333333333333333333239, 513333333333333333333333333333333333333333333333239
Offset: 1

Author

Paolo Galliani, Jan 27 2018

Keywords

Comments

The corresponding values of k are 0, 1, 2, 3, 4, 5, 13, 15, 19, 22, 24, 48, 59, 187, 215, 232. - Bruno Berselli, Jan 29 2018
Further values of k (below 4000): 394, 441, 506, 541, 569, 1456, 2136, 3510. - Daniel Starodubtsev, Jan 05 2020

Examples

			5039 is prime and 5039 = 121*42 - 43, hence it is in the sequence.
51239 is prime and 51239 = 1221*42 - 43, hence it is in the sequence.
513333239 = 12222221*42 - 43 = 61*1747*4817 is not prime, therefore it is not in the sequence.
		

Crossrefs

Programs

Extensions

a(8)-a(12) from Bruno Berselli, Jan 29 2018