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.

A007535 Smallest pseudoprime ( > n ) to base n: smallest composite number m > n such that n^(m-1)-1 is divisible by m.

This page as a plain text file.
%I A007535 M5440 #43 Feb 16 2025 08:32:31
%S A007535 4,341,91,15,124,35,25,9,28,33,15,65,21,15,341,51,45,25,45,21,55,69,
%T A007535 33,25,28,27,65,45,35,49,49,33,85,35,51,91,45,39,95,91,105,205,77,45,
%U A007535 76,133,65,49,66,51,65,85,65,55,63,57,65,133,87,341,91,63,341,65,112,91
%N A007535 Smallest pseudoprime ( > n ) to base n: smallest composite number m > n such that n^(m-1)-1 is divisible by m.
%C A007535 a(k-1) = k for odd composite numbers k = {9, 15, 21, 25, 27, 33, 35, 39, 45, 49, 51, ...} = A071904(n). - _Alexander Adamchuk_, Dec 13 2006
%D A007535 A. H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 42 (but beware errors in his table for n = 28, 58, 65, 77, 100).
%D A007535 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A007535 T. D. Noe, <a href="/A007535/b007535.txt">Table of n, a(n) for n = 1..10000</a>
%H A007535 G. P. Michon, <a href="http://www.numericana.com/answer/pseudo.htm">Pseudoprimes</a>
%H A007535 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/FermatsLittleTheorem.html">Fermat's Little Theorem.</a>
%H A007535 Wikipedia, <a href="http://en.wikipedia.org/wiki/Pseudoprime">Pseudoprime</a>
%H A007535 <a href="/index/Ps#pseudoprimes">Index entries for sequences related to pseudoprimes</a>
%t A007535 f[n_] := Block[{k = n + 1}, While[PrimeQ[k] || PowerMod[n, k - 1, k] != 1, k++ ]; k]; Table[ f[n], {n, 67}] (* _Robert G. Wilson v_, Sep 18 2004 *)
%o A007535 (Haskell)
%o A007535 import Math.NumberTheory.Moduli (powerMod)
%o A007535 a007535 n = head [m | m <- dropWhile (<= n) a002808_list,
%o A007535                       powerMod n (m - 1) m == 1]
%o A007535 -- _Reinhard Zumkeller_, Jul 11 2014
%o A007535 (PARI) a(n)=forcomposite(m=n+1,, if(Mod(n, m)^(m-1)==1, return(m))) \\ _Charles R Greathouse IV_, May 18 2015
%Y A007535 Records in A098653 & A098654.
%Y A007535 Cf. A071904, A002808.
%K A007535 nonn,nice,easy
%O A007535 1,1
%A A007535 _N. J. A. Sloane_, _Mira Bernstein_, _Robert G. Wilson v_
%E A007535 Corrected and extended by _Patrick De Geest_, October 2000