A066078 Duplicate of A058339.
2, 3, 4, 4, 2, 6, 6, 4, 2, 2, 2, 8, 9, 4, 2, 2, 2, 9, 2, 2, 17, 2, 2, 6, 17, 4, 2, 2, 9, 6, 2, 2, 2, 2
Offset: 1
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.
For p=2, phi(x)=1 has only two solutions, but they are 1 and 2, not 2 and 4, so 2 is not in the sequence.
filter:= n -> isprime(n) and nops(numtheory:-invphi(n-1))=2: select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Aug 12 2016
Take[Rest@ Keys@ Select[KeySelect[KeyMap[# + 1 &, PositionIndex@ Array[EulerPhi, 10^4]], PrimeQ], Length@ # == 2 &], 54] (* Michael De Vlieger, Dec 29 2017 *)
Solutions to 1+phi(x)=13 are {13, 21, 26, 28, 36, 42} of which the 5 composites are in the sequence.
[n: n in [1..200] |not IsPrime(n) and IsPrime(EulerPhi(n)+1)]; // Vincenzo Librandi, Jul 02 2016
select(n -> not isprime(n) and isprime(1+numtheory:-phi(n)), [$1..1000]); # Robert Israel, Dec 29 2017
Select[Complement[Range@ #, Prime@ Range@ PrimePi@ #] &@ 150, PrimeQ[EulerPhi@ # + 1] &] (* Michael De Vlieger, Jul 01 2016 *)
isok(k) = { !isprime(k) && isprime(eulerphi(k) + 1) } \\ Harry J. Smith, Nov 10 2009
N:= 100: # To get a(1)..a(N) P:= ithprime(N-1): S:= select(t -> isprime(t) and t <= P,map(-1+numtheory:-sigma, [$1..P])): T:= Statistics:-Tally(sort(S),output=table): ListTools:-PartialSums([1,seq(T[ithprime(i)],i=1..N-1)]); # Robert Israel, Dec 27 2017
first(n) = my(res = vector(n), a = 1); res[1] = 1; for(k=2, n, for(x=1, prime(k-1), if(prime(k-1) == (sigma(x) - 1), a++)); res[k] = a); res \\ Iain Fox, Dec 28 2017
The set {k: phi(k) = 12} is {13, 21, 26, 28, 36, 42}. Thus, if phi(k) = prime(6) - 1, the equation has exactly four even solutions. Hence, a(6) = 4.
r = 87; lst1 = Table[EulerPhi[n], {n, (Prime[r] - 1)^2 + 2}]; lst2 = {}; Do[p = Prime[n]; AppendTo[lst2, Length@Select[Flatten@Position[Take[lst1, {p - 1, (p - 1)^2 + 2}], Prime[n] - 1], OddQ]], {n, r}]; lst2
The set {k: phi(k) = 12} is {13, 21, 26, 28, 36, 42}. Thus, if phi(k) = prime(6) - 1, the equation has exactly two odd solutions. Hence, a(6) = 2.
r = 87; lst1 = Table[EulerPhi[n], {n, (Prime[r] - 1)^2 + 1}]; lst2 = {}; Do[p = Prime[n]; AppendTo[lst2, Length@Select[Flatten@Position[Take[lst1, {p - 1, (p - 1)^2 + 1}], Prime[n] - 1], EvenQ]], {n, r}]; lst2
For n = 38, phi(38) + 1 = 19 and sigma(38) - 1 = 1 + 2 + 19 + 38 - 1 = 59. [corrected by _Peter Munn_, Dec 30 2017]
Do[s=-1+DivisorSigma[1, n]; s1=1+EulerPhi[n]; If[PrimeQ[s]&&PrimeQ[s1]&&!PrimeQ[n], Print[{n, s1, s}]], {n, 1, 1000}] (* generates sequence and related primes too *) Select[Range@ 300, And[CompositeQ@ #, AllTrue[{1 + EulerPhi@ #, -1 + DivisorSigma[1, #]}, PrimeQ]] &] (* Michael De Vlieger, Dec 29 2017 *)
isok(n) = !isprime(n) && isprime(1+eulerphi(n)) && isprime(sigma(n)-1); \\ Michel Marcus, Dec 29 2017
Comments