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.

A113646 a(n) is the smallest composite integer which is >= n.

This page as a plain text file.
%I A113646 #28 Oct 04 2024 02:48:09
%S A113646 4,4,4,4,6,6,8,8,9,10,12,12,14,14,15,16,18,18,20,20,21,22,24,24,25,26,
%T A113646 27,28,30,30,32,32,33,34,35,36,38,38,39,40,42,42,44,44,45,46,48,48,49,
%U A113646 50,51,52,54,54,55,56,57,58,60,60,62,62,63,64,65,66,68,68,69,70,72,72
%N A113646 a(n) is the smallest composite integer which is >= n.
%H A113646 Reinhard Zumkeller, <a href="/A113646/b113646.txt">Table of n, a(n) for n = 1..10000</a>
%F A113646 a(1) = a(2) = 4. For n >= 3, a(n) = A014683(n).
%p A113646 # This Maple program returns the smallest composite greater than n - _N. J. A. Sloane_, Sep 11 2019
%p A113646 iscomp := n-> if isprime(n) or (n=1) then false else true; fi;
%p A113646 f := proc(n) local a; global iscomp; a:=n+1; while not iscomp(a) do a:=a+1; od; a; end;
%t A113646 Table[k = n; While[! CompositeQ@ k, k++]; k, {n, 72}] (* _Michael De Vlieger_, Sep 06 2017 *)
%o A113646 (Haskell)
%o A113646 a113646 n = if n < 3 then 4 else a014683 n
%o A113646 -- _Reinhard Zumkeller_, Nov 01 2014
%o A113646 (Python)
%o A113646 from sympy import isprime
%o A113646 def a(n):
%o A113646   an = max(4, n)
%o A113646   while isprime(an): an += 1
%o A113646   return an
%o A113646 print([a(n) for n in range(1, 73)]) # _Michael S. Branicky_, Apr 04 2021
%o A113646 (Python)
%o A113646 from sympy import isprime
%o A113646 def A113646(n): return n+isprime(n) if n>2 else 4 # _Chai Wah Wu_, Oct 03 2024
%Y A113646 Cf. A002808, A014683.
%K A113646 nonn
%O A113646 1,1
%A A113646 _Leroy Quet_, Jan 15 2006