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.

A152952 Von Staudt primes which are not safe primes (A005385).

Original entry on oeis.org

239, 443, 647, 659, 827, 1223, 1259, 1499, 1787, 1847, 2087, 2243, 2339, 2687, 2699, 3299, 3659, 3767, 4943, 5903, 6263, 6287, 6299, 6563, 6863, 6959, 7043, 7487, 7583, 7883, 7907, 7919, 8087, 8219, 8243, 8387, 8627, 8663
Offset: 1

Views

Author

Peter Luschny, Dec 25 2008

Keywords

Examples

			239 is a von Staudt prime because the denominator(B(239-1)/(239-1))=239*12, where B(n) is the Bernoulli number, but (239-1)/2=119=7*17 is not a prime.
		

Crossrefs

Programs

  • Maple
    a := proc(n) local k,L; L:= []; for k from 11 by 12 to n do map(i->i+1,divisors(k-1)); select(isprime,%) minus {2,3}; if % = {k} then L := [op(L),k] fi; od; select(isprime,map(i->i+i+1,select(isprime,[$1..iquo(n,2)]))): sort(convert(convert(L,set) minus convert(%,set),list)): end:
  • Mathematica
    vonStaudtPrimeQ[p_?PrimeQ] := Denominator[BernoulliB[p-1]/(p-1)] == 12*p; safePrimeQ[p_?PrimeQ] := PrimeQ[(p-1)/2]; Reap[For[p = 2, p < 10^4, p = NextPrime[p], If[vonStaudtPrimeQ[p] && !safePrimeQ[p], Print[p]; Sow[p]]]][[2, 1]] (* Jean-François Alcover, Jan 27 2014 *)