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.

A226039 Numbers k such that there exist primes p which divide k+1 and p-1 does not divide k.

This page as a plain text file.
%I A226039 #16 Feb 27 2020 16:48:19
%S A226039 5,9,11,13,14,17,19,20,21,23,25,27,29,32,33,34,35,37,38,39,41,43,45,
%T A226039 47,49,50,51,53,54,55,56,57,59,61,62,64,65,67,68,69,71,73,74,75,76,77,
%U A226039 79,81,83,84,85,86,87,89,90,91,92,93,94,95,97,98,99,101,103
%N A226039 Numbers k such that there exist primes p which divide k+1 and p-1 does not divide k.
%H A226039 Peter Luschny, <a href="http://www.luschny.de/math/euler/GeneralizedBernoulliNumbers.html">Generalized Bernoulli numbers</a>.
%e A226039 20 is in this list because 7 divides 21 but 6 does not divide 20.
%p A226039 s := (p,n) -> ((n+1) mod p = 0) and (n mod (p-1) <> 0);
%p A226039 F := n -> select(p -> s(p,n), select('isprime', [$2..n]));
%p A226039 A226039_list := n -> select(k -> [] <> F(k), [$0..n]);
%p A226039 A226039_list(103);
%t A226039 selQ[n_] := AnyTrue[Prime[Range[PrimePi[n+1]]], Divisible[n+1, #] && !Divisible[n, #-1]&];
%t A226039 Select[Range[103], selQ] (* _Jean-François Alcover_, Jul 08 2019 *)
%o A226039 (Sage)
%o A226039 def F(n): return any(p for p in primes(n) if (n+1) % p == 0 and n % (p-1) != 0)
%o A226039 def A226039_list(n): return list(filter(F, (0..n)))
%o A226039 A226039_list(103)
%Y A226039 Cf. A226038, A226040.
%K A226039 nonn
%O A226039 1,1
%A A226039 _Peter Luschny_, May 27 2013