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.

A242965 Numbers whose anti-divisors are all primes.

Original entry on oeis.org

3, 4, 5, 7, 8, 11, 16, 17, 19, 29, 43, 47, 61, 64, 71, 79, 89, 101, 107, 109, 151, 191, 197, 223, 251, 271, 317, 349, 359, 421, 439, 461, 521, 569, 601, 631, 659, 673, 691, 701, 719, 811, 821, 881, 911, 919, 947, 971, 991, 1009, 1024, 1051, 1091, 1109, 1153
Offset: 1

Views

Author

Paolo P. Lava, May 28 2014

Keywords

Examples

			The anti-divisors of 191 are all primes: 2, 3, 127.
The same for 1024: 3, 23, 89, 683.
		

Crossrefs

Programs

  • Maple
    P := proc(q) local k,ok,n; for n from 3 to q do ok:=1;
    for k from 2 to n-1 do if abs((n mod k)-k/2)<1 then
    if not isprime(k) then ok:=0; break; fi; fi; od;
    if ok=1 then print(n); fi; od; end: P(10^3);
  • Python
    from sympy import divisors, isprime
    for n in range(3, 10**4):
        for d in [2*d for d in divisors(n) if n > 2*d and n % (2*d)] + \
                 [d for d in divisors(2*n-1) if n > d >= 2 and n % d] + \
                 [d for d in divisors(2*n+1) if n > d >= 2 and n % d]:
            if not isprime(d):
                break
        else:
            print(n, end=', ')
    # Chai Wah Wu, Aug 15 2014

A241556 Number of prime anti-divisors m of n.

Original entry on oeis.org

0, 0, 1, 1, 2, 0, 3, 2, 1, 2, 3, 1, 3, 1, 1, 2, 5, 2, 3, 2, 1, 2, 3, 1, 4, 2, 3, 4, 3, 0, 3, 4, 3, 2, 3, 0, 3, 4, 3, 1, 2, 2, 5, 2, 3, 4, 5, 2, 3, 2, 1, 3, 4, 0, 3, 2, 3, 4, 5, 3, 4, 3, 2, 2, 3, 2, 5, 2, 1, 2, 5, 4, 5, 2, 1, 2, 5, 2, 3, 4, 3, 3, 4, 1, 4, 2, 3, 4, 3, 0, 3, 4, 5, 4, 3, 0
Offset: 1

Views

Author

Michael De Vlieger, Aug 08 2014

Keywords

Comments

The maximum value of a(n) is 9 for 1 <= n <= 10000.
There are 167 instances of a(n) = 0 for 1 <= n <= 10000 (See A241557).

Examples

			a(10) = 2, since 10 has 3 anti-divisors {3, 4, 7}; only {3, 7} are prime.
a(9223) = 9; these are {2, 3, 5, 7, 11, 13, 17, 31, 43}.
		

Crossrefs

Programs

  • Mathematica
    primeAntiDivisors[n_] := Select[Cases[Range[2, n - 1], _?(Abs[Mod[n, #] - #/2] < 1 &)], PrimeQ]; a241556[n_Integer] := Map[Length[primeAntiDivisors[#]] &, Range[n]]; a241556[120]
Showing 1-2 of 2 results.