A210479 Primes p with p-1 and p+1 both practical: "Sandwich of the first kind".
3, 5, 7, 17, 19, 29, 31, 41, 79, 89, 127, 197, 199, 271, 307, 379, 449, 461, 463, 521, 701, 727, 811, 859, 881, 919, 929, 967, 991, 1217, 1231, 1289, 1301, 1409, 1471, 1481, 1483, 1567, 1721, 1889, 1951, 1999, 2129, 2393, 2441, 2549, 2551, 2729, 2753, 2861, 2969, 3041, 3079, 3319, 3329, 3331, 3499, 3739, 3761, 4049
Offset: 1
Keywords
Examples
a(1)=3 since 2 and 4 are practical. a(2)=5 since 4 and 6 are practical.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Sandwiches with primes and practical numbers, a message to Number Theory List, Jan. 13, 2013.
- Zhi-Wei Sun, Conjectures on representations involving primes, in: M. Nathanson (ed.), Combinatorial and Additive Number Theory II: CANT, New York, NY, USA, 2015 and 2016, Springer Proc. in Math. & Stat., Vol. 220, Springer, New York, 2017, pp. 279-310. (See also arXiv:1211.1588 [math.NT], 2012-2017.)
Programs
-
Mathematica
f[n_]:=f[n]=FactorInteger[n] Pow[n_, i_]:=Pow[n, i]=Part[Part[f[n], i], 1]^(Part[Part[f[n], i], 2]) Con[n_]:=Con[n]=Sum[If[Part[Part[f[n], s+1], 1]<=DivisorSigma[1, Product[Pow[n, i], {i, 1, s}]]+1, 0, 1], {s, 1, Length[f[n]]-1}] pr[n_]:=pr[n]=n>0&&(n<3||Mod[n, 2]+Con[n]==0) n=0 Do[If[pr[Prime[k]-1]==True&&pr[Prime[k]+1]==True,n=n+1;Print[n," ",Prime[k]]],{k,1,100}]
-
PARI
is_A210479(p)={is_A005153(p-1) && is_A005153(p+1) && isprime(p)} \\ M. F. Hasler, Jan 23 2013
-
PARI
A210479(n,print_all=0)={forprime(p=3,, is_A005153(p-1) & is_A005153(p+1) & !(print_all & print1(p",")) & !n-- & return(p))} \\ M. F. Hasler, Jan 23 2013
Comments