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.

Showing 1-2 of 2 results.

A254636 Numbers that cannot be represented as x*y + x + y, where x>=y>1.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 16, 18, 21, 22, 25, 28, 30, 33, 36, 37, 40, 42, 45, 46, 52, 57, 58, 60, 61, 66, 70, 72, 73, 78, 81, 82, 85, 88, 93, 96, 100, 102, 105, 106, 108, 112, 117, 121, 126, 130, 133, 136, 138, 141, 145, 148, 150, 156, 157, 162, 165, 166, 172
Offset: 1

Views

Author

Alex Ratushnyak, Feb 03 2015

Keywords

Comments

0, 7 and numbers n such that n+1 is either prime or twice a prime. - Robert Israel, Aug 05 2015

Crossrefs

Cf. A091529 (appears to be essentially the same, except first few terms).
Cf. A253975.

Programs

  • Maple
    sort([0,7, op(select(t -> isprime(t+1), [$1..10^4])), op(select(t -> isprime((t+1)/2),[2*i+1$i=1..5*10^3]))]); # Robert Israel, Aug 05 2015
  • Mathematica
    r[n_] := Reduce[x >= y > 1 && n == x y + x + y, {x, y}, Integers];
    Reap[For[n = 0, n <= 200, n++, If[r[n] === False, Sow[n]]]][[2, 1]] (* Jean-François Alcover, Feb 28 2019 *)
  • Python
    from sympy import primepi
    def A254636(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n-1+x-(x>=7)-primepi(x+1)-primepi(x+1>>1))
        return bisection(f,n-1,n-1) # Chai Wah Wu, Oct 14 2024

A091528 a(n) = (Sum_{k=1..n} H(k)*k!*(n-k)!) mod (n+1), where H(k) is the k-th harmonic number.

Original entry on oeis.org

1, 1, 0, 3, 4, 2, 0, 6, 6, 5, 0, 3, 8, 0, 0, 13, 0, 3, 0, 0, 12, 17, 0, 0, 14, 0, 0, 1, 0, 6, 0, 0, 18, 0, 0, 1, 20, 0, 0, 23, 0, 25, 0, 0, 24, 44, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 30, 8, 0, 36, 32, 0, 0, 0, 0, 10, 0, 0, 0, 2, 0, 56, 38, 0, 0, 0, 0, 19, 0, 0, 42, 48, 0, 0, 44, 0, 0, 6, 0, 0, 0, 0, 48, 0, 0
Offset: 1

Views

Author

Leroy Quet, Jan 08 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Table[ Mod[ Sum[ HarmonicNumber[k]k!(n - k)!, {k, 1, n}], n + 1], {n, 1, 95}] (* or *) (* Robert G. Wilson v, Jan 14 2004 *)
    h[n_] := If[ EvenQ[n], (1/2)HarmonicNumber[n/2], HarmonicNumber[n] - (1/2)HarmonicNumber[ Floor[n/2]]]; Table[ Mod[ n!h[n], n + 1], {n, 1, 95}]
    (* or *) h[n_] := Sum[1/(2k - If[ EvenQ[n], 0, 1]), {k, 1, Floor[(n + 1)/2]}]; Table[ Mod[ n!h[n], n + 1], {n, 1, 95}]

Formula

It appears that a(n) is congruent to n!*h(n) (mod {n+1}) where h(n) = (1/2)*H(n/2) for even n and h(n) = H(n) - (1/2)*H(floor(n/2)) for odd n.

Extensions

Edited and extended by Robert G. Wilson v, Jan 14 2004
Showing 1-2 of 2 results.