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.
%I A214606 #37 Sep 08 2022 08:46:02 %S A214606 1,2,3,2,5,2,7,2,3,2,11,2,13,2,3,2,17,2,19,2,3,2,23,2,5,2,3,14,29,2, %T A214606 31,2,3,2,1,2,37,2,3,2,41,2,43,2,15,2,47,2,7,2,3,2,53,2,1,2,3,2,59,2, %U A214606 61,2,3,2,5,2,67,2,3,14,71,2,73,2,3,2,1,2,79 %N A214606 a(n) = gcd(n, 2^n - 2). %C A214606 Greatest common divisor of n and 2^n - 2. %C A214606 a(n)=n iff n=1 or n is prime or n is Fermat pseudoprime to base 2 or even pseudoprime to base 2. - Corrected by _Thomas Ordowski_, Jan 25 2016 %C A214606 Indices of 1's: A121707 preceded by 1. - False, see A267999. %C A214606 Numbers n such that a(n) does not equal A020639(n) (the least prime factor of n): A146077. %H A214606 Charles R Greathouse IV, <a href="/A214606/b214606.txt">Table of n, a(n) for n = 1..10000</a> %e A214606 a(3) = 3 because 2^3 - 2 = 6 and gcd(3, 6) = 3. %e A214606 a(4) = 2 because 2^4 - 2 = 14 and gcd(4, 14) = 2. %p A214606 seq(igcd(n, (2&^n - 2) mod n), n=1 .. 1000); # _Robert Israel_, Jan 26 2016 %t A214606 Table[GCD[n, 2^n - 2], {n, 1, 59}] (* _Alonso del Arte_, Jul 22 2012 *) %o A214606 (Java) %o A214606 import java.math.BigInteger; %o A214606 public class A214606 { %o A214606 public static void main (String[] args) { %o A214606 BigInteger c1 = BigInteger.valueOf(1); %o A214606 BigInteger c2 = BigInteger.valueOf(2); %o A214606 for (int n=0; n<222; n++) { %o A214606 BigInteger bn=BigInteger.valueOf(n),pm2=c1.shiftLeft(n).subtract(c2); %o A214606 System.out.printf("%s, ", bn.gcd(pm2).toString()); %o A214606 } %o A214606 } %o A214606 } %o A214606 (PARI) a(n)=gcd(n,lift(Mod(2,n)^n-2)) \\ _Charles R Greathouse IV_, May 29 2014 %o A214606 (Magma) [GCD(n, 2^n-2): n in [1..80]]; // _Vincenzo Librandi_, Jan 26 2016 %Y A214606 Cf. A000918, A064535, A121707, A020639, A146077. %K A214606 nonn,easy %O A214606 1,2 %A A214606 _Alex Ratushnyak_, Jul 22 2012