OFFSET
1,1
COMMENTS
From Sebastian Karlsson, Jan 15 2021: (Start)
The sequence contains no powers of two. If a number isn't a power of two, then it is in this sequence if and only if either of the following conditions hold:
- It is a multiple of a prime that is not a Mersenne prime.
- It is divisible by the square of a Mersenne prime greater than 3. (End)
MATHEMATICA
fa[n_]:=fa[n]=FactorInteger[n]; phi[1]=1; phi[p_, s_]:= (p + 1)*( p - 1)^(s - 1)
phi[n_]:=Product[phi[fa[n][[i, 1]], fa[n][[i, 2]]], {i, Length[fa[n]]}];
S[n_] := NestWhile [phi, n, ! ( # == 12 || # == 3 || # == 4) &];
Select[1 + Range[100], S[#] == 12 &]
PROG
(PARI) f(n) = if(1==n, n, my(f=factor(n)); prod(i=1, #f~, (f[i, 1]+1)*((f[i, 1]-1)^(f[i, 2]-1)))); \\ A340323
isok(m) = if (m==1, return(0)); while(! ((m==3) || (m==4) || (m==12)), m = f(m)); (m==12); \\ Michel Marcus, Jan 21 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
José María Grau Ribas, Jan 07 2021
STATUS
approved