A271393 a(1) = 3, a(n+1) = (3^a(n)-1)/2.
3, 13, 797161
Offset: 1
Keywords
References
- R. Steuerwald (1948), see A005935.
Programs
-
Mathematica
NestList[(3^# - 1)/2 &, 3, 3] (* Michael De Vlieger, Apr 06 2016 *)
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.
NestList[(3^# - 1)/2 &, 3, 3] (* Michael De Vlieger, Apr 06 2016 *)
Select[Range[3, 2*10^6], PowerMod[3, #-1, #] == 1 && GCD[#, #-1 + PowerMod[2, #-1, #]] == 1 &] (* Giovanni Resta, Aug 18 2018 *)
isok(k) = (k>2) && (Mod(3, k)^(k-1) == Mod(1, k)) && (gcd(k, 2^(k-1)-1) == 1); \\ Michel Marcus, Aug 18 2018
216 is a term since 216^2 + 1 = 46657 is a Fermat pseudoprime to base 3.
Select[Range[10^3], CompositeQ[#^2 + 1] && PowerMod[3, #^2, #^2 + 1] == 1 &]
Comments