cp's OEIS Frontend

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.

A371759 a(n) is the smallest n-gonal number that is a Fermat pseudoprime to base 2 (A001567), or -1 if no such number exists.

This page as a plain text file.
%I A371759 #8 Apr 10 2024 09:42:48
%S A371759 561,1194649,7957,561,23377,341,129889,1105,35333,561,204001,31609,
%T A371759 2940337,1105,493697,8481,13981,1905,88561,41665,10680265,1729,107185,
%U A371759 264773,449065,6601,2165801,23001,1141141,13981,272251,4369,17590957,15841,137149,2821,561
%N A371759 a(n) is the smallest n-gonal number that is a Fermat pseudoprime to base 2 (A001567), or -1 if no such number exists.
%C A371759 The corresponding indices of the n-gonal numbers are 33, 1093, 73, 17, 97, ... (A371760).
%H A371759 Amiram Eldar, <a href="/A371759/b371759.txt">Table of n, a(n) for n = 3..10000</a>
%H A371759 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PolygonalNumber.html">Polygonal Number</a>.
%H A371759 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PouletNumber.html">Poulet Number</a>.
%H A371759 Wikipedia, <a href="http://en.wikipedia.org/wiki/Polygonal_number">Polygonal number</a>.
%H A371759 Wikipedia, <a href="http://en.wikipedia.org/wiki/Pseudoprime">Pseudoprime</a>.
%H A371759 <a href="/index/Ps#pseudoprimes">Index entries for sequences related to pseudoprimes</a>.
%F A371759 a(n) = ((n-2)*k^2 - (n-4)*k)/2, where k = A371760(n).
%e A371759 a(4) = A001220(1)^2 = 1093^2 = 1194649. The only known square base-2 pseudoprimes are the squares of the Wieferich primes (A001220).
%t A371759 p[k_, n_] := ((n-2)*k^2 - (n-4)*k)/2; pspQ[n_] := CompositeQ[n] && PowerMod[2, n - 1, n] == 1; a[n_] := Module[{k = 2}, While[! pspQ[p[k, n]], k++]; p[k, n]]; Array[a, 50, 3]
%o A371759 (PARI) p(k, n) = ((n-2)*k^2 - (n-4)*k)/2;
%o A371759 ispsp(n) = !isprime(n) && Mod(2, n)^(n-1) == 1;
%o A371759 a(n) = {my(k = 2); while(!ispsp(p(k, n)), k++); p(k, n);}
%Y A371759 Cf. A001220, A001567, A293622, A293623, A322130, A321868, A321870, A322123, A322160, A371760.
%K A371759 nonn
%O A371759 3,1
%A A371759 _Amiram Eldar_, Apr 05 2024