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.

A065860 Remainder when the n-th composite number is divided by n.

This page as a plain text file.
%I A065860 #18 Mar 08 2025 14:43:48
%S A065860 0,0,2,1,0,0,0,7,7,8,9,9,9,10,10,10,10,10,11,12,12,12,12,12,13,13,13,
%T A065860 14,15,15,15,16,16,16,16,16,17,17,17,17,17,18,19,19,19,19,19,20,20,20,
%U A065860 21,22,22,22,22,22,23,23,23,24,24,24,24,24,25,25,25,25,25,25,25,26,26
%N A065860 Remainder when the n-th composite number is divided by n.
%H A065860 Harry J. Smith, <a href="/A065860/b065860.txt">Table of n, a(n) for n = 1..1000</a>
%F A065860 a(n) = A002808(n) mod n.
%e A065860 n=100, c(100)=133, a(100)=33.
%t A065860 Module[{nn=100,cmps,len},cmps=Select[Range[nn],CompositeQ];len=Length[ cmps]; Mod[#[[1]],#[[2]]]&/@Thread[{cmps,Range[len]}]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Mar 29 2020 *)
%o A065860 (PARI)
%o A065860 Composite(n) = { my(k=n + primepi(n) + 1); while (k != n + primepi(k) + 1, k = n + primepi(k) + 1); k }
%o A065860 a(n) = { Composite(n)%n } \\ _Harry J. Smith_, Nov 02 2009
%Y A065860 Cf. A002808, A065855-A065864.
%K A065860 nonn
%O A065860 1,3
%A A065860 _Labos Elemer_, Nov 26 2001